//* ========== ПЕРЕМЕННЫЕ (СВЕТЛАЯ ТЕМА) ========== */
:root {
    --text-color: #222;
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-text: #222;
    --card-shadow: 0 8px 20px rgba(0,0,0,0.15);
    --detail-bg: rgba(255,255,255,0.7);
    --detail-text: #444;
    --detail-strong: #111;
    --week-card-bg: rgba(255,255,255,0.7);
    --week-card-text: #222;
    --astro-bg: rgba(255,255,255,0.7);
    --astro-text: #222;
    --btn-bg: #ff6b6b;
    --btn-hover: #ee5a24;
    --btn-text: white;
    --modal-bg: white;
    --modal-text: #222;
    --input-bg: #fff;
    --input-border: #ddd;
    --autocomplete-bg: #fff;
    --autocomplete-hover: #f0f8ff;
    --favorite-bg: #4facfe;
    --favorite-hover: #00c6ff;
    --cloud-opacity: 0.7;
    --cloud-shadow: 0 0 25px rgba(255,255,255,0.5);
    --sound-bg: rgba(0,0,0,0.3);
    --sound-btn-color: white;
    --accent-color: #ff6b6b;
}

/* ========== ТЁМНАЯ ТЕМА ========== */
body.theme-dark {
    --text-color: #e2e8f0;
    --card-bg: rgba(30, 41, 59, 0.85);
    --card-text: #e2e8f0;
    --card-shadow: 0 8px 20px rgba(0,0,0,0.4);
    --detail-bg: rgba(30, 41, 59, 0.8);
    --detail-text: #cbd5e1;
    --detail-strong: #f1f5f9;
    --week-card-bg: rgba(30, 41, 59, 0.7);
    --week-card-text: #e2e8f0;
    --astro-bg: rgba(30, 41, 59, 0.7);
    --astro-text: #e2e8f0;
    --btn-bg: #f97316;
    --btn-hover: #ea580c;
    --btn-text: #0f172a;
    --modal-bg: #1e293b;
    --modal-text: #e2e8f0;
    --input-bg: #334155;
    --input-border: #475569;
    --autocomplete-bg: #1e293b;
    --autocomplete-hover: #334155;
    --favorite-bg: #3b82f6;
    --favorite-hover: #2563eb;
    --cloud-opacity: 0.5;
    --cloud-shadow: 0 0 25px rgba(255,255,255,0.2);
    --sound-bg: rgba(0,0,0,0.5);
    --sound-btn-color: #f1f5f9;
    --accent-color: #f97316;
}

/* ========== ОБЩЕЕ ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; transition: background 0.5s, color 0.3s; overflow-x: hidden; min-height: 100vh; color: var(--text-color); background: #4facfe; }
.container { max-width: 900px; margin: 20px auto; padding: 25px 30px; background: var(--card-bg); border-radius: 25px; box-shadow: var(--card-shadow); backdrop-filter: blur(5px); position: relative; z-index: 2; color: var(--card-text); }
.slogan { font-size: 1.2em; color: var(--detail-text); margin-top: 5px; margin-bottom: 20px; }
.main-btn { padding: 10px 20px; background: var(--btn-bg); color: var(--btn-text); border: none; border-radius: 30px; font-size: 1em; cursor: pointer; transition: all 0.3s; box-shadow: 0 5px 15px rgba(255,107,107,0.4); text-decoration: none; display: inline-block; margin-bottom: 8px; }
.main-btn:hover { background: var(--btn-hover); transform: scale(1.05); }

/* ========== ИЗБРАННОЕ ========== */
.favorites { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.city-card { background: var(--favorite-bg); color: white; padding: 10px 20px; border-radius: 20px; cursor: pointer; transition: 0.3s; }
.city-card:hover { background: var(--favorite-hover); transform: translateY(-3px); }

/* ========== МОДАЛЬНОЕ ОКНО ========== */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 100; justify-content: center; align-items: center; }
.modal-content { background: var(--modal-bg); padding: 30px; border-radius: 20px; width: 90%; max-width: 500px; position: relative; animation: modalIn 0.4s ease; color: var(--modal-text); }
@keyframes modalIn { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.close { position: absolute; top: 10px; right: 20px; font-size: 30px; cursor: pointer; }
.search-form input { width: 100%; padding: 12px; margin: 8px 0; border: 1px solid var(--input-border); border-radius: 15px; font-size: 16px; background: var(--input-bg); color: var(--text-color); }
.autocomplete { position: relative; background: var(--autocomplete-bg); border-radius: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); margin-top: 10px; display: none; }
.autocomplete div { padding: 12px; border-bottom: 1px solid var(--input-border); cursor: pointer; color: var(--text-color); }
.autocomplete div:hover { background: var(--autocomplete-hover); }

