/* Video Player Styles */
.plyr {
    width: 100%;
    height: 100%;
    min-height: 360px;
    --plyr-color-main: #2563eb;
}

.plyr--video {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

/* Loading Animation */
.loading-spinner {
    display: none;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alert Styles */
.alert {
    display: none;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

/* Query History Styles */
#queryHistory {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    background-color: #f8fafc;
    transform: translateY(-1px);
}

/* Header Background */
.gradient-bg {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}

/* Resource Card Styles */
.content-preview {
    max-height: 200px;
    overflow-y: auto;
}

.resource-card {
    transition: all 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.resource-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgb(0 0 0 / 0.1);
}

/* Video Container Styles */
.aspect-w-16.aspect-h-9 {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    width: 100%;
    background: #000;
}

.aspect-w-16.aspect-h-9 video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* 保持视频比例 */
}

.resource-card .p-4 {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.resource-card p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.resource-card .flex.items-center {
    margin-top: auto;
}

/* Tab Navigation */
.tab-active {
    border-bottom: 2px solid #2563eb;
    color: #2563eb;
}

/* Navbar Styles */
.navbar {
    backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
}

.nav-link {
    position: relative;
    transition: all 0.2s;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #2563eb;
    transition: all 0.2s;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Header Styles */
.hero-section {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/static/img/grid.svg') center/cover;
    opacity: 0.1;
}

.hero-title {
    background: linear-gradient(to right, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Footer Styles */
.footer {
    background-color: #1e293b;
    color: #e2e8f0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-heading {
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-link {
    color: #94a3b8;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid #334155;
}

/* Video Preview Styles */
.preview-progress {
    cursor: pointer;
}

.preview-progress:hover .preview-progress-bar {
    background-color: #60a5fa;
}

.preview-play-btn,
.preview-expand-btn,
.preview-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
}

.preview-play-btn:hover,
.preview-expand-btn:hover,
.preview-close-btn:hover {
    background-color: rgba(37, 99, 235, 0.8);
}

.preview-modal {
    backdrop-filter: blur(8px);
}

.preview-modal-player {
    max-height: 80vh;
}

/* Video Thumbnail Preview */
.preview-thumbnail {
    width: 160px;
    height: 90px;
    left: var(--preview-position);
    pointer-events: none;
    z-index: 10;
}

.preview-thumbnail-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-thumbnail-time {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 11px;
}

/* Video Poster Styles */
.poster-overlay {
    transition: opacity 0.3s ease;
}

.preview-play-btn-large {
    transform: scale(1);
    transition: all 0.2s ease;
}

.preview-play-btn-large:hover {
    transform: scale(1.1);
}

.preview-play-btn-large i {
    transform: translateX(2px);
}

/* General Spacing and Layout */
.section-spacing {
    margin-bottom: 3rem;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Enhanced Card Shadows */
.shadow-card {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
                0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.shadow-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
                0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Subtle Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Enhanced Color Scheme */
:root {
    --primary-light: #60a5fa;
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary-light: #a5b4fc;
    --secondary: #6366f1;
    --secondary-dark: #4f46e5;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
}

/* Resource Card Enhancements */
.resource-card {
    transition: all 0.3s ease;
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.15);
}

/* Tab Animations */
.resource-tab {
    position: relative;
    transition: all 0.3s ease;
}

.resource-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.resource-tab:hover::after,
.resource-tab.tab-active::after {
    transform: scaleX(1);
}

/* Question Button Animations */
.suggested-question {
    transition: all 0.2s ease;
}

.suggested-question:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Search Input Enhancement */
.search-input-wrapper {
    position: relative;
}

.search-input-wrapper i {
    transition: color 0.2s ease;
}

.search-input-wrapper:focus-within i {
    color: var(--primary);
}
