/**
 * Theater Layout CSS
 * Базовая разметка театра: контейнеры, экраны, навигация
 */

/* ===== Base ===== */
html, body {
    height: 100%;
    overflow: hidden;
    font-family: var(--font-primary);
    background: #0d0d0d;
}

/* ===== Theater Container ===== */
.theater {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: relative;
}

/* ===== Screen Indicator ===== */
.theater-indicator {
    position: fixed;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 100;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.indicator-dot:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

.indicator-dot.active {
    background: var(--accent-gold);
    width: 25px;
    border-radius: 5px;
}

/* ===== Screens Container ===== */
.theater-screens {
    display: flex;
    width: 300%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    transform: translateX(0);
}

.theater-screens[data-screen="0"] {
    transform: translateX(0);
}

.theater-screens[data-screen="1"] {
    transform: translateX(-33.333%);
}

.theater-screens[data-screen="2"] {
    transform: translateX(-66.666%);
}

/* ===== Swipe Hint Animation ===== */
@keyframes swipe-hint-from-wardrobe {
    0% { transform: translateX(0); }
    30% { transform: translateX(-5%); }
    50% { transform: translateX(-5%); }
    100% { transform: translateX(0); }
}

@keyframes swipe-hint-from-backstage {
    0% { transform: translateX(-33.333%); }
    30% { transform: translateX(-38.333%); }
    50% { transform: translateX(-38.333%); }
    100% { transform: translateX(-33.333%); }
}

@keyframes swipe-hint-from-stage {
    0% { transform: translateX(-66.666%); }
    30% { transform: translateX(-61.666%); }
    50% { transform: translateX(-61.666%); }
    100% { transform: translateX(-66.666%); }
}

.theater-screens.swipe-hint-animation {
    animation: swipe-hint-from-wardrobe 1.4s ease-in-out;
}

.theater-screens.swipe-hint-to-stage {
    animation: swipe-hint-from-backstage 1.4s ease-in-out;
}

.theater-screens.swipe-hint-to-backstage {
    animation: swipe-hint-from-stage 1.4s ease-in-out;
}

/* ===== Individual Screen ===== */
.screen {
    width: 33.333%;
    height: 100%;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ===== Exit Corner Button ===== */
.exit-corner-btn {
    position: absolute;
    top: 20px;
    right: calc(20px + 2cm);
    z-index: 50;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: transform 0.2s ease;
}

.exit-corner-btn .exit-icon {
    font-size: 32px;
    filter: hue-rotate(90deg) saturate(1.5);
    transition: filter 0.2s ease;
}

.exit-corner-btn .exit-text {
    color: #4ade80;
    font-size: 11px;
}

.exit-corner-btn:hover {
    transform: scale(1.1);
}

.exit-corner-btn:hover .exit-icon {
    filter: hue-rotate(90deg) saturate(2);
}

@media (max-width: 480px) {
    .exit-corner-btn {
        top: 12px;
        right: calc(12px + 1.5cm);
    }

    .exit-corner-btn .exit-icon {
        font-size: 28px;
    }

    .exit-corner-btn .exit-text {
        font-size: 10px;
    }
}

/* ===== Screen backgrounds ===== */
.screen--wardrobe {
    --bg-color: #1a1215;
    background-color: var(--bg-color);
    background-image: url('/assets/images/theater/wardrobe.png');
    background-position: center top;
}

.screen--backstage {
    --bg-color: #1e1820;
    background-color: var(--bg-color);
    background-image: url('/assets/images/theater/backstage.png');
    background-position: center top;
}

.screen--stage {
    --bg-color: #0d1020;
    background-color: var(--bg-color);
    background-image: url('/assets/images/theater/stage.png');
    background-position: center center;
}

@media (min-width: 769px) {
    .screen--stage {
        background-image: url('/assets/images/theater/stage-desktop.jpg');
    }
}

/* Dark overlay for better text readability */
.screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.1) 30%,
        rgba(0, 0, 0, 0.1) 70%,
        rgba(0, 0, 0, 0.4) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* ===== Screen Content ===== */
.screen-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    color: var(--text-light);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.screen-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--accent-gold);
    text-align: center;
    margin-bottom: 14px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