/* ========== ПРАВАЯ ВЕРХНЯЯ ПАНЕЛЬ ========== */
.top-right-panel { position: fixed; top: 20px; right: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; z-index: 1000; }
.sound-control-fixed { display: flex; align-items: center; gap: 8px; background: var(--sound-bg); backdrop-filter: blur(8px); padding: 6px 12px; border-radius: 30px; }
.sound-control-fixed .sound-btn { background: none; border: none; color: var(--sound-btn-color); font-size: 1.3em; cursor: pointer; transition: transform 0.2s; }
.sound-control-fixed .sound-btn:hover { transform: scale(1.2); }
.sound-control-fixed input[type="range"] { width: 80px; accent-color: var(--accent-color); }
.controls-row { display: flex; align-items: center; gap: 12px; }
.lang-switcher, .theme-switcher { display: flex; gap: 5px; }
.lang-btn, .theme-btn { background: rgba(0,0,0,0.3); backdrop-filter: blur(8px); color: white; padding: 6px 10px; border-radius: 15px; text-decoration: none; font-size: 0.9em; font-weight: bold; transition: background 0.3s; border: none; cursor: pointer; }
.lang-btn.active, .theme-btn.active { background: var(--accent-color); }
.lang-btn:hover, .theme-btn:hover { background: rgba(255,107,107,0.8); }

/* ========== СТРАНИЦА ПОГОДЫ ========== */
.weather-container { text-align: center; }
.weather-container h1, .weather-container h2, .weather-container h3 { text-align: center; }
.back-link { display: inline-block; margin-bottom: 15px; color: var(--text-color); text-decoration: none; font-weight: bold; }

/* ========== ДЕТАЛЬНЫЕ КАРТОЧКИ ========== */
.weather-details { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 20px 0; }
.detail-card { background: var(--detail-bg); padding: 10px 15px; border-radius: 20px; backdrop-filter: blur(5px); min-width: 80px; text-align: center; color: var(--detail-text); font-size: 0.9em; }
.detail-card span { display: block; font-size: 0.8em; color: var(--detail-text); }
.detail-card strong { font-size: 1.3em; color: var(--detail-strong); }

/* ========== ВОСХОД / ЗАКАТ ========== */
.astro-row { display: flex; justify-content: center; gap: 10px; margin-top: 15px; flex-wrap: wrap; }
.astro-item { background: var(--astro-bg); backdrop-filter: blur(5px); border-radius: 15px; padding: 8px 12px; color: var(--astro-text); display: flex; flex-direction: column; align-items: center; min-width: 100px; font-size: 0.9em; }
.astro-item span { color: var(--detail-text); font-size: 0.8em; }
.astro-item strong { color: var(--detail-strong); font-size: 1.1em; }

