/* Meteor Media - Educational Video Section */
/* Matching AstroAtlas design language exactly */

body {
    font-family: 'Exo 2', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: all 0.3s ease;
    padding-top: 80px; /* Account for navbar */
}

/* Animated Background */
.meteor-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.meteor-trail {
    position: absolute;
    width: 2px;
    height: 100px;
    background: linear-gradient(to bottom, var(--accent-primary), transparent);
    border-radius: 50%;
    opacity: 0.6;
    animation: meteorFall 8s linear infinite;
}

.meteor-1 {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 12s;
}

.meteor-2 {
    left: 50%;
    animation-delay: 4s;
    animation-duration: 10s;
}

.meteor-3 {
    left: 80%;
    animation-delay: 8s;
    animation-duration: 14s;
}

@keyframes meteorFall {
    0% {
        top: -100px;
        opacity: 0;
        transform: rotate(45deg);
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        top: 100vh;
        opacity: 0;
        transform: rotate(45deg);
    }
}

.star-field {
    position: absolute;
    width: 100%;
    height: 100%;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 50%;
    opacity: 0.8;
    animation: twinkle 3s ease-in-out infinite alternate;
}

.star-1 { top: 20%; left: 15%; animation-delay: 0s; }
.star-2 { top: 40%; left: 70%; animation-delay: 1s; }
.star-3 { top: 60%; left: 25%; animation-delay: 2s; }
.star-4 { top: 80%; left: 85%; animation-delay: 0.5s; }
.star-5 { top: 30%; left: 90%; animation-delay: 1.5s; }
.star-6 { top: 70%; left: 5%; animation-delay: 2.5s; }

@keyframes twinkle {
    0% { opacity: 0.3; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.2); }
}

/* Main Container */
.meteor-media-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header Section - Matching main app style */
.media-header {
    text-align: center;
    margin-bottom: 60px;
    padding: 60px 40px;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.media-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(2px 2px at 20px 30px, var(--accent-primary), transparent),
        radial-gradient(2px 2px at 40px 70px, var(--accent-secondary), transparent),
        radial-gradient(1px 1px at 90px 40px, var(--text-primary), transparent),
        radial-gradient(1px 1px at 130px 80px, var(--accent-tertiary), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: twinkle 4s ease-in-out infinite alternate;
    opacity: 0.3;
}

.header-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 20px var(--accent-primary));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.header-title {
    font-family: 'Orbitron', monospace;
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-shadow: 0 0 30px var(--accent-primary);
    position: relative;
    z-index: 1;
}

.header-subtitle {
    font-size: 1.5rem;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.header-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

/* Video Card */
.video-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.video-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 60px rgba(0, 212, 255, 0.2);
}

.video-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(124, 58, 237, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 20px;
}

.video-card:hover::before {
    opacity: 1;
}

/* Video Thumbnail */
.video-thumbnail {
    position: relative;
    width: 100%;
    height: 220px;
    background: var(--bg-secondary);
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0.1;
}

.thumbnail-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.thumbnail-placeholder {
    font-size: 4rem;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 20px var(--accent-primary));
}

.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.video-card:hover .thumbnail-image {
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(0, 212, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    transition: all 0.3s ease;
    z-index: 2;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.video-card:hover .play-overlay {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(0, 212, 255, 1);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
}

/* Video Info */
.video-info {
    padding: 25px;
    position: relative;
    z-index: 1;
}

.video-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.3;
}

.video-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.video-duration {
    display: inline-block;
    background: rgba(0, 212, 255, 0.2);
    color: var(--accent-primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
    font-family: 'Orbitron', monospace;
}

.learn-more-btn {
    background: var(--accent-gradient);
    border: 2px solid var(--accent-primary);
    border-radius: 25px;
    color: white;
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.learn-more-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

/* Video Modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.video-modal.active {
    display: flex;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-primary);
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.4s ease-out;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-primary);
}

.modal-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
    transform: scale(1.1);
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    background: #000;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
}

.modal-description {
    padding: 25px;
    color: var(--text-primary);
    line-height: 1.6;
    border-top: 1px solid var(--border-primary);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .video-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .media-header {
        padding: 40px 20px;
    }
    
    .header-title {
        font-size: 2.5rem;
    }
    
    .header-subtitle {
        font-size: 1.2rem;
    }
    
    .header-description {
        font-size: 1rem;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .video-thumbnail {
        height: 200px;
    }
    
    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-title {
        font-size: 1.2rem;
    }
    
    .modal-description {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .meteor-media-container {
        padding: 20px 15px;
    }
    
    .video-card {
        border-radius: 15px;
    }
    
    .video-thumbnail {
        height: 180px;
        border-radius: 15px 15px 0 0;
    }
    
    .video-info {
        padding: 20px;
    }
    
    .video-title {
        font-size: 1.1rem;
    }
    
    .play-overlay {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* Light Mode Compatibility */
[data-theme="light"] .meteor-background .meteor-trail,
.light-mode .meteor-background .meteor-trail {
    background: linear-gradient(to bottom, var(--accent-primary), transparent);
    opacity: 0.4;
}

[data-theme="light"] .meteor-background .star,
.light-mode .meteor-background .star {
    background: var(--accent-primary);
    opacity: 0.6;
}

[data-theme="light"] .video-card,
.light-mode .video-card {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .video-card:hover,
.light-mode .video-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 20px 60px rgba(0, 212, 255, 0.15);
}

[data-theme="light"] .video-thumbnail,
.light-mode .video-thumbnail {
    background: var(--bg-primary);
}

[data-theme="light"] .modal-content,
.light-mode .modal-content {
    background: var(--bg-primary);
    border-color: var(--accent-primary);
}

[data-theme="light"] .modal-header,
.light-mode .modal-header {
    border-bottom-color: var(--border-primary);
}

[data-theme="light"] .modal-description,
.light-mode .modal-description {
    border-top-color: var(--border-primary);
}