@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Montserrat:wght@700;800&display=swap');

:root {
    --accent: #ff6b81;
    --accent-strong: #ff4d6d;
    --accent-soft: rgba(255, 107, 129, 0.16);
    --bg-base: #0b0214;
    --bg-elevated: #14061f;
    --surface: rgba(255, 255, 255, 0.06);
    --surface-strong: rgba(255, 255, 255, 0.12);
    --border-soft: rgba(255, 255, 255, 0.1);
    --text-primary: #f9edf4;
    --text-secondary: rgba(229, 231, 235, 0.78);
    --text-tertiary: rgba(229, 231, 235, 0.54);
    --glass: rgba(255, 255, 255, 0.08);
    --glass-heavy: rgba(11, 2, 20, 0.78);
    --shadow-lg: 0 24px 70px rgba(3, 0, 7, 0.45);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(1100px 640px at 50% -160px, rgba(255, 107, 129, 0.2), transparent 62%),
        radial-gradient(700px 500px at 100% 8%, rgba(106, 57, 185, 0.22), transparent 62%),
        linear-gradient(180deg, #14061f 0%, #0b0214 44%, #08010e 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.05), transparent 20%),
        radial-gradient(circle at 85% 10%, rgba(255, 107, 129, 0.08), transparent 18%);
    opacity: 0.8;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0b0214;
}

::-webkit-scrollbar-thumb {
    background: rgba(87, 49, 134, 0.9);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(115, 64, 173, 0.95);
}

/* ===== CATALOG PAGE ===== */

.container {
    position: relative;
    z-index: 1;
    max-width: 1340px;
    margin: 0 auto;
    padding: 18px 18px 44px;
}

.tab-container {
    padding-top: 0;
}

.auth-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.auth-btn {
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--surface);
    color: #fff;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 700;
    transition: all 0.28s ease;
    border: 1px solid var(--border-soft);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.auth-btn:hover {
    background: var(--surface-strong);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.18);
}

.auth-btn.primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    border-color: transparent;
    box-shadow: 0 10px 24px rgba(255, 107, 129, 0.28);
}

.auth-btn.primary:hover {
    box-shadow: 0 16px 28px rgba(255, 107, 129, 0.34);
}

.episode-locked {
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.3);
}

.lock-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    opacity: 0.8;
}

.header {
    position: sticky;
    top: 12px;
    z-index: 980;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 16px;
    margin-bottom: 28px;
    background: rgba(12, 3, 23, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-center {
    min-width: 0;
}

.header-right {
    justify-content: flex-end;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.logo-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.logo-wordmark,
.footer-wordmark {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.06em;
    color: #fff;
    line-height: 1;
}

.logo-wordmark span,
.footer-wordmark span {
    color: var(--accent);
}

.logo-subtitle {
    max-width: 260px;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    line-height: 1.4;
}

.logo-img {
    height: 72px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 12px 24px rgba(255, 107, 129, 0.12));
}

.logo-img-auth {
    height: 10px;
    width: auto;
    object-fit: contain;
    margin-bottom: 20px;
}

.hero-section {
    position: relative;
    margin: 0 0 32px;
    border-radius: 32px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-lg);
}

.upcoming-section {
    position: relative;
    min-height: clamp(480px, 72vh, 720px);
}

.hero-feature {
    position: relative;
    min-height: inherit;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.hero-backdrop {
    position: absolute;
    inset: 0;
}

.hero-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(11, 2, 20, 0.98) 0%, rgba(11, 2, 20, 0.94) 28%, rgba(11, 2, 20, 0.58) 62%, rgba(11, 2, 20, 0.92) 100%),
        linear-gradient(180deg, rgba(11, 2, 20, 0.02) 0%, rgba(11, 2, 20, 0.86) 100%);
}

.hero-backdrop-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.08);
    filter: blur(22px) saturate(1.15);
    opacity: 0.34;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(220px, 340px) minmax(0, 1fr) minmax(160px, 220px);
    gap: clamp(18px, 4vw, 40px);
    width: 100%;
    padding: clamp(24px, 4vw, 48px);
    align-items: center;
}

.hero-poster {
    position: relative;
    justify-self: center;
    width: min(100%, 360px);
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.hero-poster::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 52%, rgba(0, 0, 0, 0.34) 100%);
}

.hero-poster-image {
    width: 100%;
    aspect-ratio: 2 / 3;
    display: block;
    object-fit: cover;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 18px;
    justify-content: center;
}

.hero-chip,
.catalog-kicker,
.hero-side-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero-title,
.catalog-section-title {
    font-family: 'Montserrat', sans-serif;
    letter-spacing: -0.06em;
    color: #fff;
}

.hero-title {
    font-size: clamp(2.9rem, 5vw, 5.7rem);
    line-height: 0.92;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    align-items: center;
}

.hero-meta-separator {
    opacity: 0.44;
}

