/* Exclusive PWA styles */

/* ========== KID‑FRIENDLY CUSTOM STYLES ========== */
/* -------------------------------------------- */

/*   ROOT VARIABLES – fresh, happy palette */
/* -------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Bubblegum+Sans&display=swap');

:root {
    --kid-primary: #6C5CE7;
    /* soft violet */
    --kid-secondary: #FF7675;
    /* coral */
    --kid-accent: #FDCB6E;
    /* sunshine yellow */
    --kid-success: #00B894;
    /* mint */
    --kid-bg-dark: #2D3436;
    /* dark gray, easier on eyes */
    --kid-bg-card: rgba(255, 255, 255, 0.12);
    --kid-text-light: #FFFFFF;
    --kid-text-soft: rgba(255,255,255,0.9);
    --kid-border-radius: 28px;
    --kid-header-height: 68px;
    --safe-inset-top: env(safe-area-inset-top);
    --safe-inset-bottom: env(safe-area-inset-bottom);
}

* {
    font-family: "Bubblegum Sans", sans-serif;
    font-weight: 400;
    font-style: normal;
    user-select: none;
}

body {
    background: var(--kid-bg-dark);
    color: var(--kid-text-light);
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.splash-logo {
    width: 200px;
    height: 200px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/*horizontal scroll*/
.inline-horizontal-scroll {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
}

.tip-amount {
    display: inline-block;
    margin: 0 10px;
}

.inline-horizontal-scroll::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar for Chrome, Safari and Opera */
}

.inline-horizontal-scroll {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.inline-horizontal-static {
    position: static;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
}

.inline-horizontal-static h6 {
    display: inline;
    margin-right: 2em;
}

.tip-amount button {
    color: #000;
    background-color: transparent;
    border: 1px #000 solid;
    border-radius: 8px;
    padding: 0.85rem;
}

/* ----- MAIN LAYOUT – no wasted space ----- */
.pwa-container {
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    display: flex;
    flex-direction: column;
    background: linear-gradient(145deg, #1e272e 0%, #2d3436 100%);
    padding-top: var(--safe-inset-top);
    padding-bottom: var(--safe-inset-bottom);
}

/* ----- COMPACT, PLAYFUL HEADER ----- */
.pwa-header {
    height: var(--kid-header-height);
    padding: 0 1rem;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 2px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 100;
    /* Higher than Bootstrap's default sticky/fixed elements */
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-logo img {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
}

.app-name {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #FDCB6E);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

/* ----- TAB BAR – big friendly fingers ----- */
.tab-bar {
    display: flex;
    background: rgba(0,0,0,0.2);
    /*backdrop-filter: blur(10px);*/
    padding: 6px 12px;
    border-radius: 40px;
    margin: 8px 12px;
    gap: 4px;
    border: 1px solid rgba(255,255,255,0.1);
}

.nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    border-radius: 32px;
    color: rgba(255,255,255,0.7);
    transition: all 0.25s cubic-bezier(0.2, 0.9, 0.4, 1);
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 0.8rem;
}

.nav-tab i {
    font-size: 1.5rem;
    margin-bottom: 2px;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
}

.nav-tab.active {
    background: linear-gradient(145deg, var(--kid-primary), #a29bfe);
    color: white;
    box-shadow: 0 6px 12px rgba(108, 92, 231, 0.4);
}

.nav-tab:active {
    transform: scale(0.96);
}

.dropdown {
    position: relative;
}

/* Ensure the menu specifically sits at the top */
.dropdown-menu {
    z-index: 1100 !important;
    color: initial !important;
}

/* ----- MAIN CONTENT – starts immediately under tabs ----- */
.pwa-view {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 12px 12px 12px;
    scroll-behavior: smooth;
}

/* Hide all views by default – active one becomes block */
.view-content {
    display: none;
}

.view-content.active-view {
    display: block;
}

/* ----- KID CARDS – rounded, glassy, joyful ----- */
.content-card {
    background: var(--kid-bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--kid-border-radius);
    padding: 1.2rem;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 12px 18px -8px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.content-card:hover {
    transform: translateY(-4px);
    border-color: var(--kid-accent);
}

/* ----- BUTTONS – big, pill, gradient, bounce ----- */
.kid-button {
    background: linear-gradient(145deg, var(--kid-primary), #5f4bc2);
    border: none;
    border-radius: 50px;
    padding: 12px 28px;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    box-shadow: 0 10px 15px -5px rgba(108, 92, 231, 0.5);
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.2);
}

.kid-button:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 20px -5px rgba(108, 92, 231, 0.7);
}

.kid-button:active {
    transform: scale(0.98);
}

/* ----- VIDEO GRID – 2 columns on mobile, more on larger ----- */
/* Ensure the grid container itself doesn't overflow */
/* ----- RESPONSIVE VIDEO GRID - perfect fit for all devices ----- */
/* ----- VIDEO CARD COMPONENT - Pure CSS Grid, No Bootstrap ----- */
.image-container {
    position: relative;
    aspect-ratio: 16/9;
    background: #2a2a3a;
    overflow: hidden;
}
.shimmer-wrapper {
    position: relative;
}
.shimmer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 1.5s infinite;
    pointer-events: none;
    z-index: 2;
}
.video-thumb {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 3;
}
/* When image loads, we'll hide the overlay via JS */
.image-container.loaded .shimmer-overlay {
    display: none;
}

.video-card {
    background: rgba(255,255,255,0.08);
    border-radius: 24px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-width: 0;
    position: relative;
}

.video-card:hover {
    border-color: var(--kid-accent);
    background: rgba(255,255,255,0.15);
    transform: translateY(-4px);
}

/* Thumbnail container */
.video-card .position-relative {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
}

/* Thumbnail image */
.video-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

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

/* Play overlay button */
.video-card .play-overlay {
    background: transparent;
    border: none;
    padding: 0;
    z-index: 2;
    transition: transform 0.2s ease;
}

.video-card .play-overlay i {
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.video-card .play-overlay:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Favorite badge */
/*.video-card .favorite-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: rgba(255, 118, 117, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
    padding: 0;
}

.video-card .favorite-badge i {
    font-size: 1.2rem;
    color: #fff;
}

.video-card .favorite-badge:hover {
    transform: scale(1.15) rotate(8deg);
    background: #ff6b6b;
}*/

/* Views badge */
.video-card .views-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    color: white;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255,255,255,0.2);
    z-index: 5;
}

.video-card .views-badge i {
    color: var(--kid-accent);
}

/* Video card content */
.video-card-content {
    padding: 16px 12px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Video title */
.video-card .video-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1.4;
}

.video-card .video-title:hover {
    color: var(--kid-accent);
}

/* Video channel */
.video-card .video-channel {
    font-size: 0.8rem;
    color: var(--kid-primary);
    margin-bottom: 12px;
    font-weight: 600;
}

/* Watch button */
.video-card .watch-btn {
    background: linear-gradient(145deg, var(--kid-primary), #5f4bc2);
    border: none;
    border-radius: 50px;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    box-shadow: 0 6px 12px rgba(108, 92, 231, 0.3);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.2);
    width: 100%;
    margin-top: auto;
}

.video-card .watch-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 16px rgba(108, 92, 231, 0.5);
}

.video-card .watch-btn:active {
    transform: scale(0.98);
}

/* Animation */
@keyframes pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.animate-pop {
    animation: pop 0.3s ease;
}

/* Responsive Video Grid - Pure CSS Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Mobile: 2 columns */
    gap: 16px;
    margin-top: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Small tablets: 3 columns */
@media (min-width: 640px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
}

/* Tablets and small desktops: 4 columns */
@media (min-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktop: 5 columns */
@media (min-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Large desktop: 6 columns */
@media (min-width: 1400px) {
    .video-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Fallback for very small devices */
@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .video-card-content {
        padding: 12px 8px;
    }

    .video-card .video-title {
        font-size: 0.85rem;
    }

    .video-card .watch-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .video-card .favorite-badge {
        width: 36px;
        height: 36px;
    }

    .video-card .favorite-badge i {
        font-size: 1rem;
    }
}
/* Favorite badge - position fix */
.favorite-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    border: 1px solid #333;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: 0.2s;
    z-index: 5;
}

.favorite-badge:hover {
    transform: scale(1.2) rotate(8deg);
    background: rgba(220, 20, 60, 0.4);
}

/* Play button inside card – consistent with main video UI */
.video-card .btn-primary {
    background: var(--kid-primary);
    border: none;
    border-radius: 40px;
    font-weight: 600;
}

.video-card:hover {
    border-color: var(--kid-accent);
    background: rgba(255,255,255,0.15);
}

/* FAVORITES ELENMENTS */

.animate-pop {
    animation: pop 0.3s ease;
}
@keyframes pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* ----- BIBLE DEVOTIONAL – special highlight ----- */
.devotional-card {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.6), rgba(163, 99, 217, 0.6));
    border-radius: 32px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 15px 25px rgba(108, 52, 231, 0.4);
    border: 2px solid rgba(255,255,255,0.3);
}

/* ----- PARENTAL GATE – child safe design ----- */
.modal-content {
    background: #2d3436;
    border-radius: 36px;
    border: 2px solid rgba(255,255,255,0.1);
}

/* ----- TIMER / STICKY BAR – less tall ----- */
.sticky-timer {
    background: rgba(108, 92, 231, 0.3);
    backdrop-filter: blur(16px);
    border-radius: 40px;
    padding: 10px 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,0.2);
}

