/* ===================================
   Video Section Styles
   ================================== */

/* Featured Video Section (Home Page) */
.featured-video {
    padding: 120px 0;
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1f35 100%);
    position: relative;
    overflow: hidden;
}

.featured-video-container {
    max-width: 1200px;
    margin: 0 auto;
}

.video-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

.featured-video .video-thumbnail {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.3);
    transition: all 0.4s ease;
    cursor: pointer;
}

.featured-video .video-thumbnail:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 80px rgba(99, 102, 241, 0.4);
}

.featured-video .video-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.featured-video .video-play-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(236, 72, 153, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.featured-video .video-thumbnail:hover .video-play-overlay {
    opacity: 1;
}

.featured-video .play-button-large {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.5);
}

.featured-video .play-button-large:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.6);
}

.featured-video .video-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(10, 14, 26, 0.9);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
}

.featured-video .video-badge svg {
    color: var(--color-primary);
}

.featured-video-info {
    padding: 2rem 0;
}

.featured-video-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.featured-video-info p {
    font-size: 1.125rem;
    color: var(--color-gray);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.video-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Modal for Featured Video */
#featuredVideoModal .video-modal-player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

#featuredVideoModal .video-modal-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Video Gallery Section (videos.html) */
.video-section {
    background: var(--color-bg-light);
}

/* Loading State */
.video-loading {
    text-align: center;
    padding: 4rem 0;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    border: 4px solid rgba(99, 102, 241, 0.1);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.video-loading p {
    color: var(--color-gray);
    font-size: 1.125rem;
}

/* Error State */
.video-error {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.video-error h3 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--color-white);
    margin-bottom: 1rem;
}

.video-error p {
    color: var(--color-gray-light);
    margin-bottom: 2rem;
    line-height: 1.7;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.video-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.3);
}

.video-thumbnail {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    background: var(--color-dark);
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 1;
    transition: all var(--transition-base);
}

.video-card:hover .video-play-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.play-button {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: 50%;
    color: var(--color-white);
    transition: all var(--transition-base);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.video-card:hover .play-button {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.6);
}

.play-button svg {
    margin-left: 4px; /* Optical centering */
}

.video-duration {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 0, 0, 0.85);
    color: var(--color-white);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.video-info {
    padding: 1.5rem;
}

.video-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-description {
    color: var(--color-gray-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--color-gray);
}

.video-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.video-meta svg {
    width: 16px;
    height: 16px;
}

/* Video CTA */
.video-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 2.5rem;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.video-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.channel-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: var(--color-white);
    flex-shrink: 0;
}

.channel-info h3 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--color-white);
    margin-bottom: 0.5rem;
}

.channel-info p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.125rem;
}

.video-cta .btn {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

/* Video Modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.video-modal.active {
    display: flex;
    align-items: flex-start;
}

.video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.video-modal-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    width: 100%;
    margin: auto;
    max-height: calc(100dvh - 4rem);
    background: var(--color-dark);
    border-radius: var(--radius-lg);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    animation: slideUp 0.4s ease;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

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

.video-modal-close {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--color-white);
    cursor: pointer;
    transition: all var(--transition-base);
}

.video-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.video-modal-player {
    position: relative;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
}

.video-modal-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* YouTube Fallback */
.youtube-fallback {
    padding: 1.5rem;
    background: var(--color-dark-light);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.fallback-message {
    color: var(--color-gray-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: var(--radius-sm);
}

.youtube-fallback .btn {
    display: inline-flex;
    margin: 0 auto;
}

.youtube-fallback .btn svg {
    width: 24px;
    height: 24px;
    color: #FF0000;
}

.video-modal-info {
    padding: 2rem;
    background: var(--color-dark-light);
}

.video-modal-info h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 1rem;
}

.video-modal-info p {
    color: var(--color-gray-light);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.video-modal-meta {
    display: flex;
    gap: 2rem;
    font-size: 0.95rem;
    color: var(--color-gray);
}

/* Responsive */
@media (max-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .video-cta {
        flex-direction: column;
        text-align: center;
    }
    
    .channel-info {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .video-modal {
        padding: 1rem;
    }

    .video-modal-content {
        max-height: calc(100dvh - 2rem);
    }
    
    .video-modal-info {
        padding: 1.5rem;
    }
    
    .play-button {
        width: 60px;
        height: 60px;
    }
    
    .channel-icon {
        width: 60px;
        height: 60px;
    }
    
    .channel-info h3 {
        font-size: 1.5rem;
    }
    
    .channel-info p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .video-card {
        border-radius: var(--radius-md);
    }
    
    .video-info {
        padding: 1.25rem;
    }
    
    .video-title {
        font-size: 1rem;
    }
    
    .video-cta {
        padding: 2rem 1.5rem;
    }
}

/* Featured Video Responsive */
@media (min-width: 768px) {
    .video-wrapper {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

@media (max-width: 767px) {
    .featured-video {
        padding: 80px 0;
    }
    
    .featured-video-info h3 {
        font-size: 1.5rem;
    }
    
    .featured-video-info p {
        font-size: 1rem;
    }
    
    .play-button-large {
        width: 72px;
        height: 72px;
    }
    
    .video-actions {
        flex-direction: column;
    }
    
    .video-actions .btn {
        width: 100%;
        justify-content: center;
    }
}