.hero-description {
    max-width: 60ch;
    color: var(--text-secondary);
    font-size: 1.02rem;
    line-height: 1.75;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding-top: 8px;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.28s ease, box-shadow 0.28s ease, background 0.28s ease, border-color 0.28s ease;
}

.hero-btn:hover {
    transform: translateY(-2px);
}

.hero-btn.primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    box-shadow: 0 14px 30px rgba(255, 107, 129, 0.22);
}

.hero-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.hero-side-rail {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 14px;
}

.upcoming-mini-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upcoming-mini-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    aspect-ratio: 4 / 5;
    min-height: 96px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.upcoming-mini-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(8, 2, 15, 0.8) 100%);
}

.upcoming-mini-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.upcoming-fallback {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    min-height: inherit;
    padding: 48px 24px;
    text-align: center;
}

.upcoming-fallback h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2.2rem, 4vw, 4rem);
    letter-spacing: -0.05em;
}

.catalog-shell {
    position: relative;
    overflow: hidden;
    padding: 30px 28px 14px;
    border-radius: 30px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-lg);
}

.catalog-shell::before {
    content: '';
    position: absolute;
    inset: -30% auto auto -10%;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 107, 129, 0.16) 0%, rgba(255, 107, 129, 0) 70%);
    pointer-events: none;
}

.catalog-section-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.catalog-section-copy {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.catalog-section-title {
    font-size: clamp(1.8rem, 3.6vw, 2.7rem);
    line-height: 0.98;
}

.catalog-section-subtitle {
    max-width: 420px;
    color: var(--text-tertiary);
    line-height: 1.65;
    text-align: right;
}

.catalog {
    position: relative;
    z-index: 1;
}

.series-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding-bottom: 8px;
}

.series-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    cursor: pointer;
    background: transparent;
    border: none;
}

.series-card-media {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: rgba(91, 49, 138, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 28px rgba(0, 0, 0, 0.28);
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.series-card:hover .series-card-media {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 28px 44px rgba(0, 0, 0, 0.36);
}

.series-card-image {
    width: 100%;
    aspect-ratio: 2 / 3;
    display: block;
    object-fit: cover;
    background: #1d112d;
    transition: transform 0.55s ease;
}

.series-card:hover .series-card-image {
    transform: scale(1.06);
}

.series-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(11, 2, 20, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffe082;
    font-size: 0.72rem;
    font-weight: 700;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.series-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    background: linear-gradient(180deg, rgba(4, 1, 8, 0) 34%, rgba(4, 1, 8, 0.94) 100%);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.series-card:hover .series-card-overlay {
    opacity: 1;
}

.series-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.series-card-tag {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.72rem;
    line-height: 1;
}

.series-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(255, 107, 129, 0.22);
}

.series-card-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 6px 2px;
}

.series-card-title {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.28s ease;
}

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

.series-card-description {
    color: var(--text-tertiary);
    font-size: 0.84rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.series-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: var(--text-tertiary);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.series-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.loading,
.empty-state {
    grid-column: 1 / -1;
    padding: 56px 20px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    text-align: center;
    color: var(--text-secondary);
}

.empty-state h2 {
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 1.65rem;
}

.empty-state p {
    max-width: 36ch;
    margin: 0 auto;
    color: var(--text-tertiary);
}

@media (min-width: 768px) {
    .series-grid {
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
        gap: 22px;
    }
}

@media (max-width: 1120px) {
    .hero-content {
        grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    }

    .hero-side-rail {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: stretch;
        overflow-x: auto;
        padding-bottom: 6px;
    }

    .upcoming-mini-grid {
        flex-direction: row;
    }

    .upcoming-mini-card {
        flex: 0 0 150px;
        min-height: 130px;
    }
}

@media (max-width: 767px) {
    .container {
        padding: 12px 14px 36px;
    }

    .header {
        gap: 12px;
        padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 14px;
        margin-bottom: 22px;
        border-radius: 22px;
    }

    .logo-img {
        height: 54px;
    }

    .logo-copy {
        gap: 3px;
    }

    .logo-wordmark {
        font-size: 1.2rem;
    }

    .logo-subtitle {
        display: none;
    }

    .hero-section {
        margin-bottom: 24px;
        border-radius: 26px;
    }

    .upcoming-section {
        min-height: auto;
    }

    .hero-content {
        grid-template-columns: 1fr;
        padding: 22px 18px 20px;
    }

    .hero-poster {
        width: min(100%, 280px);
    }

    .hero-copy {
        gap: 14px;
        text-align: center;
        align-items: center;
    }

    .hero-description {
        font-size: 0.95rem;
        line-height: 1.65;
    }

    .hero-meta {
        justify-content: center;
    }

    .hero-actions {
        width: 100%;
        justify-content: center;
    }

    .hero-btn {
        flex: 1 1 100%;
    }

    .hero-side-rail {
        gap: 10px;
    }

    .hero-side-label {
        align-self: flex-start;
    }

    .catalog-shell {
        padding: 22px 18px 10px;
        border-radius: 26px;
    }

    .catalog-section-header {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 22px;
    }

    .catalog-section-subtitle {
        max-width: none;
        text-align: left;
    }

    .series-grid {
        gap: 14px;
    }

    .series-card-title {
        font-size: 0.92rem;
    }

    .series-card-description {
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
}

/* ===== PLAYER PAGE ===== */

.player-body {
    overflow: hidden;
    background: #000;
    color: #fff;
    width: 100%;
    height: 100%;
    overscroll-behavior: none;
    /* Prevent pull-to-refresh and bounce on mobile */
    position: fixed;
    top: 0;
    left: 0;
}


.player-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    outline: none;
    overscroll-behavior-y: contain;
    /* Prevent overscroll bounce that causes snap-back to top */
}

.player-container::-webkit-scrollbar {
    display: none;
}

/* Start Screen */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s;
    background: #000;
}

.start-screen-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.4);
    transform: scale(1.1);
}

