/* ==============================================
   Educational Videos Styles
   ============================================== */

/* Video Search Bar */
.video-search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.video-search-bar i {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.video-search-bar input {
    flex: 1;
    border: 2px solid var(--border);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 1rem;
    background: var(--background);
    color: var(--text-primary);
}

.video-search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Videos Container */
.videos-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Video Tabs */
.video-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

.video-tab {
    background: var(--surface);
    border: 2px solid var(--border);
    border-bottom: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.video-tab span {
    white-space: nowrap;
}

.video-tab:hover {
    background: var(--surface-alt);
    transform: translateY(-2px);
}

.video-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Videos Content */
.videos-content {
    min-height: 400px;
}

/* Video Category Header */
.video-category-header {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.video-category-header i {
    font-size: 2rem;
    color: var(--primary-color);
}

.video-category-header h2 {
    margin: 0;
    color: var(--text-primary);
}

/* Videos Grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

/* Video Card */
.video-card {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

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

/* Video Thumbnail */
.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    cursor: pointer;
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.9);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.video-thumbnail:hover .video-play-overlay {
    background: rgba(37, 99, 235, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-play-overlay i {
    font-size: 2.5rem;
    color: white;
}

.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Video Info */
.video-info {
    padding: 1.5rem;
}

.video-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.video-header h3 {
    flex: 1;
    margin: 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    line-height: 1.4;
}

.video-level {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.video-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Video Instructor */
.video-instructor {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--surface-alt);
    border-radius: 6px;
    margin-bottom: 1rem;
}

.video-instructor i {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-top: 0.2rem;
}

.video-instructor div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.video-instructor strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.video-instructor span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Video Tags */
.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.video-tag {
    background: var(--surface-alt);
    color: var(--text-secondary);
    padding: 0.3rem 0.7rem;
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
}

/* Video Actions */
.video-actions {
    display: flex;
    gap: 0.75rem;
}

.video-actions .btn {
    flex: 1;
}

/* Playlists */
.playlists-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.playlists-header i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.playlists-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2rem;
}

.playlist-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.playlist-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.playlist-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.playlist-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.playlist-icon i {
    font-size: 1.8rem;
    color: white;
}

.playlist-info h3 {
    margin: 0 0 0.3rem 0;
    color: var(--text-primary);
}

.playlist-level {
    display: inline-block;
    background: #f59e0b;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.playlist-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.playlist-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: var(--surface-alt);
    border-radius: 6px;
}

.playlist-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.playlist-meta i {
    color: var(--primary-color);
}

.playlist-videos {
    margin-bottom: 1.5rem;
}

.playlist-videos-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.playlist-video-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--background);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.video-number {
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.playlist-video-item .video-title {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.playlist-video-item .video-duration {
    color: var(--text-secondary);
    font-size: 0.85rem;
    position: static;
    background: none;
}

.playlist-more {
    text-align: center;
    padding: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
}

/* Video Player Modal */
.video-player-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-player-modal.active {
    opacity: 1;
}

.video-player-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    aspect-ratio: 16/9;
}

.video-player-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.video-player-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.video-player-container {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.video-player-container iframe {
    width: 100%;
    height: 100%;
}

/* Search Results */
.search-results-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: 8px;
}

.search-results-header i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.search-results-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.results-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.search-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.search-no-results i {
    font-size: 4rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.search-no-results h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.search-no-results p {
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .video-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 1rem;
    }
    
    .video-tab {
        flex-shrink: 0;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .videos-grid,
    .playlists-grid {
        grid-template-columns: 1fr;
    }
    
    .video-search-bar {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .video-search-bar input,
    .video-search-bar button {
        width: 100%;
    }
    
    .video-actions {
        flex-direction: column;
    }
    
    .video-player-content {
        width: 95%;
    }
    
    .video-player-close {
        top: -40px;
        width: 35px;
        height: 35px;
    }
}

/* Dark Theme */
[data-theme="dark"] .video-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .video-instructor {
    background: #0f172a;
}

[data-theme="dark"] .video-tag {
    background: #334155;
    border-color: #475569;
}

[data-theme="dark"] .playlist-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .playlist-meta {
    background: #0f172a;
}

[data-theme="dark"] .playlist-video-item {
    background: #0f172a;
    border-color: #334155;
}