/* ----- NO MORE HUGE TOP SPACING! ----- */
.view-content .container {
    padding-top: 0 !important;
    padding-bottom: 12px;
}

h2, h3 {
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* custom scroll */
.pwa-view::-webkit-scrollbar {
    width: 5px;
}

.pwa-view::-webkit-scrollbar-thumb {
    background: var(--kid-primary);
    border-radius: 20px;
}

/* Responsive fine-tuning */
@media (max-width: 480px) {
    .tab-bar {
        padding: 4px 8px;
    }
    .nav-tab i {
        font-size: 1.3rem;
    }
    .app-name {
        font-size: 1.1rem;
    }
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* splash screen kept but hidden via JS later */
.splash-screen {
    background: linear-gradient(145deg, #2d3436, #1e272e);
}

/* ---------- PDF READER RESPONSIVE CONTROLS ---------- */
.pdf-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.pdf-controls .btn,
.pdf-controls .dropdown {
    flex: 0 0 auto;
}
.pdf-controls .btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}
/* Page indicator text */
.pdf-controls span {
    white-space: nowrap;
    font-size: 0.9rem;
}
/* Dropdown menu stays within bounds */
.pdf-controls .dropdown-menu {
    min-width: 160px;
}
/* Make the viewer container a bit taller on larger screens */
@media (min-width: 768px) {
    .pdf-viewer-container {
        max-height: 70vh !important;
    }
}
/* Canvas always respects its container */
#pdfCanvas {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

/* New floating PDF side buttons */
.pdf-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;
    transition: background 0.2s;
    opacity: 0.7;
}
.pdf-nav-btn:hover {
    background: rgba(0,0,0,0.8);
    opacity: 1;
}
.pdf-nav-btn.left {
    left: 10px;
}
.pdf-nav-btn.right {
    right: 10px;
}
.pdf-nav-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

/* Floating PDF side buttons */
.pdf-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;
    transition: background 0.2s;
    opacity: 0.4;
}
.pdf-nav-btn:hover {
    background: rgba(0,0,0,0.8);
    opacity: 0.7;
}
.pdf-nav-btn.left {
    left: 10px;
}
.pdf-nav-btn.right {
    right: 10px;
}
.pdf-nav-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

/* Fullscreen actions and exit button – hidden by default */
.fullscreen-actions,
.fullscreen-exit-btn {
    display: none;
    position: absolute;
    z-index: 1000;
}
.fullscreen-actions {
    top: 20px;
    left: 20px;
    gap: 10px;
}
.fullscreen-exit-btn {
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 24px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.fullscreen-exit-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* When container has is-fullscreen class (added by JS) */
.pdf-viewer-container.is-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-height: none !important;
    background: #000 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: auto !important;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pdf-viewer-container.is-fullscreen canvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.pdf-viewer-container.is-fullscreen .fullscreen-actions,
.pdf-viewer-container.is-fullscreen .fullscreen-exit-btn {
    display: flex !important;
}
/* Optionally hide top controls in fullscreen */
.pdf-viewer-container.is-fullscreen ~ .content-card .pdf-controls {
    display: none;
}

/* Show floating Nav Buttons in Fullscreen mode */
@media (display-mode: fullscreen) {
    .pdf-nav-btn {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

.paypal-processing {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}
.paypal-processing::after {
    content: 'Processing...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
}