.start-screen-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 20px;
    max-width: 500px;
    animation: fadeIn 0.8s ease-out;
}

.start-screen h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.start-screen p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Locked Overlay Premium Styles */
.locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.locked-content-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 40px 30px;
    max-width: 320px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.locked-icon-wrapper {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, rgba(255, 45, 85, 0.2), rgba(255, 45, 85, 0.05));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 45, 85, 0.2);
    box-shadow: 0 0 20px rgba(255, 45, 85, 0.2);
}

.locked-icon {
    font-size: 32px;
    margin: 0;
    /* Override previous */
    animation: lockShake 3s infinite;
}

@keyframes lockShake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    5% {
        transform: rotate(-10deg);
    }

    10% {
        transform: rotate(10deg);
    }

    15% {
        transform: rotate(-10deg);
    }

    20% {
        transform: rotate(0deg);
    }
}

.locked-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, #ccc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.locked-desc {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
    line-height: 1.5;
}

.unlock-btn {
    background: linear-gradient(135deg, #ff2d55 0%, #ff5e7e 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 16px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(255, 45, 85, 0.4);
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.unlock-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(255, 45, 85, 0.5);
    filter: brightness(1.1);
}

.unlock-btn:active {
    transform: translateY(-1px);
}

.video-item {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
    scroll-snap-stop: always;
}

.video-item video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.video-item audio {
    display: none;
}

/* Video Loading Spinner */
.video-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-loader.visible {
    opacity: 1;
}

.video-loader-spinner {
    width: 56px;
    height: 56px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: loaderPulse 2s ease-in-out infinite;
}

.video-loader-spinner svg {
    width: 100%;
    height: 100%;
    animation: loaderRotate 1s linear infinite;
}

.video-loader-spinner svg circle {
    stroke: rgba(255, 255, 255, 0.9);
    stroke-linecap: round;
    stroke-dasharray: 80, 200;
    stroke-dashoffset: 0;
    animation: loaderDash 1.5s ease-in-out infinite;
}

@keyframes loaderRotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes loaderDash {
    0% {
        stroke-dasharray: 1, 200;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 80, 200;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 80, 200;
        stroke-dashoffset: -125;
    }
}

.video-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.video-loader-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.3px;
}

@keyframes loaderPulse {

    0%,
    100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }

    50% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 6px rgba(255, 255, 255, 0.06);
    }
}

/* Video Retry Overlay */
.video-retry-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.video-retry-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.retry-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    width: min(92vw, 560px);
    padding: 24px;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.retry-content svg {
    opacity: 0.8;
}

.retry-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    margin: 0;
}

.video-debug-panel {
    display: none;
    width: 100%;
    max-height: min(30vh, 280px);
    overflow: auto;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 238, 241, 0.96);
    text-align: left;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.72rem;
    line-height: 1.45;
}

.video-debug-panel:not([hidden]) {
    display: block;
}

.retry-content button {
    background: linear-gradient(135deg, #ff2d55, #ff5e7e);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(255, 45, 85, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.retry-content button:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 28px rgba(255, 45, 85, 0.5);
}

.retry-content button:active {
    transform: scale(0.97);
}

/* Per-video overlay container */
.video-overlay-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    /* Ensure no background blocks scrolling */
}

