/* ============================================================================
 * guestHeader.css - Sparse header/footer chrome for guest pages
 * Used only when no user is logged in. Logged-in users fall through to header.php.
 * ============================================================================ */

/* ============================================================================
 * Body padding so fixed top nav and bottom nav don't cover content
 * ============================================================================ */
body.guest-mode {
    padding-top: 56px;
    /* Flex column + 100vh so the footer can be pushed to the bottom on short
       pages via mt-auto, matching the standard footer.php sticky pattern. */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Main content wrapper grows to fill available space, leaving the footer
   stuck to the bottom on short pages. */
body.guest-mode > .container-fluid {
    flex: 1 0 auto;
}

@media (max-width: 767.98px) {
    body.guest-mode {
        padding-bottom: 64px; /* room for bottom nav */
    }
}

/* ============================================================================
 * DESKTOP TOP NAV
 * ============================================================================ */
.guest-topnav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--mv-bg-surface, #1a1d23);
    border-bottom: 1px solid var(--mv-border-color, #2d3138);
    z-index: 1030;
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

[data-bs-theme="light"] .guest-topnav {
    background: #ffffff;
    border-bottom-color: #dee2e6;
}

.guest-topnav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
}

.guest-topnav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.guest-topnav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.guest-topnav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.guest-topnav-brand img {
    height: 36px;
}

.guest-topnav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.guest-topnav-link {
    color: var(--mv-text-secondary, #94a3b8);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
}

.guest-topnav-link:hover,
.guest-topnav-link.active {
    color: var(--mv-text-primary, #e2e8f0);
    background: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="light"] .guest-topnav-link {
    color: #495057;
}

[data-bs-theme="light"] .guest-topnav-link:hover,
[data-bs-theme="light"] .guest-topnav-link.active {
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.06);
}

.guest-topnav-link i {
    margin-right: 0.35rem;
}

.guest-topnav-search {
    flex: 1;
    max-width: 480px;
}

.guest-topnav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Hide the desktop top nav on small screens (mobile uses its own header) */
@media (max-width: 767.98px) {
    .guest-topnav {
        display: none;
    }
}

/* Compact search icon — only shown at narrow desktop / tablet widths.
   At >= 1200px we keep the inline search bar; below that we collapse to
   an icon button (like the standard mobile pattern) so there's room for
   the full nav text labels. */
.guest-topnav-search-icon {
    display: none;
    background: transparent;
    border: none;
    color: var(--mv-text-primary, #e2e8f0);
    font-size: 1.2rem;
    width: 40px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
}
.guest-topnav-search-icon:hover {
    background: rgba(255, 255, 255, 0.06);
}
[data-bs-theme="light"] .guest-topnav-search-icon {
    color: #495057;
}

@media (max-width: 1199.98px) {
    .guest-topnav-search { display: none; }
    .guest-topnav-search-icon { display: inline-flex; }
}

/* ============================================================================
 * MOBILE TOP HEADER
 * ============================================================================ */
.guest-mobile-top {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--mv-bg-surface, #1a1d23);
    border-bottom: 1px solid var(--mv-border-color, #2d3138);
    z-index: 1030;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.75rem;
}

[data-bs-theme="light"] .guest-mobile-top {
    background: #ffffff;
    border-bottom-color: #dee2e6;
}

@media (max-width: 767.98px) {
    .guest-mobile-top {
        display: flex;
    }
}

.guest-mobile-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.guest-mobile-brand img {
    height: 32px;
}

.guest-mobile-search-btn {
    background: transparent;
    border: none;
    color: var(--mv-text-primary, #e2e8f0);
    font-size: 1.4rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
}

.guest-mobile-search-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="light"] .guest-mobile-search-btn {
    color: #212529;
}

/* Mobile search slide-down panel */
.guest-mobile-search-panel {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--mv-bg-surface, #1a1d23);
    border-bottom: 1px solid var(--mv-border-color, #2d3138);
    z-index: 1029;
    padding: 0.75rem;
}

[data-bs-theme="light"] .guest-mobile-search-panel {
    background: #ffffff;
    border-bottom-color: #dee2e6;
}

.guest-mobile-search-panel.active {
    display: block;
}

/* ============================================================================
 * MOBILE BOTTOM NAV (5 items)
 * ============================================================================ */
.guest-mobile-bottom {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--mv-bg-surface, #1a1d23);
    border-top: 1px solid var(--mv-border-color, #2d3138);
    z-index: 1030;
}

[data-bs-theme="light"] .guest-mobile-bottom {
    background: #ffffff;
    border-top-color: #dee2e6;
}

@media (max-width: 767.98px) {
    .guest-mobile-bottom {
        display: flex;
    }
}

.guest-mobile-bottom ul {
    display: flex;
    width: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
}

.guest-mobile-bottom li {
    flex: 1;
}

.guest-mobile-bottom a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-decoration: none;
    color: var(--mv-text-secondary, #94a3b8);
    font-size: 0.7rem;
    padding: 0.4rem 0.25rem;
    gap: 0.2rem;
}

.guest-mobile-bottom a:hover,
.guest-mobile-bottom a.active {
    color: var(--mv-text-primary, #e2e8f0);
}

[data-bs-theme="light"] .guest-mobile-bottom a {
    color: #6c757d;
}

[data-bs-theme="light"] .guest-mobile-bottom a:hover,
[data-bs-theme="light"] .guest-mobile-bottom a.active {
    color: #0d6efd;
}

.guest-mobile-bottom i {
    font-size: 1.3rem;
    line-height: 1;
}

/* Highlight Sign In as a primary action */
.guest-mobile-bottom a.guest-mobile-signin {
    color: #0d6efd;
}

.guest-mobile-bottom a.guest-mobile-signin.active {
    color: #0a58ca;
}

/* ============================================================================
 * GUEST FOOTER
 * ============================================================================ */
.guest-footer {
    background: var(--mv-bg-surface, #1a1d23);
    border-top: 1px solid var(--mv-border-color, #2d3138);
    padding: 1.25rem 1rem;
    margin-top: auto; /* sticks to bottom of viewport on short pages */
    flex-shrink: 0;
    text-align: center;
    color: var(--mv-text-secondary, #94a3b8);
    font-size: 0.875rem;
}

/* On mobile the bottom nav already serves as navigation, and the body has
   64px of padding-bottom for the fixed nav. Showing the text footer too
   produces a redundant strip + a visible gap above the nav, so hide it. */
@media (max-width: 767.98px) {
    .guest-footer { display: none; }
}

[data-bs-theme="light"] .guest-footer {
    background: #f8f9fa;
    border-top-color: #dee2e6;
    color: #6c757d;
}

.guest-footer a {
    color: var(--mv-text-secondary, #94a3b8);
    text-decoration: none;
    margin: 0 0.5rem;
}

.guest-footer a:hover {
    color: var(--mv-text-primary, #e2e8f0);
}

[data-bs-theme="light"] .guest-footer a {
    color: #495057;
}

[data-bs-theme="light"] .guest-footer a:hover {
    color: #0d6efd;
}

.guest-footer-sep {
    margin: 0 0.25rem;
    opacity: 0.5;
}


/* ============================================================================
 * GUEST SEARCH BAR (reuses header-search-* class names so existing typeahead
 * CSS in header.css applies)
 * ============================================================================ */
.guest-search-container {
    position: relative;
    width: 100%;
}

.guest-search-input-group {
    display: flex;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0.375rem;
    overflow: hidden;
}

[data-bs-theme="light"] .guest-search-input-group {
    background: #f1f3f5;
}

.guest-search-type-btn {
    background: transparent;
    border: none;
    color: var(--mv-text-primary, #e2e8f0);
    padding: 0 0.6rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.guest-search-type-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="light"] .guest-search-type-btn {
    color: #495057;
}

.guest-search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--mv-text-primary, #e2e8f0);
    padding: 0.4rem 0.6rem;
    outline: none;
    font-size: 0.9rem;
    min-width: 0;
}

.guest-search-input::placeholder {
    color: var(--mv-text-secondary, #94a3b8);
    opacity: 0.8;
}

[data-bs-theme="light"] .guest-search-input {
    color: #212529;
}

.guest-search-submit-btn {
    background: transparent;
    border: none;
    color: var(--mv-text-primary, #e2e8f0);
    padding: 0 0.7rem;
    cursor: pointer;
}

.guest-search-submit-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="light"] .guest-search-submit-btn {
    color: #495057;
}

/* Typeahead dropdown */
.guest-search-typeahead {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    background: var(--mv-bg-card, #23272f);
    border: 1px solid var(--mv-border-color, #2d3138);
    border-radius: 0.375rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    max-height: 70vh;
    overflow-y: auto;
    z-index: 1040;
}

[data-bs-theme="light"] .guest-search-typeahead {
    background: #ffffff;
    border-color: #dee2e6;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.guest-search-typeahead.active {
    display: block;
}

.gt-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    text-decoration: none;
    color: var(--mv-text-primary, #e2e8f0);
    border-bottom: 1px solid var(--mv-border-color, rgba(255, 255, 255, 0.06));
}

.gt-item:last-child {
    border-bottom: none;
}

.gt-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--mv-text-primary, #e2e8f0);
}

[data-bs-theme="light"] .gt-item {
    color: #212529;
    border-bottom-color: #f1f3f5;
}

[data-bs-theme="light"] .gt-item:hover {
    background: #f8f9fa;
}

.gt-image {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--mv-text-secondary, #94a3b8);
}

.gt-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gt-info {
    flex: 1;
    min-width: 0;
}

.gt-name {
    font-size: 0.9rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gt-role {
    font-size: 0.75rem;
    color: var(--mv-text-secondary, #94a3b8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gt-all-results {
    background: rgba(13, 110, 253, 0.08);
}

.gt-all-results:hover {
    background: rgba(13, 110, 253, 0.15);
}

.gt-empty {
    padding: 1rem;
    text-align: center;
    color: var(--mv-text-secondary, #94a3b8);
    font-size: 0.875rem;
}

.gt-loading {
    padding: 1rem;
    text-align: center;
    color: var(--mv-text-secondary, #94a3b8);
    font-size: 0.875rem;
}

/* Region picker button — used on recommend and title-detail pages for guest streaming region */
.gr-region-btn {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    min-width: 2.4rem;
    padding: 4px 8px;
}
.gr-region-dropdown {
    max-height: 260px;
    overflow-y: auto;
    font-size: 0.875rem;
}
