/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #e2e8f0;
    background: #0f0f23;
    background-image: 
        radial-gradient(circle at 25% 25%, #1e1b4b 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, #312e81 0%, transparent 50%);
    background-attachment: fixed;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.back-btn {
    margin-top: 15px;
    margin-left: 15px;
    background: #222;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    transition: 0.2s ease;
}
.back-btn:hover {
    background: #444;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="0.5" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.header-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #a855f7, #06b6d4, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 30px rgba(168, 85, 247, 0.3);
}

.header-subtitle {
    font-size: 1.4rem;
    font-weight: 400;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    color: #cbd5e1;
}

/* Main Content */
.main {
    padding: 80px 0;
}

/* Search Section */
.search-section {
    margin-bottom: 80px;
}

.search-container {
    display: flex;
    max-width: 500px;
    margin: 0 auto 50px;
    position: relative;
}

.search-input {
    flex: 1;
    padding: 18px 24px;
    font-size: 1.1rem;
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
    border: 2px solid #334155;
    border-radius: 16px 0 0 16px;
    outline: none;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
}

.search-input::placeholder {
    color: #64748b;
}

.search-input:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.2);
    background: rgba(30, 41, 59, 0.95);
}

.search-btn {
    padding: 18px 24px;
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    color: white;
    border: none;
    border-radius: 0 16px 16px 0;
    cursor: pointer;
    transition: all 0.4s ease;
}

.search-btn:hover {
    background: linear-gradient(135deg, #9333ea, #7c3aed);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 14px 28px;
    background: rgba(30, 41, 59, 0.6);
    color: #94a3b8;
    border: 2px solid #334155;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.filter-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.2), transparent);
    transition: left 0.5s ease;
}

.filter-tab:hover::before {
    left: 100%;
}

.filter-tab:hover,
.filter-tab.active {
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    color: white;
    border-color: #a855f7;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.4);
}

/* Category Sections */
.category-section {
    margin-bottom: 80px;
}

.category-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 20px;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #a855f7, #06b6d4, #10b981);
    border-radius: 2px;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

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

/* Video Card */
.video-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid #334155;
    border-radius: 20px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    transition: all 0.5s ease;
    cursor: pointer;
    position: relative;
}

.video-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(6, 182, 212, 0.1));
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
    pointer-events: none;
}

.video-card:hover::before {
    opacity: 1;
}

.video-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border-color: #a855f7;
}

/* Video Thumbnail */
.video-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    filter: brightness(0.8);
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.1);
    filter: brightness(1);
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.8), rgba(6, 182, 212, 0.6));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 2;
}

.video-card:hover .video-overlay {
    opacity: 1;
}

.play-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #a855f7;
    border: none;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s ease;
    transform: scale(0.8);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.video-card:hover .play-btn {
    transform: scale(1.1);
    background: white;
    box-shadow: 0 12px 35px rgba(168, 85, 247, 0.4);
}

.video-duration {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    z-index: 3;
}

/* Video Info */
.video-info {
    padding: 30px;
    position: relative;
    z-index: 2;
}

.video-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 15px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.video-card:hover .video-title {
    color: #a855f7;
}

.video-description {
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-category {
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    color: white;
    padding: 6px 16px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.video-date {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Stats Section */
.stats-section {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #334155;
    border-radius: 25px;
    padding: 80px 50px;
    margin: 100px 0;
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(6, 182, 212, 0.1));
    z-index: 1;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 50px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.stat-item {
    padding: 25px;
    transition: transform 0.4s ease;
}

.stat-item:hover {
    transform: translateY(-8px);
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a855f7, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    text-shadow: 0 0 30px rgba(168, 85, 247, 0.3);
}

.stat-label {
    font-size: 1.2rem;
    color: #cbd5e1;
    font-weight: 600;
}

/* Footer */
.footer {
    background: rgba(15, 15, 35, 0.9);
    color: #64748b;
    padding: 50px 0;
    text-align: center;
    border-top: 1px solid #334155;
    backdrop-filter: blur(10px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-title {
        font-size: 3rem;
    }
    
    .header-subtitle {
        font-size: 1.2rem;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .filter-tabs {
        gap: 8px;
    }
    
    .filter-tab {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .search-container {
        max-width: 100%;
        margin-bottom: 40px;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
    
    .stat-number {
        font-size: 2.8rem;
    }
    
    .stats-section {
        padding: 60px 30px;
        margin: 60px 0;
    }
    
    .category-title {
        font-size: 2rem;
    }
    
    .video-info {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 80px 0;
    }
    
    .main {
        padding: 60px 0;
    }
    
    .video-title {
        font-size: 1.2rem;
    }
    
    .video-description {
        font-size: 0.95rem;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .header-title {
        font-size: 2.5rem;
    }
}

/* Hidden class for filtering */
.hidden {
    display: none !important;
}

/* Animation for filtering */
.video-card {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #9333ea, #7c3aed);
}

/* Selection styling */
::selection {
    background: rgba(168, 85, 247, 0.3);
    color: #f1f5f9;
}

/* Video Overlay Player */
.video-overlay-player {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.video-overlay-player.active {
    opacity: 1;
    visibility: visible;
}

.video-player-container {
    position: relative;
    width:80%;
    max-width: 1000px;
    background: rgba(30, 41, 59, 0.95);
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid #334155;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
    transform: scale(0.8);
    transition: transform 0.4s ease;
}

.video-overlay-player.active .video-player-container {
    transform: scale(1);
}

.video-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(15, 15, 35, 0.9);
    border-bottom: 1px solid #334155;
}

.video-player-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
}

.close-player-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.close-player-btn:hover {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
    transform: scale(1.1);
}

.video-player-content {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-element {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-align: center;
    padding: 40px;
}

.video-placeholder-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.video-placeholder h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #94a3b8;
}

.video-placeholder p {
    font-size: 1rem;
    line-height: 1.6;
    max-width: 400px;
}

.video-player-info {
    padding: 30px;
    background: rgba(30, 41, 59, 0.8);
}

.video-player-description {
    color: #cbd5e1;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.video-player-meta {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.video-player-category {
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.video-player-duration {
    color: #94a3b8;
    font-weight: 600;
}

.video-player-date {
    color: #64748b;
    font-size: 0.95rem;
}

/* Responsive Video Player */
@media (max-width: 768px) {
    .video-player-container {
        width: 95%;
        margin: 20px;
    }
    
    .video-player-header {
        padding: 15px 20px;
    }
    
    .video-player-title {
        font-size: 1.2rem;
    }
    
    .video-player-info {
        padding: 20px;
    }
    
    .video-player-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .video-overlay-player {
        padding: 10px;
    }
    
    .video-player-container {
        width: 100%;
        margin: 0;
        border-radius: 15px;
    }
    
    .video-placeholder {
        padding: 30px 20px;
    }
    
    .video-placeholder-icon {
        width: 60px;
        height: 60px;
    }
    
    .video-placeholder h3 {
        font-size: 1.3rem;
    }
}