/* Center Play/Pause/Locked Icon */
.video-overlay-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    /* Changed from auto to none to allow scrolling/clicks to video */
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.center-icon {
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Show icon when paused or state active */
.video-overlay-center.visible .center-icon {
    opacity: 1;
    transform: scale(1);
}

.center-icon svg {
    width: 40px;
    height: 40px;
    fill: white;
}

.audio-unlock-btn {
    position: absolute;
    left: 20px;
    bottom: 120px;
    z-index: 24;
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(8, 8, 12, 0.72);
    color: #fff;
    border-radius: 999px;
    padding: 12px 16px;
    font-size: 0.92rem;
    font-weight: 700;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.audio-unlock-btn[hidden] {
    display: none;
}

/* Info Overlay (TikTok Bottom Left Style) */
.video-overlay-info {
    position: absolute;
    bottom: 50px;
    /* Moved up to avoid progress bar */
    left: 0;
    width: 85%;
    padding: 0 20px 10px 20px;
    background: transparent;
    color: white;
    text-align: left;
    pointer-events: none;
    z-index: 25;
}

.info-content .video-title {
    font-size: 1.1rem;
    /* Slightly larger */
    font-weight: 700;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    color: #fff;
}

.info-content .video-desc {
    font-size: 0.9rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    max-width: 90%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.music-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.music-marquee {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.9;
}


/* Bottom Progress Bar (Minimalist) */
.bottom-progress-container {
    position: absolute;
    bottom: calc(15px + env(safe-area-inset-bottom, 0px));
    /* Added safe area and moved up */
    left: 0;
    width: 100%;
    height: 20px;
    /* Slightly larger hit area */
    z-index: 100;
    pointer-events: auto;
    display: flex;
    align-items: center;
}

.video-progress-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0;
    outline: none;
    transition: all 0.15s ease;
    cursor: pointer;
}

.video-progress-slider:hover {
    height: 6px;
}

.video-progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 2px;
    height: 12px;
    background: #fff;
    border-radius: 1px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.video-progress-slider:hover::-webkit-slider-thumb {
    width: 4px;
}

.video-progress-slider:active::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transform: scale(1.2);
}

/* Locked Overlay Styles */
.locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

.locked-icon {
    margin-bottom: 20px;
    font-size: 3rem;
    color: var(--accent);
}

.locked-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.locked-create {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
    max-width: 300px;
}

.unlock-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(255, 45, 85, 0.3);
    transition: transform 0.2s;
    text-decoration: none;
    display: inline-block;
}

.unlock-btn:hover {
    transform: scale(1.05);
}



/* Auto-hide Controls */
.video-overlay-info,
.bottom-progress-container,
.video-overlay-center {
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
    opacity: 1;
    visibility: visible;
}

.video-overlay-info.ui-hidden,
.bottom-progress-container.ui-hidden,
.video-overlay-center.ui-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Custom exception for progress bar: keep a tiny sliver visible? 
   Actually, TikTok hides it, so we'll follow that. */


.video-item {
    background: #000;
}


.back-button {
    position: fixed;
    top: calc(max(20px, env(safe-area-inset-top, 20px)));
    left: 20px;
    z-index: 500;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.back-button:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.back-button:active {
    transform: scale(0.95);
}



.nav-hints {
    position: fixed;
    right: 15px;
    bottom: 40px;
    z-index: 160;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hint {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .info-overlay {
        padding-bottom: 20px;
    }

    .start-screen h1 {
        font-size: 2rem;
    }
}

/* Smooth animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== DETAILS PAGE ===== */

.details-back-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 30px;
    transition: background 0.2s;
}

.details-back-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.details-header {
    display: flex;
    gap: 40px;
    margin-bottom: 60px;
    align-items: flex-start;
}

.details-cover {
    width: 300px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    background: #2a2a2a;
}

.details-info {
    flex: 1;
    padding-top: 10px;
}

.details-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.1;
}

/* Description Truncation */
.details-description-container {
    max-width: 800px;
    margin-bottom: 20px;
}

.details-description {
    font-size: 1.1rem;
    color: #b0b0b0;
    line-height: 1.6;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    transition: max-height 0.3s ease;
}

.details-description.expanded {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    display: block;
}

.toggle-desc-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    padding: 0;
    display: none;
    /* Hidden by default, shown via JS if needed */
}

.toggle-desc-btn:hover {
    text-decoration: underline;
}

.episodes-section h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.dub-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: min(560px, 100%);
    margin: 0 0 26px;
    padding: 12px 14px;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
}

.dub-selector-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.86);
    letter-spacing: 0.2px;
}

.dub-selector-options {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dub-btn {
    min-width: 70px;
    height: 38px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dub-btn:hover {
    border-color: rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.1);
}

.dub-btn.active {
    background: linear-gradient(135deg, rgba(255, 45, 85, 0.95), rgba(255, 45, 85, 0.72));
    border-color: rgba(255, 45, 85, 0.9);
    color: #fff;
    box-shadow: 0 8px 20px rgba(255, 45, 85, 0.28);
}

/* Episodes Grid - Squares */
.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 12px;
}

.episode-square {
    aspect-ratio: 1/1;
    background: rgba(255, 255, 255, 0.08);
    /* slight glass effect */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
}

.episode-square:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 45, 85, 0.3);
}

.episode-square:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .details-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .details-cover {
        width: 200px;
        margin: 0 auto;
    }

    .details-title {
        font-size: 2rem;
    }

    .details-info {
        width: 100%;
    }

    .dub-selector {
        width: 100%;
        margin: 0 0 18px;
        padding: 10px 10px 10px 12px;
    }

    .dub-selector-label {
        font-size: 0.82rem;
    }

    .dub-btn {
        min-width: 58px;
        height: 34px;
        padding: 0 12px;
        font-size: 0.82rem;
        border-radius: 10px;
    }

    .episodes-grid {
        gap: 10px;
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }

    .episode-square {
        font-size: 1rem;
        border-radius: 10px;
    }
}

