/* Church TV Streaming Platform - Main Stylesheet */

/* ===== SPLASH SCREEN ===== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #7c3aed 0%, #6a0dad 50%, #4c1d95 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
}

.splash-screen::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: url('https://www.transparenttextures.com/patterns/cubes.png');
    opacity: 0.05;
    animation: splash-bg-move 60s linear infinite;
}

.splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.1);
}

.splash-content {
    position: relative;
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: splash-entrance 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.splash-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 24px;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
    animation: splash-logo-float 3s ease-in-out infinite;
}

.splash-text {
    margin-top: 16px;
}

.splash-title {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-transform: uppercase;
    opacity: 0;
    animation: splash-text-in 0.8s ease-out 0.5s forwards;
}

.splash-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 1px;
    opacity: 0;
    animation: splash-text-in 0.8s ease-out 0.7s forwards;
}

.splash-loader {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.loader-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    opacity: 0.3;
    animation: loader-dots 1.4s infinite ease-in-out both;
}

.loader-dot:nth-child(1) { animation-delay: -0.32s; }
.loader-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes splash-bg-move {
    from { transform: translate(-25%, -25%); }
    to { transform: translate(0, 0); }
}

@keyframes splash-entrance {
    0% { transform: translateY(30px) scale(0.9); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes splash-logo-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes splash-text-in {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes loader-dots {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); opacity: 1; }
}

/* ===== RESET AND BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.5;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    overflow-x: hidden;
}

/* ===== CHURCH THEME COLORS ===== */
:root {
    --primary-color: #6a0dad;
    --secondary-color: #8b5cf6;
    --accent-color: #a855f7;
    --light-bg: #f8f9fa;
    --dark-bg: #4c1d95;
    --text-light: #ffffff;
    --text-dark: #333333;
    --border-color: #dee2e6;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --live-color: #ef4444;
    --live-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --card-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --card-shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
}

/* ===== LAYOUT ===== */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 20px 0;
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(44, 62, 80, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner i {
    margin-bottom: 20px;
}

/* ===== HEADER STYLES ===== */
.main-header {
    background-color: var(--primary-color);
    color: var(--text-light);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

/* Desktop: slightly tighter header height (mobile overrides exist elsewhere) */
@media (min-width: 769px) {
    .main-header .header-content {
        padding-top: 0;
        padding-bottom: 0;
    }
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-image {
    height: 90px;
    width: auto;
    max-width: 338px;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.logo:hover .logo-image {
    opacity: 0.8;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: var(--secondary-color);
    color: var(--text-light);
}

.search-bar {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.1);
    border-radius: 25px;
    padding: 5px 15px;
    margin-left: 20px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-light);
    padding: 8px;
    width: 200px;
}

.search-bar input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-bar button {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
}

/* ===== FOOTER STYLES ===== */
.main-footer {
    background-color: var(--dark-bg);
    color: var(--text-light);
    padding: 30px 0 20px;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 0 20px;
}

.footer-logo {
    margin-bottom: 15px;
}

.footer-logo-image {
    height: 113px;
    width: auto;
    max-width: 450px;
    object-fit: contain;
}

.footer-section h4 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-section p,
.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    line-height: 1.6;
}

.footer-section a:hover {
    color: var(--secondary-color);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.footer-links a {
    padding: 5px 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    background: var(--secondary-color);
    color: var(--text-light);
}

.footer-bottom {
    text-align: center;
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 30px;
    color: rgba(255,255,255,0.6);
}

/* ===== VIDEO GRID ===== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
}

.video-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

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

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

.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

/* Favorite button on video cards (home, category, search, video page) */
.video-favorite-btn {
    width: 100%;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 8px 0;
    font-size: 14px;
}
.video-favorite-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}
.video-favorite-btn .fa-heart {
    font-size: 16px;
    margin-right: 6px;
}
.video-favorite-btn .fa-heart.favorited {
    color: #e74c3c;
}

.video-info {
    padding: 15px;
}

.video-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.video-views {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ===== CATEGORY CARDS ===== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.category-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
    text-decoration: none;
    color: inherit;
}

.category-thumbnail {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #6a0dad, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
}

.category-info {
    padding: 15px;
    text-align: center;
}

.category-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.category-description {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* ===== VIDEO PLAYER PAGE ===== */
.video-player-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.video-player-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.video-player-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

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

.video-details {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

.video-title-large {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.video-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.video-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
}

.video-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #1a252f;
    border-color: #1a252f;
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #217dbb;
    border-color: #217dbb;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .main-header {
        /* Disable sticky header on mobile to save vertical space */
        position: relative;
        top: auto;
        min-height: 50px;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        padding: 15px;
    }

    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        padding: 15px;
    }

    .main-header .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .logo-image {
        height: 75px;
        max-width: 270px;
    }

    .nav-links {
        justify-content: center;
        flex-wrap: wrap;
    }

    .search-bar {
        margin-left: 0;
        width: 100%;
    }

    .search-bar input {
        width: 100%;
    }

    .video-player-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-logo-image {
        height: 90px;
        max-width: 338px;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: 1fr;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-content {
        padding: 10px 0;
    }

    .video-player-container {
        padding: 10px;
    }
}

/* ===== SERIES CARDS ===== */
.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.series-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(106, 13, 173, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(106, 13, 173, 0.1);
}

.series-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
}

.series-thumbnail {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.series-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    color: var(--primary-color);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

.series-info {
    padding: 20px;
    text-align: center;
}

.series-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.series-description {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.series-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.hidden { display: none; }
.visible { display: block; }

/* ===== ANIMATION CLASSES ===== */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

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

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ===== PWA ANIMATIONS ===== */
@keyframes slideUpPrompt {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDownPrompt {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

/* ===== 404 NOT FOUND PAGE ===== */
.not-found-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.not-found-section {
    width: 100%;
    padding: 3rem 1rem;
}

.not-found-content {
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
}

.not-found-icon {
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.8;
    margin-bottom: 1rem;
}

.not-found-title {
    font-size: 5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.not-found-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.not-found-message {
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.not-found-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.not-found-actions .btn {
    min-width: 140px;
}

.not-found-actions .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.not-found-actions .btn-primary:hover {
    background-color: var(--dark-bg);
    border-color: var(--dark-bg);
    color: var(--text-light);
}

/* ===== PRINT STYLES ===== */
@media print {
    .hero-section,
    .slider-nav,
    .slider-progress,
    .update-notification,
    #install-prompt {
        display: none !important;
    }
}