/* ============================================================
   KIDS SHORTS — styles.css
   Mobile-first, full-screen video player
   ============================================================ */


/* ── Reset & Base ─────────────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg:         #000000;
    --color-surface:    #111111;
    --color-accent:     #ff3b5c;
    --color-accent2:    #00c6ff;
    --color-text:       #ffffff;
    --color-muted:      rgba(255, 255, 255, 0.50);
    --color-overlay:    rgba(255, 255, 255, 0.12);

    --font-family:      'Nunito', sans-serif;
    --radius-card:      16px;
    --radius-pill:      999px;
    --transition-slide: transform 0.30s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html,
body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: var(--color-bg);
    font-family: var(--font-family);
    color: var(--color-text);
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}


/* ── App Root ─────────────────────────────────────────────── */

#app {
    position: fixed;
    inset: 0;
    max-width: 480px;
    margin: 0 auto;
    overflow: hidden;
    background: var(--color-bg);
}


/* ============================================================
   PLAYLIST SCREEN
   ============================================================ */

.playlist-screen {
    position: absolute;
    inset: 0;
    background: #0a0a0a;
    overflow-y: auto;
    z-index: 100;
}

.playlist-header {
    padding: 56px 20px 20px;
    background: linear-gradient(160deg, #1c0a14 0%, #0a0a1c 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-logo {
    font-size: 26px;
    font-weight: 900;
    background: linear-gradient(135deg, #ff3b5c, #ff9f43);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.app-subtitle {
    font-size: 13px;
    color: var(--color-muted);
    font-weight: 600;
    margin-top: 4px;
}

.playlist-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px;
}


/* All Videos Card */

.playlist-card--all {
    grid-column: span 2;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border-radius: var(--radius-card);
    background: linear-gradient(135deg, rgba(255, 59, 92, 0.15), rgba(255, 159, 67, 0.10));
    border: 1.5px solid rgba(255, 59, 92, 0.25);
    cursor: pointer;
    transition: transform 0.15s;
}

.playlist-card--all:active {
    transform: scale(0.97);
}

.playlist-card__icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ff3b5c, #ff9f43);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.playlist-card--all h3 {
    font-size: 18px;
    font-weight: 900;
}

.playlist-card--all p {
    font-size: 12px;
    color: var(--color-muted);
    font-weight: 600;
    margin-top: 2px;
}


/* Individual Playlist Cards */

.playlist-card {
    border-radius: var(--radius-card);
    overflow: hidden;
    background: var(--color-surface);
    border: 1.5px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: transform 0.15s;
}

.playlist-card:active {
    transform: scale(0.96);
}

.playlist-card__thumb {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

/* Playlist colour themes */
.theme-0 { background: linear-gradient(135deg, #1a0828, #2d0a3d); }
.theme-1 { background: linear-gradient(135deg, #081a2d, #0a2d1a); }
.theme-2 { background: linear-gradient(135deg, #2d1a08, #3d2a0a); }
.theme-3 { background: linear-gradient(135deg, #082d2d, #1a082d); }
.theme-4 { background: linear-gradient(135deg, #1a2d08, #2d081a); }

.playlist-card__meta {
    padding: 12px 14px 14px;
}

.playlist-card__meta h3 {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
}

.playlist-card__meta p {
    font-size: 11px;
    color: var(--color-muted);
    margin-top: 3px;
    font-weight: 600;
}


/* ============================================================
   PLAYER SCREEN
   ============================================================ */

.player-screen {
    position: absolute;
    inset: 0;
    background: var(--color-bg);
}


/* ── Slides ───────────────────────────────────────────────── */

.slides {
    position: absolute;
    inset: 0;
}

.slide {
    position: absolute;
    inset: 0;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* ── Gradient Overlays ────────────────────────────────────── */

.gradient-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 180px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent);
    pointer-events: none;
    z-index: 10;
}

.gradient-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 220px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    pointer-events: none;
    z-index: 10;
}


/* ── Top Bar ──────────────────────────────────────────────── */

.topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    padding: 14px 16px 0;
}

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

.back-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-overlay);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: var(--color-text);
    flex-shrink: 0;
}

.active-playlist-badge {
    font-size: 11px;
    font-weight: 800;
    color: var(--color-muted);
    letter-spacing: 0.3px;
}


/* ── Playlist Pills ───────────────────────────────────────── */

.playlist-pills {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 10px 0 0;
    scrollbar-width: none;
}

.playlist-pills::-webkit-scrollbar {
    display: none;
}

.pill {
    flex-shrink: 0;
    padding: 5px 13px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 800;
    background: var(--color-overlay);
    color: rgba(255, 255, 255, 0.80);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    white-space: nowrap;
    backdrop-filter: blur(6px);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.pill--active {
    background: #ffffff;
    color: #000000;
    border-color: transparent;
}


/* ── Video Info ───────────────────────────────────────────── */

.video-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 70px;
    z-index: 20;
    padding: 0 16px 32px;
}

.video-info__playlist {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--color-accent2);
    margin-bottom: 6px;
}

.video-info__title {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.video-info__counter {
    font-size: 12px;
    color: var(--color-muted);
    font-weight: 600;
    margin-top: 4px;
}


/* ── Side Action Buttons ──────────────────────────────────── */

.side-actions {
    position: absolute;
    right: 12px;
    bottom: 80px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.action-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.action-button__icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--color-overlay);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: transform 0.12s;
}

.action-button:active .action-button__icon {
    transform: scale(0.85);
}

.action-button__label {
    font-size: 10px;
    font-weight: 800;
    color: var(--color-muted);
    letter-spacing: 0.3px;
}


/* ── Progress Bar ─────────────────────────────────────────── */

.progress-bar-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    padding: 0 0 8px;
}

.progress-bar {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.20);
    cursor: pointer;
}

.progress-bar__fill {
    height: 100%;
    background: var(--color-accent);
    transition: width 0.25s linear;
    pointer-events: none;
}


/* ── Position Dots ────────────────────────────────────────── */

.position-dots {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 3px;
    pointer-events: none;
}

.position-dot {
    width: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.25);
    transition: height 0.2s ease, background 0.2s ease;
}

.position-dot--active {
    background: #ffffff;
}


/* ── Buffering Loader ─────────────────────────────────────── */

.loader {
    position: absolute;
    inset: 0;
    z-index: 14;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.60);
}

.spinner {
    width: 46px;
    height: 46px;
    border: 3px solid rgba(255, 255, 255, 0.10);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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


/* ── Paused Indicator ─────────────────────────────────────── */

.paused-indicator {
    position: absolute;
    inset: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.paused-indicator__circle {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}


/* ── Swipe Hint ───────────────────────────────────────────── */

.swipe-hint {
    position: absolute;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    animation: hint-fade 3.5s forwards;
}

.swipe-hint__arrow {
    font-size: 28px;
    animation: hint-bounce 0.9s ease infinite;
}

.swipe-hint__text {
    font-size: 11px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.8px;
}

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

@keyframes hint-fade {
    0%, 65% { opacity: 1; }
    100%    { opacity: 0; }
}


/* ── Mute Toast ───────────────────────────────────────────── */

.mute-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 30;
    background: rgba(0, 0, 0, 0.70);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 800;
    pointer-events: none;
    animation: toast-fade 0.9s forwards;
}

@keyframes toast-fade {
    0%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    70% { opacity: 1; }
    100%{ opacity: 0; transform: translate(-50%, -58%) scale(0.95); }
}