/* ===== PLAYER CONTROLS ===== */

.controls-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 250;
}

.controls-layer>* {
    pointer-events: auto;
}



/* Progress Bar */
/* Progress Bar */
.progress-container {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-top: 12px;
    pointer-events: auto;
    cursor: pointer;
    transition: height 0.2s;
    touch-action: none;
    /* Prevent scroll while seeking */
}

/* Hit area pseudo-element */
.progress-container::before {
    content: '';
    position: absolute;
    top: -10px;
    bottom: -10px;
    left: 0;
    width: 100%;
    z-index: 10;
}

.progress-container:hover {
    height: 8px;
}

.progress-background {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
}

.progress-buffer {
    position: absolute;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    width: 0;
    transition: width 0.2s;
}

.progress-current {
    position: absolute;
    height: 100%;
    background: var(--accent);
    width: 0;
}

.progress-handle {
    position: absolute;
    right: -6px;
    /* Center handle on end of progress */
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    opacity: 0;
    /* Hidden by default, shown on hover/drag */
    transition: opacity 0.2s;
}


.progress-container:hover .progress-handle {
    opacity: 1;
}

.progress-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s;
    left: 0;
}

.progress-container:hover .progress-handle {
    opacity: 1;
}

/* Nav Buttons */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    transition: all 0.2s;
    z-index: 260;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.nav-prev {
    right: 80px;
    bottom: 120px;
    top: auto;
}

.nav-next {
    right: 20px;
    bottom: 120px;
    top: auto;
}

.nav-btn svg {
    width: 24px;
    height: 24px;
}

@media (min-width: 768px) {
    .nav-prev {
        left: 20px;
        right: auto;
        top: 50%;
        bottom: auto;
    }

    .nav-next {
        right: 20px;
        top: 50%;
        bottom: auto;
    }
}

/* ===== PROFILE PAGE ===== */

.profile-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 0 20px;
}

.profile-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.profile-username {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.plan-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 30px;
}

.plan-free {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

.plan-premium {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    color: #4a3a00;
    box-shadow: 0 5px 15px rgba(253, 160, 133, 0.4);
}

.user-id-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.user-id-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-id-value {
    font-family: monospace;
    font-size: 0.9rem;
    color: #00e676;
    word-break: break-all;
}

.premium-info-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border-radius: 20px;
    padding: 25px;
    margin-top: 20px;
    border: 1px solid rgba(253, 160, 133, 0.2);
    text-align: left;
}

.premium-info-card h3 {
    color: #fda085;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.premium-price {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.premium-price span {
    font-size: 1rem;
    font-weight: 400;
    color: #666;
}

.premium-benefits {
    list-style: none;
    margin-bottom: 25px;
}

.premium-benefits li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #ccc;
    margin-bottom: 10px;
}

.premium-benefits li svg {
    color: #00e676;
    flex-shrink: 0;
}

.buy-btn {
    display: block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 15px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s;
    text-align: center;
}

.buy-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(118, 75, 162, 0.4);
}

@media (max-width: 480px) {
    .profile-card {
        padding: 30px 20px;
    }
}

/* Language Switcher */
.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 2px 4px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.lang-btn:hover {
    color: #fff;
    transform: translateY(-1px);
}

.lang-btn.active {
    color: var(--accent);
}

.lang-divider {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.74rem;
}

/* ===== TAB BAR ===== */

.tab-bar {
    width: 100%;
}

.tab-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px 0 2px;
}

.tab-bar-inner::-webkit-scrollbar {
    display: none;
}

.tab-bar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 0 12px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    position: relative;
    font-weight: 700;
    white-space: nowrap;
    transition: color 0.28s ease, transform 0.28s ease;
}

