/* FILMPARTY — Mobile bottom navigation (icon-first, no per-button boxes) */

.mobile-bottom-nav {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    width: min(94%, 480px);
    height: 66px;
    display: none;
    align-items: stretch;
    justify-content: space-between;
    padding: 0 10px;
    border-radius: 26px;
    background: var(--glass-fill);
    border: 1px solid var(--glass-border-neutral);
    backdrop-filter: blur(20px) saturate(1.06);
    -webkit-backdrop-filter: blur(20px) saturate(1.06);
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.16),
        inset 0 1px 0 var(--glass-highlight),
        var(--glass-accent-rim);
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
}

/* NOTE: the legacy `.mobile-bottom-nav.fp-bottom-nav` override that used to live
   here set a different bottom/height/padding than the app-match island block,
   which made the pill jump around between pages. It has been removed — the
   single "APP-MATCH GLASS ISLAND (global)" block at the bottom of this file is
   now the ONLY island definition, so it is identical on every page + size. */

.fp-bottom-nav__link {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 2px 4px;
    text-decoration: none;
    color: rgba(216, 228, 246, 0.74);
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease;
}

.fp-bottom-nav__icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: inherit;
}

.fp-bottom-nav__svg {
    width: 28px;
    height: 28px;
    display: block;
    overflow: visible;
    color: inherit;
    filter: drop-shadow(0 1px 1px rgba(2, 8, 22, 0.34))
        drop-shadow(0 0 0.5px rgba(118, 168, 255, 0.16));
}

.fp-bottom-nav__label {
    font-size: 10.5px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
    text-shadow:
        0 1px 2px rgba(3, 10, 24, 0.42),
        0 0 8px rgba(92, 148, 255, 0.07);
}

.fp-bottom-nav__link.active,
.fp-bottom-nav__link[aria-current="page"] {
    color: rgba(234, 242, 255, 0.9);
}

.fp-bottom-nav__link.active .fp-bottom-nav__label,
.fp-bottom-nav__link[aria-current="page"] .fp-bottom-nav__label {
    text-shadow:
        0 1px 2px rgba(2, 8, 22, 0.48),
        0 0 10px rgba(130, 185, 255, 0.12);
}

.fp-bottom-nav__link.active .fp-bottom-nav__svg,
.fp-bottom-nav__link[aria-current="page"] .fp-bottom-nav__svg {
    filter: drop-shadow(0 1px 1.5px rgba(2, 8, 22, 0.42))
        drop-shadow(0 0 6px rgba(120, 175, 255, 0.26));
}

.fp-bottom-nav__icon--avatar {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
}

.fp-bottom-nav__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 2px solid rgba(210, 228, 255, 0.36);
    background: rgba(255, 255, 255, 0.06);
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.fp-bottom-nav__link--profile.active .fp-bottom-nav__avatar,
.fp-bottom-nav__link--profile[aria-current="page"] .fp-bottom-nav__avatar {
    border-color: rgba(168, 205, 255, 0.62);
    box-shadow: 0 0 0 1px rgba(87, 161, 255, 0.18), 0 0 10px rgba(87, 161, 255, 0.14);
}

/* Icon transforms — default (mobile/touch): no animation */
.fp-nav-home-roof,
.fp-nav-home-door {
    transform-box: fill-box;
    transform-origin: center;
}

.fp-nav-projector-beam {
    opacity: 0;
    transition: opacity 0.22s ease;
}

.fp-nav-projector-lens,
.fp-nav-projector-lens-glass {
    transition: stroke 0.22s ease, fill-opacity 0.22s ease, filter 0.22s ease;
}

.fp-nav-ep-1,
.fp-nav-ep-2,
.fp-nav-ep-3 {
    transform-origin: center;
}

@media (hover: hover) and (pointer: fine) {
    .fp-bottom-nav__link--home:hover {
        color: rgba(228, 238, 252, 0.88);
    }

    .fp-bottom-nav__link--home:hover .fp-nav-home-roof {
        animation: fp-nav-home-roof-lift 0.55s cubic-bezier(0.34, 1.35, 0.64, 1) forwards;
    }

    .fp-bottom-nav__link--home:hover .fp-nav-home-door {
        animation: fp-nav-home-door-pulse 0.55s ease forwards;
    }

    .fp-bottom-nav__link--movies:hover {
        color: rgba(228, 238, 252, 0.88);
    }

    .fp-bottom-nav__link--movies:hover .fp-nav-projector-beam {
        opacity: 0.92;
    }

    .fp-bottom-nav__link--movies:hover .fp-nav-projector-lens-glass {
        fill-opacity: 1;
        filter: drop-shadow(0 0 2px rgba(255, 228, 150, 0.95));
    }

    .fp-bottom-nav__link--movies:hover .fp-nav-projector-lens {
        stroke: rgba(255, 236, 170, 0.98);
        filter: drop-shadow(0 0 3px rgba(255, 210, 90, 0.55));
    }

    .fp-bottom-nav__link--series:hover {
        color: rgba(228, 238, 252, 0.88);
    }

    .fp-bottom-nav__link--series:hover .fp-nav-ep-1 {
        animation: fp-nav-ep-slide 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    }

    .fp-bottom-nav__link--series:hover .fp-nav-ep-2 {
        animation: fp-nav-ep-slide 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards;
    }

    .fp-bottom-nav__link--series:hover .fp-nav-ep-3 {
        animation: fp-nav-ep-slide 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
    }

    .fp-bottom-nav__link--profile:hover .fp-bottom-nav__avatar {
        transform: scale(1.06);
        border-color: rgba(255, 255, 255, 0.55);
    }
}

