/* ===========================
   Menu TV — Full-screen digital menu display for TVs
   Optimized for FireTV stick, landscape/portrait adaptive
   =========================== */

/* Loading / Empty states */
.tv-loading,
.tv-empty {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: #0a0a0f;
    color: #ffffff;
    font-family: var(--font-body, ui-sans-serif, system-ui, -apple-system, sans-serif);
}

.tv-loading p,
.tv-empty p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.tv-empty i {
    font-size: 80px;
    color: rgba(255, 255, 255, 0.15);
}

.tv-empty h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
}

.tv-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--dm-accent, #c8956c);
    border-radius: 50%;
    animation: tvSpin 1s linear infinite;
}

@keyframes tvSpin {
    to { transform: rotate(360deg); }
}

/* ===========================
   Container & Slides
   =========================== */
.tv-container {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: #000000;
}

.tv-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s;
    display: flex;
}

.tv-slide.tv-slide-active {
    opacity: 1;
    visibility: visible;
}

/* ===========================
   LAYER 1: Media Panel (85% width)
   =========================== */
.tv-media-panel {
    flex: 0 0 85%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    overflow: hidden;
    position: relative;
}

.tv-video,
.tv-image {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.tv-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 2;
    transition: opacity 0.5s ease;
}

.tv-poster.tv-poster-hidden {
    opacity: 0;
    pointer-events: none;
}

.tv-media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a24, #0f0f14);
    color: rgba(255, 255, 255, 0.08);
    font-size: 10rem;
}

/* ===========================
   LAYER 2: Gradient Fade Overlay (30% from right)
   =========================== */
.tv-media-fade {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 0, 0, 0.4) 20%,
        rgba(0, 0, 0, 0.75) 40%,
        rgba(0, 0, 0, 0.92) 60%,
        #000000 80%
    );
    pointer-events: none;
    z-index: 5;
}

/* ===========================
   LAYER 2: Info Panel Overlay (30% fixed width, always right)
   =========================== */
.tv-info-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30%;
    display: flex;
    flex-direction: column;
    padding: 40px 50px;
    overflow: hidden;
    z-index: 10;
}

/* Brand (top) */
.tv-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: auto; /* Push content to bottom */
}

.tv-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.tv-brand-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.tv-company-name {
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--dm-accent, #c8956c);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tv-powered {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.tv-powered strong {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.tv-live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dm-accent, #c8956c);
    box-shadow: 0 0 8px var(--dm-accent, #c8956c);
    animation: tvPulse 2s ease-in-out infinite;
}

@keyframes tvPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Content (bottom - scrollable) */
.tv-content {
    margin-top: 32px;
    flex-shrink: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tv-content::-webkit-scrollbar {
    width: 4px;
}

.tv-content::-webkit-scrollbar-track {
    background: transparent;
}

.tv-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.tv-category {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 14px;
}

.tv-category i {
    font-size: 11px;
    color: var(--dm-accent, #c8956c);
}

.tv-title {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-family: var(--font-heading, var(--font-body));
}

.tv-featured {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    background: var(--dm-accent, #c8956c);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 6px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(200, 149, 108, 0.3);
}

.tv-featured i {
    font-size: 11px;
}

.tv-desc {
    margin: 0;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
}

.tv-price {
    font-size: 2rem;
    font-weight: 900;
    color: var(--dm-accent, #c8956c);
    font-family: var(--font-heading, var(--font-body));
    margin-top: 8px;
}

/* ===========================
   Fullscreen Toggle Button
   =========================== */
.tv-fullscreen-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    color: #ffffff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.tv-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

.tv-fullscreen-btn:active {
    transform: scale(0.95);
}

/* ===========================
   Responsive adjustments
   =========================== */
@media (max-width: 1440px) {
    .tv-info-panel {
        width: 32%;
    }

    .tv-media-fade {
        width: 32%;
    }
}

@media (max-width: 1280px) {
    .tv-info-panel {
        width: 35%;
        padding: 35px 40px;
    }

    .tv-media-fade {
        width: 35%;
    }

    .tv-title {
        font-size: 1.8rem;
    }

    .tv-price {
        font-size: 1.6rem;
    }
}

@media (max-height: 720px) {
    .tv-info-panel {
        padding: 30px 35px;
    }

    .tv-brand {
        padding-bottom: 16px;
    }

    .tv-logo {
        width: 48px;
        height: 48px;
    }

    .tv-content {
        margin-top: 20px;
    }

    .tv-title {
        font-size: 1.6rem;
    }

    .tv-desc {
        font-size: 0.9rem;
    }

    .tv-price {
        font-size: 1.4rem;
    }
}

/* For portrait orientation - info panel goes to bottom */
@media (orientation: portrait) {
    .tv-slide {
        flex-direction: column;
    }

    .tv-media-panel {
        flex: 0 0 60%;
    }

    .tv-info-panel {
        position: relative;
        width: 100%;
        flex: 1;
        padding: 30px;
    }

    .tv-media-fade {
        width: 100%;
        height: 40%;
        bottom: 0;
        top: auto;
        background: linear-gradient(
            180deg,
            transparent 0%,
            rgba(0, 0, 0, 0.4) 30%,
            rgba(0, 0, 0, 0.8) 70%,
            rgba(0, 0, 0, 0.95) 100%
        );
    }
}