.tab-bar-btn::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent) 0%, #ff9aa9 100%);
    box-shadow: 0 0 0 rgba(255, 107, 129, 0);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.tab-bar-btn svg {
    width: 16px;
    height: 16px;
    opacity: 0.78;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.tab-bar-btn span {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.tab-bar-btn.active {
    color: #fff;
}

.tab-bar-btn.active::after {
    transform: scaleX(1);
    box-shadow: 0 0 18px rgba(255, 107, 129, 0.52);
}

.tab-bar-btn.active svg,
.tab-bar-btn:hover svg {
    opacity: 1;
    transform: translateY(-1px);
}

.tab-bar-btn:hover {
    color: #fff;
}

.tab-bar-btn:active {
    transform: scale(0.97);
}

@media (max-width: 767px) {
    .tab-container .header {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "left right"
            "center center";
        align-items: center;
        row-gap: 12px;
        column-gap: 10px;
    }

    .tab-container .header-left {
        grid-area: left;
        min-width: 0;
    }

    .tab-container .header-center {
        grid-area: center;
        min-width: 0;
        width: 100%;
    }

    .tab-container .header-right {
        grid-area: right;
        justify-self: end;
        min-width: 0;
    }

    .logo {
        max-width: 65vw;
    }

    .tab-container .tab-bar-inner {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        overflow: visible;
        padding: 0;
    }

    .tab-container .tab-bar-btn {
        width: 100%;
        min-width: 0;
        min-height: 48px;
        padding: 12px 10px 14px;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .tab-container .tab-bar-btn::after {
        left: 14px;
        right: 14px;
        width: auto;
        bottom: 8px;
    }

    .tab-container .tab-bar-btn.active {
        background: rgba(255, 107, 129, 0.12);
        border-color: rgba(255, 107, 129, 0.24);
    }

    .tab-bar-btn svg {
        display: none;
    }

    .tab-container .tab-bar-btn span {
        display: block;
        font-size: 0.72rem;
        line-height: 1.25;
        letter-spacing: 0.12em;
        white-space: normal;
        text-align: center;
    }

    .lang-switcher {
        padding: 6px 10px;
        gap: 6px;
        flex-shrink: 0;
    }

    .lang-btn {
        font-size: 0.72rem;
    }
}

/* Tab Content */
.tab-content {
    display: none;
    animation: tabFadeIn 0.4s ease-out;
}

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

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== INLINE PROFILE TAB ===== */

.profile-tab-wrapper {
    max-width: 440px;
    margin: 30px auto;
    padding: 0 16px;
}

/* Inline Login Card */
.inline-auth-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    padding: 36px 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    animation: cardAppearInline 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes cardAppearInline {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.inline-auth-card .auth-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, rgba(255, 45, 85, 0.15), rgba(255, 45, 85, 0.05));
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 1px solid rgba(255, 45, 85, 0.15);
}

.inline-auth-card .auth-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
    color: #fff;
}

.inline-auth-card .auth-card-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    margin-bottom: 28px;
}

.inline-auth-card .inline-form-group {
    margin-bottom: 18px;
}

.inline-auth-card .inline-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 4px;
}

.inline-auth-card .inline-input {
    width: 100%;
    padding: 14px 18px;
    padding-right: 48px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.3s;
    outline: none;
    font-family: inherit;
}

.inline-auth-card .inline-input:focus {
    border-color: var(--accent, #ff2d55);
    box-shadow: 0 0 12px rgba(255, 45, 85, 0.25);
    background: rgba(255, 45, 85, 0.04);
}

.inline-auth-card .inline-submit-btn {
    width: 100%;
    padding: 15px;
    background: var(--accent, #ff2d55);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
    box-shadow: 0 8px 20px rgba(255, 45, 85, 0.3);
    font-family: inherit;
}

.inline-auth-card .inline-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(255, 45, 85, 0.45);
    filter: brightness(1.1);
}

.inline-auth-card .inline-submit-btn:active {
    transform: translateY(0);
}

.inline-auth-card .inline-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.inline-auth-card .inline-error-box {
    background: rgba(255, 45, 85, 0.1);
    border-left: 3px solid var(--accent, #ff2d55);
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: #ff5277;
    display: none;
    animation: shake 0.5s ease-in-out;
}

.inline-auth-card .auth-card-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.45);
}

.inline-auth-card .auth-card-footer a {
    color: var(--accent, #ff2d55);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

.inline-auth-card .auth-card-footer a:hover {
    text-decoration: underline;
}

/* Profile card within tab - reuse existing styles but add logout */
.profile-tab-wrapper .profile-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 36px 28px;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    animation: cardAppearInline 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.legal-docs-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    margin-bottom: 30px;
}

.legal-title {
    font-size: 1rem;
    font-weight: 700;
    color: #666;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.legal-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legal-link {
    color: #999;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.legal-link:hover {
    color: #fff;
    transform: translateX(5px);
}

.legal-link::before {
    content: "•";
    color: #ff2d55;
}

.logout-btn {
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 24px;
    font-family: inherit;
}

.logout-btn:hover {
    background: rgba(255, 45, 85, 0.1);
    border-color: rgba(255, 45, 85, 0.3);
    color: #ff5277;
}

.logout-btn:active {
    transform: scale(0.97);
}

/* Player Container - Scroll Snap */
.player-container {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    background: #000;
    position: relative;
    /* Hide scrollbar for clean look */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.player-container::-webkit-scrollbar {
    display: none;
}

/* Time Display & Progress Bar Improvements */
.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    /* Removed gap */
    width: 100%;
}

.progress-container {
    position: relative;
    flex: 1;
    height: 30px;
    /* Increased hit area */
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
    /* Prevent scroll while seeking */
}

.progress-background {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    /* Thinner line */
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    transition: height 0.2s;
}

.progress-buffer {
    position: absolute;
    left: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    width: 0%;
    pointer-events: none;
    transition: height 0.2s;
}

.progress-current {
    position: absolute;
    left: 0;
    height: 4px;
    /* Thinner line */
    background: var(--accent);
    /* Uses theme accent */
    border-radius: 2px;
    width: 0%;
    /* JS updates this */
    pointer-events: none;
    transition: height 0.2s;
}

.progress-handle {
    position: absolute;
    top: 50%;
    right: -6px;
    /* Center handle on end of bar */
    transform: translateY(-50%) scale(0);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
    pointer-events: none;
    /* Container handles clicks */
}

/* Hover effects */
.progress-container:hover .progress-background,
.progress-container:hover .progress-buffer,
.progress-container:hover .progress-current {
    height: 6px;
}

.progress-container:hover .progress-handle {
    transform: translateY(-50%) scale(1);
}

/* ===== NEW TIMELINE SLIDER ===== */
.video-progress-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    z-index: 200;
}

