/* ============================================
   SPA View System - Critical для работы навигации
   ============================================ */

/* 🐛 DEBUG MODE: Раскомментируй для отладки */
/* .app-view { border: 2px solid red !important; } */
/* .app-view:not(.hidden) { border: 2px solid lime !important; } */

/* Блокировка скролла при открытых модальных окнах */
body.modal-open,
body.sheet-open {
    overflow: hidden !important;
    position: fixed; /* Дополнительная гарантия блокировки */
    width: 100%;
}

.app-view {
    position: relative;
    width: 100%;
    min-height: var(--view-min-height);
    overflow: visible; /* Native scroll - browser handles scrolling */
    z-index: 100; /* Golden z-index: основные экраны */

    /* Spacing inside container */
    padding: var(--container-padding-top) var(--container-padding-x) var(--container-padding-bottom);
    box-sizing: border-box;
}

.app-view.hidden {
    display: none !important;
}

/* ============================================
   GENERATION LAUNCHER (универсальное окно)
   ============================================ */

.generation-launcher-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: var(--container-max-width);
    margin: 0 auto;
    background: var(--color-background);
    z-index: 2000;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.generation-launcher-view.hidden {
    display: none !important;
}

.launcher-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding: var(--container-padding-top) var(--container-padding-x) 200px;
    position: relative;
    min-height: 100%;
    box-sizing: border-box;
}

/* ✅ Кнопка закрытия - используется глобальная app-header с headerBackBtn */

/* Превью стиля */
.launcher-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 8px;
}

/* Wrapper с градиентным бордером */
.launcher-preview-wrapper {
    padding: 3px; /* Толщина рамки */
    background: linear-gradient(135deg,
        #667eea 0%,
        #764ba2 25%,
        #f093fb 50%,
        #4facfe 75%,
        #00f2fe 100%);
    border-radius: 16px;
    margin-bottom: 6px;
}

.launcher-preview img {
    width: 140px;
    height: 187px; /* 140 * 4/3 ≈ 187 (пропорции 3:4) */
    border-radius: 13px;
    object-fit: cover;
    display: block;
    background: #000000;
}

.launcher-preview-label {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
}

/* Заголовок */
.launcher-header {
    text-align: center;
    margin-bottom: 8px;
}

.launcher-header h1 {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 2px 0;
    line-height: 1.2;
}

.launcher-header p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    line-height: 1.3;
}

/* Profiles section в launcher */
.generation-launcher-view .profiles-selector {
    margin: 4px 0;
}

/* ✅ Launcher specific: блок селектора прижат к низу */
.generation-launcher-view .models-selector-section {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 100%; /* Внутри launcher уже есть max-width */
    padding: 16px var(--container-padding-x) 20px;
    border-radius: 32px 32px 0 0;
    box-sizing: border-box;
}

/* Bottom nav styles in common.css - no duplication */

/* Плавные переходы между view (опционально) */
.app-view {
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Предотвращение FOUC (Flash of Unstyled Content) */
body:not(.spa-ready) .app-view:not(#view-home) {
    display: none !important;
}

body.spa-ready .app-view.hidden {
    display: none !important;
}

