:root {
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.9);
    --text-muted: rgba(255, 255, 255, 0.75);
    
    --glass-bg: rgba(255, 255, 255, 0.12); 
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-hover: rgba(255, 255, 255, 0.25);
    
    --holiday-color: #FFD54F; 
    --weekend-color: #ffcc80; 
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }

/* 1. БАЗОВЫЕ НАСТРОЙКИ */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(180deg, #4b6cb7 0%, #182848 100%);
    transition: background 1s ease;
}

/* 2. ДИНАМИЧЕСКИЕ ФОНЫ */
body.day-clear { background: linear-gradient(180deg, #2980b9 0%, #6dd5fa 100%); }
body.day-cloudy { background: linear-gradient(180deg, #5b86e5 0%, #36d1dc 100%); }
body.day-rain { background: linear-gradient(180deg, #373B44 0%, #4286f4 100%); }
body.day-snow { background: linear-gradient(180deg, #83a4d4 0%, #b6fbff 100%); }
body.day-storm { background: linear-gradient(180deg, #232526 0%, #414345 100%); }

body.night-clear { background: linear-gradient(180deg, #0f2027 0%, #203a43 100%, #2c5364 100%); }
body.night-cloudy { background: linear-gradient(180deg, #141E30 0%, #243B55 100%); }
body.night-rain { background: linear-gradient(180deg, #000428 0%, #004e92 100%); }
body.night-snow { background: linear-gradient(180deg, #16222A 0%, #3A6073 100%); }

/* 3. ВЕРТИКАЛЬНЫЙ СКРОЛЛ */
.vertical-scroll-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none; 
}
.vertical-scroll-container::-webkit-scrollbar { display: none; }

/* 4. СЕКЦИИ (СЛАЙДЫ) */
.slide-section {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 80px; 
    overflow: hidden; 
}

/* 5. ШАПКА И ПОИСК */
.app-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    padding: 15px 20px;
    z-index: 100;
    display: flex;
    justify-content: center;
    background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, transparent 100%);
    pointer-events: none; 
    height: 80px; 
}

.header-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    pointer-events: auto;
}

.search-box {
    position: relative;
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    display: flex;
    align-items: center;
    padding: 0 10px 0 15px;
    transition: background 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    height: 46px;
}

.search-box:hover, .search-box:focus-within { background: rgba(255, 255, 255, 0.25); }

.search-icon { font-size: 16px; margin-right: 10px; opacity: 0.8; flex-shrink: 0; }

input { 
    width: 100%; background: transparent; border: none; font-size: 16px; 
    color: white; outline: none; padding-right: 30px; height: 100%;
}
input::placeholder { color: rgba(255, 255, 255, 0.8); }

.clear-icon {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6); cursor: pointer; font-size: 14px;
    font-weight: bold; padding: 8px; z-index: 10; display: none;
}
.clear-icon:hover { color: white; }

.refresh-btn {
    width: 46px; height: 46px; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px); color: white; font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    flex-shrink: 0; padding: 0; -webkit-tap-highlight-color: transparent;
}
.refresh-btn:hover { background: rgba(255, 255, 255, 0.25); transform: scale(1.05); }
.refresh-btn:active { transform: scale(0.95); background: rgba(255, 255, 255, 0.3); }

.spin-animation { animation: spinIcon 1s linear infinite; pointer-events: none; opacity: 0.7; }
@keyframes spinIcon { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.suggestions-list {
    position: absolute; top: 110%; left: 0; right: 0;
    background: rgba(30, 30, 30, 0.95); backdrop-filter: blur(20px); border-radius: 18px;
    max-height: 300px; overflow-y: auto; display: none; padding: 5px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); z-index: 200;
}
.suggestions-list.show { display: block; }
.suggestion-item { padding: 14px 20px; cursor: pointer; color: white; border-bottom: 1px solid rgba(255,255,255,0.1); font-size: 16px; }
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: rgba(255,255,255,0.1); }
.suggestion-item span { color: rgba(255, 255, 255, 0.5); font-size: 14px; margin-left: 5px; }
.suggestion-item span::before { content: ", "; }

/* --- 6. СЛАЙД 1: ГЛАВНЫЙ ЭКРАН --- */
#slideCurrent .slide-content {
    display: flex; flex-direction: column; justify-content: space-between; 
    align-items: center; width: 100%; max-width: 500px; 
    height: 100%; max-height: 820px; min-height: 550px;  
    padding: 10px 20px 20px 20px; gap: 0; 
}

.city-header-group {
    cursor: pointer; transition: opacity 0.2s; -webkit-tap-highlight-color: transparent; text-align: center;
}
.city-header-group:active { opacity: 0.6; }
/* Добавление флага */
.country-flag {
    font-size: 0.7em; /* Чуть меньше основного текста */
    margin-left: 10px; /* Отступ от названия города */
    vertical-align: middle; /* Выравнивание по центру строки */
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); /* Легкая тень для объема */
}

/* Обновленный стиль заголовка, чтобы флаг вписался */
.city-name { 
    margin: 0; 
    font-size: 32px; 
    font-weight: 700; 
    text-shadow: 0 2px 10px rgba(0,0,0,0.2); 
    line-height: 1.1; 
    display: inline-block; /* Чтобы флаг не переносился странно */
    align-items: center;
}

.local-time { margin-top: 2px; font-size: 15px; color: var(--text-secondary); opacity: 0.9; }

.mood-phrase, .utility-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px); border-radius: 16px; padding: 10px 16px;
    text-align: left; color: white; box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    width: 100%; display: flex; gap: 12px; align-items: center;
    justify-content: flex-start; font-size: 14px; font-weight: 500;
    line-height: 1.3; margin: 0;
}
.mood-phrase { display: block; text-align: center; }
.utility-icon { font-size: 20px; flex-shrink: 0; }
.utility-card p { margin: 0; }

/* ГЛАВНЫЙ БЛОК ПОГОДЫ */
.main-weather-block { 
    display: flex; align-items: stretch; justify-content: center;
    gap: 20px; margin: 5px 0; position: relative; width: 100%;
}

.weather-center { display: flex; flex-direction: column; align-items: center; text-align: center; }
.weather-icon-giant { font-size: 85px; filter: drop-shadow(0 10px 30px rgba(0,0,0,0.3)); margin-bottom: -15px; z-index: 2; }
.temp-value { font-size: 80px; font-weight: 200; line-height: 1; letter-spacing: -3px; margin-left: -5px; }
.feels-like { font-size: 15px; color: var(--text-secondary); margin-top: 0px; font-weight: 500; }

.weather-text-main { 
    text-align: center; font-size: 16px; font-weight: 500; color: var(--text-secondary);
    margin-bottom: 5px; background: rgba(255,255,255,0.1); padding: 6px 12px; border-radius: 20px;
}

/* БОКОВЫЕ КОЛОНКИ */
.astro-side {
    display: flex; flex-direction: column; align-items: center; justify-content: space-between;
    width: 70px; padding-top: 20px; padding-bottom: 25px;
}
.astro-group-top { display: flex; flex-direction: column; align-items: center; }
.astro-group-top .astro-label { margin-bottom: 2px; order: 1; }
.astro-group-top .astro-time { order: 2; }

.astro-group-bottom { display: flex; flex-direction: column; align-items: center; }
.astro-group-bottom .astro-time { margin-bottom: 2px; order: 1; }
.astro-group-bottom .astro-label { order: 2; }

.astro-label { font-size: 10px; text-transform: uppercase; opacity: 0.7; letter-spacing: 0.5px; font-weight: 600; }
.astro-time { font-size: 15px; font-weight: 700; }

/* ПЛИТКИ */
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-top: 5px; }
.detail-item {
    background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 14px;
    padding: 8px 12px; display: flex; flex-direction: column; align-items: center; text-align: center;
    cursor: pointer; transition: all 0.2s ease; backdrop-filter: blur(12px); justify-content: center; height: auto;
}
.detail-item:hover { background: var(--glass-hover); transform: translateY(-2px); }
.detail-item:active { transform: scale(0.96); background: rgba(255,255,255,0.25); }

.d-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 600; margin-bottom: 2px; order: 1; }
.d-value { font-size: 16px; font-weight: 700; color: white; order: 2; }
.d-value small { font-size: 12px; font-weight: 500; opacity: 0.8; margin-left: 2px; }

.scroll-hint { text-align: center; font-size: 11px; color: var(--text-muted); padding: 2px; animation: bounce 2s infinite; margin-top: 5px; }

/* --- 7. СЛАЙД 2: ПРОГНОЗ --- */
#slideForecast .slide-content { 
    display: flex; flex-direction: column; justify-content: center;
    padding: 20px; width: 100%; max-width: 500px; margin: 0 auto; height: 100%;
}
.section-title { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; margin: 0 0 15px 0; color: var(--text-secondary); font-weight: 700; opacity: 0.9; }
.hourly-wrapper { width: 100%; margin-bottom: 25px; }

/* ИСПРАВЛЕНО: justify-content: space-between для распределения */
.hourly-scroll {
    display: flex; 
    overflow-x: auto; 
    gap: 10px; 
    padding-bottom: 10px;
    justify-content: space-between; /* <--- Равномерное распределение */
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.3) transparent;
}
.hourly-scroll::-webkit-scrollbar { height: 3px; }
.hourly-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 4px; }

.hour-card {
    flex: 0 0 65px; background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 14px; padding: 12px 5px; text-align: center; display: flex; flex-direction: column; gap: 8px;
}
.h-time { font-size: 12px; color: var(--text-muted); }
.h-icon { font-size: 22px; }
.h-temp { font-size: 15px; font-weight: 700; }

.forecast-list { display: flex; flex-direction: column; width: 100%; }
.forecast-row {
    display: grid; grid-template-columns: 55px 1fr 40px 105px; 
    align-items: center; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.forecast-row:last-child { border-bottom: none; }
.day-col-date { display: flex; flex-direction: column; line-height: 1.2; }
.day-name { font-weight: 600; font-size: 16px; }
.day-date { font-size: 11px; color: var(--text-muted); }
.day-col-date.weekend .day-name { color: var(--weekend-color); }
.day-col-holiday { padding-left: 10px; overflow: hidden; }
.day-holiday { color: var(--holiday-color); font-size: 14px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; opacity: 1; }
.day-col-icon { display: flex; justify-content: center; align-items: center; font-size: 24px; height: 100%; }
.day-col-temp { text-align: right; font-weight: 600; font-size: 17px; white-space: nowrap; }
.day-temp-low { color: var(--text-muted); font-weight: 400; margin-left: 3px; }

/* --- 8. СЛАЙД 3: ИНФО --- */
#slideInfo .slide-content { justify-content: center; align-items: center; padding-top: 80px; height: 100%; }
.scrollable-content { overflow-y: auto; max-height: 100%; width: 100%; padding-bottom: 20px; scrollbar-width: none; }
.info-container {
    background: none; padding: 20px; border-radius: 0; width: 100%; max-width: 500px;
    margin: 0 auto; box-shadow: none; border: none;
}
.info-container h2 { margin-top: 0; font-size: 26px; margin-bottom: 15px; }
.info-container p { font-size: 16px; line-height: 1.6; opacity: 0.9; }
.info-container p a { color: inherit; text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
.info-container p a:hover { opacity: 0.8; }
.info-features { list-style: none; padding: 0; margin: 20px 0; opacity: 0.95; line-height: 1.6; font-size: 16px; } 
.info-features li { margin-bottom: 10px; position: relative; padding-left: 20px; }
.info-features li::before { content: "•"; position: absolute; left: 0; color: var(--holiday-color); font-size: 20px; line-height: 1; }
.footer-block { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.2); font-size: 13px; color: var(--text-muted); text-align: center; }
.footer-links-row { margin-top: 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; }
.footer-links-row a { color: white; text-decoration: none; opacity: 0.7; }
.footer-links-row a:hover { opacity: 1; text-decoration: underline; }

/* --- 9. МОДАЛЬНЫЕ ОКНА --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(8px); z-index: 2000;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    animation: fadeIn 0.3s ease;
}
.modal-card {
    background: linear-gradient(135deg, #2c3e50, #1a1a1a); width: 100%; max-width: 380px;
    border-radius: 24px; padding: 30px; position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.15); color: white; text-align: center;
}
.modal-card h3 { margin-top: 0; font-size: 20px; color: var(--holiday-color); margin-bottom: 15px; }
.modal-card p { font-size: 16px; line-height: 1.6; opacity: 0.95; margin-bottom: 25px; }
.modal-btn {
    width: 100%; padding: 14px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: white;
    font-weight: 600; border-radius: 16px; cursor: pointer; font-size: 16px; transition: background 0.2s;
}
.modal-btn:hover { background: rgba(255,255,255,0.2); }
.modal-close { position: absolute; top: 10px; right: 15px; background: none; border: none; color: rgba(255,255,255,0.5); font-size: 28px; cursor: pointer; }

/* Утилиты */
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.loading-screen { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; opacity: 0.8; }
.spinner { width: 30px; height: 30px; border: 3px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 10px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.cookie-banner { 
    position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); 
    width: 90%; max-width: 360px;
    background: rgba(20, 20, 20, 0.85); backdrop-filter: blur(10px);
    padding: 10px 15px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.1);
    display: flex; justify-content: space-between; align-items: center; gap: 15px; 
    z-index: 3000; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.cookie-banner p { margin: 0; font-size: 11px; color: rgba(255, 255, 255, 0.8); line-height: 1.3; }
.cookie-banner a { color: #fff; text-decoration: underline; }
.cookie-banner button { 
    border: none; background: rgba(255,255,255,0.2); color: white;
    padding: 6px 14px; border-radius: 12px; cursor: pointer; font-weight: 600; font-size: 11px; flex-shrink: 0; transition: background 0.2s;
}
.cookie-banner button:hover { background: rgba(255,255,255,0.3); }