.video-progress-slider:hover {
    height: 6px;
}

/* Track (progress handled by JS gradient) */
.video-progress-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 100%;
    border-radius: 2px;
    border: none;
}

/* Thumb */
.video-progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    margin-top: 0;
    opacity: 0;
    /* Hidden by default */
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.video-progress-slider:hover::-webkit-slider-thumb {
    opacity: 1;
    transform: scale(1.2);
}

.video-progress-slider:active::-webkit-slider-thumb {
    transform: scale(1.3);
}

/* Hover effect */
.progress-wrapper:hover .video-progress-slider {
    height: 8px;
    background: rgba(255, 255, 255, 0.15);
}

.progress-wrapper:hover .video-progress-slider::-webkit-slider-thumb {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

/* Layout adjustments */
.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
    pointer-events: auto;
    /* Enable interaction */
}

/* ===== ACTION BUTTONS (TikTok Right Side) ===== */
.video-action-buttons {
    position: absolute;
    right: 12px;
    bottom: calc(15% + env(safe-area-inset-bottom, 0px));
    /* Adjusted for safe area */
    display: flex;
    flex-direction: column;
    gap: 24px;
    /* Increased gap */
    z-index: 30;
    pointer-events: auto;
}

.action-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: white;
    padding: 0;
}

.action-btn svg {
    fill: none;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.action-btn:active {
    transform: scale(0.9);
}

/* Favorite active state */
.favorite-btn.active svg {
    fill: #ff2d55;
    stroke: #ff2d55;
}

.favorite-btn.active {
    background: rgba(255, 45, 85, 0.2);
}

/* Bookmark active state */
.bookmark-btn.active svg {
    fill: #ffd700;
    stroke: #ffd700;
}

.bookmark-btn.active {
    background: rgba(255, 215, 0, 0.2);
}

/* Pulse animation for button feedback */
@keyframes actionPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

.action-btn.pulse {
    animation: actionPulse 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ===== FAVORITES TAB ===== */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 10px 0;
}

@media (min-width: 768px) {
    .favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 25px;
    }
}

/* Empty State Card  */
.empty-state-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    min-height: 300px;
}

.empty-state-card .empty-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    opacity: 0.7;
}

.empty-state-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.empty-state-card p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
    max-width: 280px;
    line-height: 1.5;
}

/* ===== BOOKMARKS IN PROFILE ===== */
.bookmarks-section {
    margin-top: 20px;
    width: 100%;
}

.bookmarks-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #eee;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bookmarks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bookmark-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s;
}

.bookmark-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateX(4px);
}

.bookmark-cover {
    width: 48px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #222;
}

.bookmark-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bookmark-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #333, #222);
}

.bookmark-info {
    flex: 1;
    min-width: 0;
}

.bookmark-series-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bookmark-episode {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 3px;
}

.bookmark-action {
    flex-shrink: 0;
}

.bookmark-continue-btn {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent, #ff2d55);
    white-space: nowrap;
}

.bookmarks-empty {
    text-align: center;
    padding: 20px 10px;
}

.bookmarks-empty p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.bookmarks-empty .bookmarks-empty-sub {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
}