/* ========== О ПРОЕКТЕ ========== */
.about-section { margin: 20px 0; padding: 15px; background: var(--detail-bg); border-radius: 16px; backdrop-filter: blur(5px); text-align: left; }
.about-section h2 { color: var(--detail-strong); font-size: 1.2em; margin-bottom: 10px; text-align: center; }
.about-section p { color: var(--text-color); line-height: 1.6; margin: 8px 0; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.feature-card { background: var(--card-bg); border-radius: 14px; padding: 14px; text-align: center; backdrop-filter: blur(5px); transition: transform 0.2s; }
.feature-card:hover { transform: translateY(-3px); }
.feature-icon { font-size: 2em; display: block; margin-bottom: 6px; }
.feature-card h3 { font-size: 0.95em; color: var(--detail-strong); margin: 4px 0; }
.feature-card p { font-size: 0.8em; color: var(--detail-text); line-height: 1.4; }
.tech-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.tech-badge { background: var(--btn-bg); color: var(--btn-text); padding: 6px 14px; border-radius: 20px; font-size: 0.85em; font-weight: 600; }

/* ========== АНИМАЦИИ ФОНА ========== */
.background-animation { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; overflow: hidden; transition: background 1.5s ease; }

.weather-Clear .background-animation { background: linear-gradient(180deg, #4facfe 0%, #00f2fe 100%); animation: skyPulse 8s ease-in-out infinite alternate; }
.weather-Clouds .background-animation { background: linear-gradient(180deg, #bdc3c7 0%, #8e9eab 100%); animation: cloudSky 10s ease-in-out infinite alternate; }
.weather-Rain .background-animation, .weather-Drizzle .background-animation { background: linear-gradient(180deg, #2c3e50 0%, #3498db 100%); animation: rainSky 4s ease-in-out infinite alternate; }
.weather-Snow .background-animation { background: linear-gradient(180deg, #e0eaf5 0%, #b3d9ff 100%); animation: snowSky 6s ease-in-out infinite alternate; }
.weather-Thunderstorm .background-animation { background: linear-gradient(180deg, #141e30 0%, #243b55 100%); animation: stormSky 3s ease-in-out infinite alternate; }
.weather-Mist .background-animation, .weather-Fog .background-animation { background: linear-gradient(180deg, #8e9eab 0%, #65737e 100%); animation: fogSky 7s ease-in-out infinite alternate; }

@keyframes skyPulse { 0% { filter: brightness(1); } 100% { filter: brightness(1.1); } }
@keyframes rainSky { 0% { background-position: 0 0; } 100% { background-position: 0 20px; } }
@keyframes snowSky { 0% { filter: brightness(1); } 100% { filter: brightness(1.05); } }
@keyframes stormSky { 0% { filter: brightness(1); } 50% { filter: brightness(1.3); } 100% { filter: brightness(1); } }
@keyframes cloudSky { 0% { background-position: 0 0; } 100% { background-position: 50px 0; } }
@keyframes fogSky { 0% { filter: blur(0px); } 100% { filter: blur(2px); } }

/* Фазы суток */
body.weather-Clear.sunrise .background-animation, body.default-theme.sunrise .background-animation { background: linear-gradient(to bottom, #ff9a76 0%, #fefefe 100%); }
body.weather-Clear.day .background-animation, body.default-theme.day .background-animation { background: linear-gradient(to bottom, #4facfe 0%, #00f2fe 100%); }
body.weather-Clear.sunset .background-animation, body.default-theme.sunset .background-animation { background: linear-gradient(to bottom, #ff7e5f 0%, #feb47b 100%); }
body.weather-Clear.night .background-animation, body.default-theme.night .background-animation { background: linear-gradient(to bottom, #0f172a 0%, #1e293b 100%); }

/* Солнце и луна */
.sun, .moon { position: absolute; width: 100px; height: 100px; transition: opacity 1s ease; left: 10%; top: 5%; }
.sun { background: radial-gradient(circle, #fff7b0 0%, #ffcc00 70%); border-radius: 50%; box-shadow: 0 0 60px #ffcc00, 0 0 120px #ff9900; animation: pulse 4s infinite alternate; }
.moon { border-radius: 50%; background: radial-gradient(circle at 30% 30%, #aaa 6px, transparent 6px), radial-gradient(circle at 60% 40%, #aaa 8px, transparent 8px), radial-gradient(circle at 45% 60%, #aaa 5px, transparent 5px), radial-gradient(circle at 70% 70%, #aaa 7px, transparent 7px), radial-gradient(circle at 25% 70%, #aaa 4px, transparent 4px), radial-gradient(circle at 55% 20%, #999 5px, transparent 5px), #e0e0e0; box-shadow: 0 0 30px rgba(255,255,255,0.6), 0 0 60px rgba(255,255,255,0.3); animation: pulseMoon 4s infinite alternate; }
body:not(.weather-Clear):not(.default-theme) .sun, body:not(.weather-Clear):not(.default-theme) .moon { display: none; }
body.sunrise .sun { opacity: 0.6; } body.day .sun { opacity: 1; } body.sunset .sun { opacity: 0.6; } body.night .sun { opacity: 0; }
body.sunrise .moon { opacity: 0; } body.day .moon { opacity: 0; } body.sunset .moon { opacity: 0.4; } body.night .moon { opacity: 1; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.05); } }
@keyframes pulseMoon { from { transform: scale(1); } to { transform: scale(1.03); } }

/* Дождь */
.rain { position: absolute; width: 100%; height: 100%; background: repeating-linear-gradient(transparent 0px, rgba(255,255,255,0.3) 2px, transparent 4px); animation: rainDrop 0.6s linear infinite; }
@keyframes rainDrop { from { background-position: 0 0; } to { background-position: 20px 100px; } }

/* Снег */
.snow { position: absolute; width: 100%; height: 100%; background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><circle cx="10" cy="10" r="3" fill="white" opacity="0.8"/></svg>') repeat; animation: snowFall 5s linear infinite; opacity: 0.9; }
@keyframes snowFall { from { transform: translateY(-100vh) rotate(0deg); } to { transform: translateY(100vh) rotate(10deg); } }

/* Гроза */
.thunderstorm { position: absolute; width: 100%; height: 100%; background: rgba(0,0,0,0.2); animation: stormFlash 3s infinite; }
.thunderstorm::before { content: ''; position: absolute; top: 5%; left: 50%; width: 4px; height: 70%; background: linear-gradient(to bottom, transparent, #fff 30%, #fff 70%, transparent); box-shadow: 0 0 20px #fff, 0 0 40px #fff; opacity: 0; animation: bolt 3s infinite; transform: translateX(-50%); }
@keyframes stormFlash { 0%, 100% { background: rgba(0,0,0,0.2); } 10% { background: rgba(255,255,255,0.4); } 20% { background: rgba(0,0,0,0.2); } }
@keyframes bolt { 0%, 10%, 20%, 100% { opacity: 0; } 11% { opacity: 1; } 12% { opacity: 0.8; } }

/* Облака */
.cloud { position: absolute; background: white; border-radius: 50%; opacity: var(--cloud-opacity); box-shadow: var(--cloud-shadow); animation: floatCloud linear infinite; }
.cloud::before, .cloud::after { content: ''; position: absolute; background: white; border-radius: 50%; }
.cloud1 { width: 180px; height: 55px; top: 2%; left: -180px; animation-duration: 28s; animation-delay: -10s; }
.cloud2 { width: 140px; height: 45px; top: 8%; left: -140px; animation-duration: 33s; animation-delay: -22s; }
.cloud3 { width: 200px; height: 65px; top: 15%; left: -200px; animation-duration: 30s; animation-delay: -5s; }
.cloud4 { width: 120px; height: 40px; top: 22%; left: -120px; animation-duration: 36s; animation-delay: -18s; }
.cloud5 { width: 250px; height: 70px; top: 30%; left: -250px; animation-duration: 27s; animation-delay: -15s; }
.cloud6 { width: 160px; height: 50px; top: 38%; left: -160px; animation-duration: 31s; animation-delay: -25s; }
.cloud7 { width: 130px; height: 42px; top: 45%; left: -130px; animation-duration: 34s; animation-delay: -8s; }
.cloud8 { width: 220px; height: 68px; top: 55%; left: -220px; animation-duration: 29s; animation-delay: -20s; }
.cloud9 { width: 100px; height: 35px; top: 65%; left: -100px; animation-duration: 38s; animation-delay: -30s; }
.cloud10 { width: 170px; height: 52px; top: 75%; left: -170px; animation-duration: 32s; animation-delay: -12s; }
.cloud11 { width: 190px; height: 58px; top: 85%; left: -190px; animation-duration: 26s; animation-delay: -4s; }
.cloud12 { width: 110px; height: 38px; top: 95%; left: -110px; animation-duration: 40s; animation-delay: -35s; }
.cloud::before { width: 50px; height: 50px; top: -25px; left: 30px; }
.cloud::after { width: 70px; height: 70px; top: -35px; left: 100px; }
@keyframes floatCloud { from { transform: translateX(0); } to { transform: translateX(calc(100vw + 400px)); } }

/* ========== ЛАЙФХАКИ ========== */
.life-hacks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 15px 0; }
.hack-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--detail-bg); backdrop-filter: blur(5px); }
.hack-icon { font-size: 1.5em; min-width: 30px; text-align: center; }
.hack-info { display: flex; flex-direction: column; gap: 2px; }
.hack-title { font-weight: 600; font-size: 0.9em; color: var(--detail-strong); }
.hack-desc { font-size: 0.8em; color: var(--detail-text); }
.hack-good { border-left: 3px solid #4CAF50; }
.hack-ok { border-left: 3px solid #2196F3; }
.hack-warning { border-left: 3px solid #FF9800; }
.hack-bad { border-left: 3px solid #f44336; }

/* ========== АЛЛЕРГИЯ ========== */
.allergy-block { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 10px 0; border-radius: 12px; background: var(--detail-bg); font-size: 0.9em; }
.allergy-icon { font-size: 1.5em; }
.allergy-info strong { color: var(--detail-strong); }
.allergy-info span { color: var(--detail-text); font-size: 0.85em; display: block; }
.allergy-low { border-left: 3px solid #4CAF50; }
.allergy-medium { border-left: 3px solid #FF9800; }
.allergy-high { border-left: 3px solid #f44336; }

/* ========== АЧИВКИ ========== */
.achievements-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; margin-top: 20px; }
.achievement-card { display: flex; align-items: center; gap: 12px; padding: 15px; border-radius: 15px; background: var(--detail-bg); backdrop-filter: blur(5px); }
.achievement-card.locked { opacity: 0.5; filter: grayscale(1); }
.achievement-card.unlocked { border-left: 4px solid #FFD700; background: rgba(255,215,0,0.05); }
.ach-icon { font-size: 2.2em; min-width: 50px; text-align: center; }
.ach-info strong { color: var(--detail-strong); font-size: 0.95em; }
.ach-info p { font-size: 0.8em; color: var(--detail-text); }
.ach-badge { font-size: 1.3em; margin-left: auto; }
.progress-bar { background: var(--detail-bg); border-radius: 10px; height: 10px; margin: 10px 0 20px; overflow: hidden; }
.progress-fill { background: linear-gradient(90deg, #FFD700, #FFA500); height: 100%; border-radius: 10px; transition: width 0.5s; }

/* ========== КОММЕНТАРИИ (КРУПНЫЕ) ========== */
.comments-section { margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--input-border); text-align: left; }
.comments-section h3 { font-size: 1.3em; margin-bottom: 18px; color: var(--detail-strong); }
.comment-form { display: flex; gap: 12px; margin-bottom: 22px; background: var(--detail-bg); padding: 14px; border-radius: 15px; backdrop-filter: blur(5px); }
.comment-form textarea { flex: 1; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--input-border); background: var(--input-bg); color: var(--text-color); resize: vertical; font-family: inherit; font-size: 1em; }
.comment-form textarea:focus { outline: none; border-color: var(--accent-color); }

.comment-item {
    background: var(--detail-bg);
    padding: 16px 18px;
    border-radius: 15px;
    margin-bottom: 14px;
    backdrop-filter: blur(5px);
    border-left: 3px solid var(--accent-color);
}

.comment-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }

.comment-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1em;
    flex-shrink: 0;
}

.comment-username { font-weight: 600; color: var(--detail-strong); font-size: 1em; }
.comment-date { font-size: 0.85em; color: var(--detail-text); margin-left: auto; }

.comment-text {
    margin-top: 8px;
    color: var(--text-color);
    font-size: 1.05em;
    line-height: 1.5;
    word-wrap: break-word;
}

.comment-actions { display: flex; gap: 10px; margin-top: 12px; }

.like-btn, .dislike-btn {
    background: var(--detail-bg);
    border: 1px solid var(--input-border);
    border-radius: 18px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.95em;
    color: var(--text-color);
    transition: all 0.2s;
}

.like-btn:hover { background: #4CAF50; color: white; border-color: #4CAF50; transform: scale(1.05); }
.dislike-btn:hover { background: #f44336; color: white; border-color: #f44336; transform: scale(1.05); }

.no-comments { text-align: center; color: var(--detail-text); padding: 30px; font-style: italic; font-size: 1.1em; opacity: 0.6; }

.reply-form-container { margin-top: 12px; }
.reply-textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-color);
    resize: vertical;
    font-family: inherit;
    font-size: 0.95em;
    box-sizing: border-box;
}
.send-reply-btn, .cancel-reply-btn {
    background: var(--accent-color);
    border: none;
    color: var(--btn-text);
    padding: 8px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
    margin-top: 8px;
}
.send-reply-btn:hover { background: var(--btn-hover); }
.cancel-reply-btn {
    background: rgba(255,255,255,0.15);
    color: var(--text-color);
    margin-left: 8px;
}
.cancel-reply-btn:hover { background: rgba(255,255,255,0.25); }

/* ========== МЕДИА-ЗАПРОСЫ ========== */
@media (max-width: 480px) {
    .weather-grid { grid-template-columns: repeat(2, 1fr); }
    .hacks-grid { grid-template-columns: 1fr; }
    .weather-temp { font-size: 3.5em; }
    .weather-city { font-size: 1.5em; }
    .weather-dashboard { padding: 60px 15px 30px; }
}

/* ========== ДАШБОРД ========== */
.weather-dashboard {
    position: relative; z-index: 2;
    max-width: 600px; margin: 0 auto; padding: 80px 20px 40px;
    display: flex; flex-direction: column; gap: 20px;
}

/* ========== ХЕРО-БЛОК ========== */
.weather-hero { text-align: center; margin-bottom: 10px; animation: fadeInUp 0.8s ease; }
.weather-city { font-size: 2em; font-weight: 600; margin-bottom: 5px; }
.weather-main-icon { margin: 10px 0; animation: floatIcon 3s ease-in-out infinite; }
@keyframes floatIcon { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
.weather-temp { font-size: 5em; font-weight: 200; line-height: 1; text-shadow: 0 0 30px rgba(255,255,255,0.3); }
.weather-desc { font-size: 1.3em; text-transform: capitalize; margin-top: 5px; }
.weather-feels { font-size: 1em; opacity: 0.7; margin-top: -5px; }

/* ========== СТЕКЛЯННЫЕ КАРТОЧКИ ========== */
.glass-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.15);
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none; color: #fff;
    animation: fadeInUp 0.6s ease;
}
.glass-card:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.4);
}
.card-label { font-size: 0.75em; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.05em; }
.card-value { font-size: 1.2em; font-weight: 600; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== СЕТКИ ========== */
.weather-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hacks-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.forecast-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; -webkit-overflow-scrolling: touch; }
.forecast-day, .forecast-hour { min-width: 75px; flex-shrink: 0; }
.forecast-date { font-size: 0.8em; opacity: 0.7; }
.forecast-temps { display: flex; gap: 6px; font-weight: 600; }
.forecast-temps .max { color: #ff6b6b; }
.forecast-temps .min { color: #4facfe; }

/* ========== ДЕЙСТВИЯ ========== */
.action-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.action-btn { flex: 1; min-width: 100px; cursor: pointer; text-align: center; flex-direction: row; justify-content: center; }

/* ========== СПИННЕР ========== */
.loading-spinner { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; z-index: 9999; color: var(--text-color); }
.spinner { width: 48px; height: 48px; border: 5px solid rgba(255,255,255,0.3); border-top: 5px solid var(--accent-color); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== ТОСТ ========== */
.toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(6px); color: #fff; padding: 12px 24px; border-radius: 30px; font-size: 1em; font-weight: 500; box-shadow: 0 4px 15px rgba(0,0,0,0.3); pointer-events: auto; animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards; max-width: 80vw; text-align: center; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-20px); } }

/* Фон для страниц без погоды */
body.default-theme { background: #1a1a2e; }

/* ========== ВИДЖЕТ ========== */
.weather-widget {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    padding: 16px 20px;
    min-width: 200px;
    text-align: center;
    box-shadow: var(--card-shadow);
    color: var(--card-text);
    transition: all 0.3s ease;
}
.weather-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.widget-temp { font-size: 32px; font-weight: 700; color: var(--detail-strong); }
.widget-desc { font-size: 14px; color: var(--detail-text); text-transform: capitalize; }
.widget-city { font-size: 16px; font-weight: 600; color: var(--detail-strong); margin-top: 4px; }

/* ===== БАННЕР УВЕДОМЛЕНИЙ ===== */
#notification-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99999;
    background: var(--card-bg, #1a1a2e);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    padding: 20px 28px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    text-align: center;
    display: none;
    color: var(--text-color, #fff);
}
#notification-banner.show { display: block; animation: bannerFadeIn 0.3s ease; }
#notification-banner h3 { font-size: 1.1em; margin-bottom: 6px; color: var(--text-color, #fff); }
#notification-banner p { font-size: 0.85em; margin-bottom: 14px; opacity: 0.85; line-height: 1.5; color: var(--text-color, #fff); }
#notification-banner .banner-buttons { display: flex; gap: 10px; justify-content: center; }
#notification-banner .banner-buttons button { padding: 8px 24px; border: none; border-radius: 30px; font-size: 0.9em; font-weight: 600; cursor: pointer; transition: all 0.3s ease; }
#notification-banner .banner-yes { background: var(--btn-bg, #4facfe); color: var(--btn-text, #fff); }
#notification-banner .banner-yes:hover { background: var(--btn-hover, #3d8fd9); transform: scale(1.05); }
#notification-banner .banner-no { background: rgba(255,255,255,0.1); color: var(--text-color, #fff); border: 1px solid rgba(255,255,255,0.2); }
#notification-banner .banner-no:hover { background: rgba(255,255,255,0.2); }

/* ===== КУКИ-БАННЕР ===== */
#cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99998;
    background: var(--card-bg, #1a1a2e);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 12px 18px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    display: none;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    color: var(--text-color, #fff);
}
#cookie-banner.show { display: flex; animation: cookieFadeIn 0.3s ease; }
#cookie-banner p { flex: 1; font-size: 0.8em; margin: 0; min-width: 120px; color: var(--text-color, #fff); line-height: 1.4; }
#cookie-banner .cookie-buttons { display: flex; gap: 8px; }
#cookie-banner .cookie-buttons button { padding: 6px 16px; border: none; border-radius: 20px; font-size: 0.8em; font-weight: 600; cursor: pointer; transition: all 0.3s ease; white-space: nowrap; }
#cookie-banner .cookie-accept { background: var(--btn-bg, #4facfe); color: var(--btn-text, #fff); }
#cookie-banner .cookie-accept:hover { background: var(--btn-hover, #3d8fd9); transform: scale(1.05); }
#cookie-banner .cookie-decline { background: rgba(255,255,255,0.1); color: var(--text-color, #fff); border: 1px solid rgba(255,255,255,0.2); }
#cookie-banner .cookie-decline:hover { background: rgba(255,255,255,0.2); }

/* ===== АНИМАЦИИ БАННЕРОВ ===== */
@keyframes bannerFadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes cookieFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== ИКОНКА ТЕМЫ ===== */
#theme-icon { transition: all 0.3s ease; }

/* ========== КРАСИВАЯ ПАНЕЛЬ (ЗВУК + ЯЗЫК + ТЕМА) ========== */
.top-right-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.panel-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 40px;
    padding: 6px 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.panel-sound {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.panel-sound .sound-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2em;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.panel-sound .sound-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.15);
}

.panel-sound input[type="range"] {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.panel-sound input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.panel-sound input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.panel-lang {
    display: flex;
    gap: 4px;
    padding-right: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.panel-lang .lang-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 10px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.panel-lang .lang-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.panel-lang .lang-btn.active {
    background: var(--accent-color);
    color: #fff;
}

.panel-theme .theme-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2em;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.panel-theme .theme-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.15);
}

.panel-user {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 40px;
    padding: 6px 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.panel-user .user-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.panel-user .user-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

@media (max-width: 600px) {
    .top-right-panel {
        top: 10px;
        right: 10px;
        gap: 6px;
    }
    .panel-box {
        padding: 4px 8px;
        gap: 8px;
    }
    .panel-sound {
        padding-right: 8px;
        gap: 4px;
    }
    .panel-sound input[type="range"] {
        width: 50px;
    }
    .panel-lang {
        padding-right: 8px;
    }
    .panel-lang .lang-btn {
        padding: 4px 6px;
        font-size: 0.75em;
    }
    .panel-user .user-btn {
        font-size: 0.8em;
        padding: 3px 6px;
    }
}

/* ========== АДАПТИВ: ЛОГИН / РЕГИСТРАЦИЯ / АЧИВКИ ========== */
@media (max-width: 768px) {

    /* --- ФОРМЫ ЛОГИНА И РЕГИСТРАЦИИ --- */
    .auth-container,
    .login-container,
    .register-container,
    .form-container {
        max-width: 100% !important;
        margin: 80px 12px 20px !important;
        padding: 24px 20px !important;
        border-radius: 18px !important;
    }

    .auth-container h2,
    .login-container h2,
    .register-container h2,
    .form-container h2 {
        font-size: 1.5em !important;
        margin-bottom: 20px !important;
    }

    .auth-container input,
    .login-container input,
    .register-container input,
    .form-container input {
        font-size: 16px !important; /* 16px — чтобы iOS не зумил */
        padding: 14px 16px !important;
        margin-bottom: 12px !important;
    }

    .auth-container button,
    .login-container button,
    .register-container button,
    .form-container button,
    .auth-btn {
        width: 100% !important;
        padding: 14px !important;
        font-size: 1em !important;
        margin-top: 8px !important;
    }

    .auth-container .auth-links,
    .login-container .links,
    .register-container .links {
        font-size: 0.9em !important;
        text-align: center !important;
    }

    /* --- СТРАНИЦА АЧИВОК --- */
    .container .achievements-grid,
    .achievements-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 0 !important;
    }

    .achievement-card {
        padding: 14px !important;
        gap: 12px !important;
    }

    .achievement-card .ach-icon,
    .ach-icon {
        font-size: 2em !important;
        min-width: 44px !important;
    }

    .ach-info strong {
        font-size: 0.95em !important;
    }

    .ach-info p {
        font-size: 0.8em !important;
        line-height: 1.4 !important;
    }

    .ach-badge {
        font-size: 1.1em !important;
    }

    /* Заголовок и счётчик ачивок */
    .container h1 {
        font-size: 1.4em !important;
        text-align: center;
    }

    #ach-count {
        font-size: 0.85em !important;
        text-align: center;
    }

    /* Прогресс-бар */
    .progress-bar {
        height: 8px !important;
        margin: 12px 0 !important;
    }

    /* Кнопка "Назад" */
    .back-link {
        font-size: 0.9em !important;
        margin-bottom: 12px !important;
    }

    /* --- ОБЩИЕ КОНТЕЙНЕРЫ СТРАНИЦ --- */
    .container {
        margin: 70px 8px 20px !important;
        padding: 18px 14px !important;
    }

    /* Убираем горизонтальный скролл */
    body {
        overflow-x: hidden !important;
    }

    /* --- ПАНЕЛЬ СВЕРХУ (ещё раз для страниц логина) --- */
    .top-right-panel {
        top: 8px !important;
        right: 8px !important;
    }

    .panel-box {
        padding: 4px 8px !important;
    }

    .panel-lang .lang-btn {
        padding: 3px 6px !important;
        font-size: 0.7em !important;
    }
}

/* ========== ОЧЕНЬ УЗКИЕ ЭКРАНЫ (iPhone SE) ========== */
@media (max-width: 380px) {
    .auth-container,
    .login-container,
    .register-container {
        padding: 18px 14px !important;
        margin: 70px 8px 15px !important;
    }

    .achievement-card {
        padding: 12px !important;
    }

    .ach-icon {
        font-size: 1.8em !important;
        min-width: 38px !important;
    }
}
.uv-safe { background: rgba(76, 175, 80, 0.2) !important; border: 1px solid #4CAF50; }
.uv-warning { background: rgba(255, 152, 0, 0.2) !important; border: 1px solid #FF9800; }
.uv-danger { background: rgba(244, 67, 54, 0.2) !important; border: 1px solid #F44336; }
/* =========================================
   МОБИЛЬНАЯ ОПТИМИЗАЦИЯ (для экранов до 480px)
   ========================================= */
@media (max-width: 480px) {
    /* Уменьшаем отступы контейнера, чтобы было больше места */
    .container {
        margin: 10px auto;
        padding: 15px;
        border-radius: 15px;
    }

    /* Увеличиваем читаемость заголовков */
    .weather-city { font-size: 1.8em; }
    .weather-temp { font-size: 4em; }
    .weather-desc { font-size: 1.1em; }

    /* Делаем сетки карточек в 2 колонки вместо 3 */
    .weather-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    /* Уменьшаем размер иконок внутри карточек */
    .glass-card span[style*="font-size:1.8em"] {
        font-size: 1.5em !important;
    }
    .card-value { font-size: 1em; }
    .card-label { font-size: 0.7em; }

    /* Делаем карточки лайфхаков и прогноза на всю ширину */
    .hacks-grid {
        grid-template-columns: 1fr; /* В одну колонку */
    }
    .forecast-scroll {
        gap: 8px;
        padding-bottom: 15px;
    }

    /* Настраиваем панель управления (звук/язык/тема) под мобилку */
    .top-right-panel {
        top: 10px;
        right: 10px;
        gap: 8px;
    }
    .panel-box {
        padding: 5px 10px;
        gap: 10px;
    }

    /* Делаем комментарии удобнее */
    .comment-form {
        flex-direction: column; /* Текстовое поле на всю ширину, кнопка снизу */
    }
    .comment-form button {
        width: 100%;
        margin-top: 8px;
    }
}