@keyframes fp-nav-home-roof-lift {
    0% { transform: translateY(0); }
    45% { transform: translateY(-2.5px); }
    100% { transform: translateY(0); }
}

@keyframes fp-nav-home-door-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.88; }
}

@keyframes fp-nav-ep-slide {
    0% { transform: translateX(0); opacity: 1; }
    40% { transform: translateX(-2.5px); opacity: 1; }
    100% { transform: translateX(0); opacity: 1; }
}

@media (max-width: 390px) {
    /* keep the unified compact-pill height (auto) — the old fixed 64px here made
       the island a different size on small phones (a second source of truth). */
    .mobile-bottom-nav.fp-bottom-nav {
        padding: 0 4px;
    }

    .fp-bottom-nav__icon {
        width: 26px;
        height: 26px;
        flex-basis: 26px;
    }

    .fp-bottom-nav__svg {
        width: 26px;
        height: 26px;
    }

    .fp-bottom-nav__icon--avatar {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
    }

    .fp-bottom-nav__avatar {
        width: 26px;
        height: 26px;
    }

    .fp-bottom-nav__label {
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fp-bottom-nav__link *,
    .fp-bottom-nav__avatar {
        animation: none !important;
        transition: none !important;
    }
}

/* =============================================================================
   FILMPARTY APP-MATCH GLASS ISLAND (global) — turns the bottom bar into the
   floating, icons-only liquid-glass pill from the Android app, on EVERY mobile
   page (home / movies / series / profile / direct). iOS PWA safe-area aware.
   ========================================================================== */
@media (max-width: 768px) {
    /* `.mobile-bottom-nav.fp-bottom-nav` (two classes) so this reliably wins over
       the base `.mobile-bottom-nav` rule — one island, identical on every page. */
    .mobile-bottom-nav.fp-bottom-nav {
        position: fixed;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        /* ONE unified island position for every context (browser + PWA, every
           device + size). The page uses viewport-fit=cover, so on iPhone the fixed
           containing block extends behind the home indicator in BOTH Safari and the
           home-screen web-app. `max()` sits the island at whichever is larger: a
           flat 12px (phones with no home indicator / Android / desktop) OR exactly
           the safe-area inset (iPhone) — so it clears the home indicator without the
           phantom 12px gap the old `12px + env` left ("came up higher"). No
           display-mode branching, no duplicate rules. */
        bottom: max(12px, env(safe-area-inset-bottom, 0px));
        top: auto;
        width: auto;
        height: auto;
        margin: 0;
        max-width: calc(100% - 24px);
        gap: 3px;
        padding: 7px 9px;
        border-radius: 30px;
        align-items: center;
        justify-content: center;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, transparent 42%, rgba(0, 0, 0, 0.12) 100%),
            rgba(14, 18, 28, 0.82);
        border: 1px solid rgba(255, 255, 255, 0.22);
        box-shadow: 0 16px 42px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18);
        -webkit-backdrop-filter: blur(30px) saturate(1.3);
        backdrop-filter: blur(30px) saturate(1.3);
    }

    /* (position is fully handled by the single max() rule above — no PWA/browser
       branching, so there is no second source of truth for the island's bottom.) */

    .fp-bottom-nav .fp-bottom-nav__link {
        flex: 0 0 auto;
        width: 54px;
        height: 44px;
        min-width: 0;
        flex-direction: row;
        gap: 0;
        padding: 0;
        border-radius: 16px;
        border: 1px solid transparent;
        background: transparent;
        color: #B6C2D1;
        position: relative;
    }

    .fp-bottom-nav .fp-bottom-nav__link.active {
        color: #FF304F;
        background: linear-gradient(180deg, rgba(255, 48, 79, 0.22), rgba(255, 48, 79, 0.06));
        border-color: rgba(255, 48, 79, 0.30);
    }

    .fp-bottom-nav .fp-bottom-nav__label {
        display: none !important;
    }

    .fp-bottom-nav .fp-bottom-nav__svg {
        width: 24px;
        height: 24px;
    }

    .fp-bottom-nav .fp-bottom-nav__icon--avatar {
        width: 27px;
        height: 27px;
        border-radius: 50%;
        overflow: hidden;
        border: 1px solid rgba(182, 194, 209, 0.45);
        background: #1C202A;
    }

    .fp-bottom-nav .fp-bottom-nav__link--profile.active .fp-bottom-nav__icon--avatar {
        border: 2px solid #FF304F;
    }

    .fp-bottom-nav .fp-bottom-nav__avatar {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .fp-bottom-nav .fp-bottom-nav__badge {
        position: absolute;
        top: 4px;
        inset-inline-end: 8px;
        min-width: 15px;
        height: 15px;
        padding: 0 3px;
        border-radius: 999px;
        background: #FF304F;
        color: #fff;
        font-size: 0.58rem;
        font-weight: 800;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1.5px solid #0a0f1c;
        line-height: 1;
    }

    .fp-bottom-nav .fp-bottom-nav__badge[hidden] {
        display: none;
    }

    /* while a direct conversation is open the composer needs the space — hide it */
    body.fpdm-in-conv .fp-bottom-nav {
        display: none !important;
    }
}