/* ===== LOCKED EPISODE PAYWALL POPUP ===== */
.paywall-popup-overlay {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(1200px 450px at 50% -100px, rgba(255, 45, 85, 0.2), transparent 65%),
        rgba(4, 5, 8, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 18px;
    animation: authFadeIn 0.3s ease-out forwards;
}

.paywall-popup-overlay.closing {
    animation: authFadeOut 0.3s ease-in forwards;
}

.paywall-popup-card {
    width: 100%;
    max-width: 420px;
    border-radius: 26px;
    padding: 28px 22px 22px;
    text-align: center;
    background:
        radial-gradient(100% 100% at 50% 0%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
        linear-gradient(160deg, rgba(22, 23, 30, 0.98), rgba(15, 16, 22, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 35px 60px rgba(0, 0, 0, 0.45);
    animation: authScaleIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.paywall-popup-badge {
    display: inline-block;
    margin-bottom: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffd9e2;
    background: linear-gradient(135deg, rgba(255, 45, 85, 0.45), rgba(255, 127, 153, 0.22));
    border: 1px solid rgba(255, 114, 144, 0.45);
}

.paywall-popup-icon {
    width: 66px;
    height: 66px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.9rem;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.45), rgba(255, 45, 85, 0.2));
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 30px rgba(255, 45, 85, 0.28);
}

.paywall-popup-title {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 10px;
}

.paywall-popup-subtitle {
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.74);
    margin-bottom: 18px;
}

.paywall-popup-benefits {
    display: grid;
    gap: 9px;
    margin-bottom: 22px;
    text-align: left;
}

.paywall-benefit-item {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
}

.paywall-popup-actions {
    display: grid;
    gap: 10px;
}

.paywall-popup-btn {
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s ease;
}

.paywall-popup-btn.primary {
    color: #fff;
    background: linear-gradient(135deg, #ff2d55 0%, #ff5b7d 100%);
    box-shadow: 0 12px 26px rgba(255, 45, 85, 0.35);
}

.paywall-popup-btn.primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
}

.paywall-popup-btn.secondary {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.paywall-popup-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.13);
}

.paywall-popup-btn.ghost {
    color: rgba(255, 255, 255, 0.58);
    background: transparent;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.paywall-popup-btn.ghost:hover {
    color: rgba(255, 255, 255, 0.88);
}

.paywall-popup-btn:active {
    transform: scale(0.97);
}

/* ===== AUTH REQUIRED POPUP ===== */
.auth-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: authFadeIn 0.3s ease-out forwards;
}

.auth-popup-overlay.closing {
    animation: authFadeOut 0.3s ease-in forwards;
}

.auth-popup-card {
    background: rgba(30, 30, 40, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 40px 30px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    animation: authScaleIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes authFadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes authScaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.auth-popup-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.auth-popup-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.auth-popup-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    margin-bottom: 30px;
}

.auth-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-popup-btn {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.auth-popup-btn.primary {
    background: var(--accent, #ff2d55);
    color: white;
}

.auth-popup-btn.primary:hover {
    background: #ff4d72;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 45, 85, 0.3);
}

.auth-popup-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-popup-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.auth-popup-btn.cancel {
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    padding: 10px;
}

.auth-popup-btn.cancel:hover {
    color: rgba(255, 255, 255, 0.7);
}

.auth-popup-btn:active {
    transform: scale(0.96);
}

/* Hide browser default password reveal button */
input::-ms-reveal,
input::-ms-clear {
    display: none !important;
}

input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
    visibility: hidden;
    display: none !important;
    pointer-events: none;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    width: 100%;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Explicitly hide the off-icon by default */
.password-toggle .eye-off-icon {
    display: none;
}

.password-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.9);
}

.password-toggle svg {
    pointer-events: none;
}

input[type="password"],
input.password-input {
    padding-right: 48px !important;
}

/* Ensure inline inputs also respect the padding */
.inline-auth-card .inline-input {
    padding-right: 48px !important;
}

/* ===== FOOTER ===== */
.main-footer {
    position: relative;
    margin-top: 60px;
    padding: 68px 0 28px;
    background: linear-gradient(180deg, rgba(5, 1, 10, 0.9) 0%, rgba(5, 1, 10, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.main-footer::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 107, 129, 0) 0%, rgba(255, 107, 129, 0.55) 50%, rgba(255, 107, 129, 0) 100%);
    opacity: 0.8;
}

.footer-container {
    max-width: 1340px;
    margin: 0 auto;
    padding: 0 18px;
}

.footer-top {
    display: grid;
    grid-template-columns: minmax(240px, 1.2fr) repeat(2, minmax(220px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand-mark {
    display: flex;
    align-items: center;
    gap: 18px;
}

.footer-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-logo {
    width: auto;
    height: 64px;
    opacity: 0.96;
    filter: drop-shadow(0 10px 22px rgba(255, 107, 129, 0.12));
}

.footer-tagline {
    color: var(--text-tertiary);
    font-size: 0.92rem;
    line-height: 1.65;
    max-width: 260px;
}

.footer-group h4,
.footer-social h4 {
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.footer-group ul {
    list-style: none;
}

.footer-group ul li {
    margin-bottom: 14px;
}

.footer-group ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.28s ease, transform 0.28s ease;
}

.footer-group ul li a:hover {
    color: #fff;
}

.social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.social-link {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.72);
    transition: transform 0.28s ease, background 0.28s ease, color 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.social-link:hover {
    transform: translateY(-4px);
    background: rgba(255, 107, 129, 0.14);
    border-color: rgba(255, 107, 129, 0.3);
    color: #fff;
    box-shadow: 0 14px 26px rgba(255, 107, 129, 0.16);
}

.footer-bottom {
    padding-top: 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}

.copyright {
    color: var(--text-tertiary);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}

@media (max-width: 900px) {
    .footer-top {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .main-footer {
        margin-top: 40px;
        padding: 46px 0 22px;
    }

    .footer-top {
        text-align: center;
    }

    .footer-brand-mark {
        flex-direction: column;
    }

    .footer-tagline {
        max-width: none;
    }

    .social-icons {
        justify-content: center;
    }
}
