/* style.css */
/* === АНИМАЦИИ === */
@keyframes gradient-light {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}
@keyframes gradient-dark {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fall {
    to { transform: translateY(100vh); }
}
@keyframes breathing {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.9; }
}
@keyframes animate-gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
@keyframes engravedFlip {
    0%   { transform: translateY(0) rotateX(0); opacity: 1; }
    45%  { transform: translateY(-20px) rotateX(-90deg); opacity: 0.7; }
    55%  { transform: translateY(20px) rotateX(-90deg); opacity: 0.7; }
    100% { transform: translateY(0) rotateX(0); opacity: 1; }
}
@keyframes pulse {
    0% { opacity: 0.2; transform: scale(1); }
    100% { opacity: 0.4; transform: scale(1.1); }
}
@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.animate-float { animation: float 8s ease-in-out infinite; }
.animate-fadeIn { animation: fadeIn 1s ease-out forwards; }

/* === CSS ПЕРЕМЕННЫЕ (Custom Properties) === */
:root {
    --text-primary: #333333;
    --text-secondary: #666666;
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --accent-color: #8B5CF6;
    --accent-gradient: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    --glass-bg: rgba(255, 255, 255, 0.5);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --glass-inset-light: inset 0 1px 8px rgba(255, 255, 255, 0.4);
    --glass-inset-dark: inset 0 -1px 8px rgba(255, 255, 255, 0.2);
}

html.dark {
    --text-primary: #ffffff;
    --text-secondary: #dddddd;
    --bg-primary: #000000;
    --bg-secondary: #1a1a1a;
    --accent-color: #A78BFA;
    --accent-gradient: linear-gradient(135deg, #A78BFA 0%, #8B5CF6 100%);
    --glass-bg: rgba(30, 30, 50, 0.6);
    --glass-border: rgba(200, 160, 255, 0.15);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    --glass-inset-light: inset 0 1px 12px rgba(138, 43, 226, 0.12);
    --glass-inset-dark: inset 0 -1px 12px rgba(100, 80, 255, 0.08);
}

/* === ФОНЫ === */
body {
    transition: background 1.2s ease;
    background: var(--bg-primary);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    color: var(--text-primary);
}

/* Градиенты - более заметные */
.light .bg-theme {
    background: linear-gradient(135deg, #F351B9 0%, #E79EE1 100%);
    background-size: 300% 300%;
    animation: gradient-light 22s ease infinite;
}

.dark .bg-theme {
    background: linear-gradient(135deg, #29153C 0%, #1C191F 100%);
    background-size: 300% 300%;
    animation: gradient-dark 28s ease infinite;
}

/* Неоновые огни для тёмной темы */
.dark .neon-layer {
    position: absolute;
    inset: 0;
    opacity: 0.3;
    background: radial-gradient(circle, rgba(123, 67, 151, 0.5) 0%, transparent 70%);
    animation: pulse 5s infinite alternate;
    pointer-events: none;
    z-index: -4;
}
.dark .neon1 { top: 10%; left: 20%; width: 30%; height: 30%; }
.dark .neon2 { top: 50%; right: 30%; width: 40%; height: 40%; animation-delay: 1s; }
.dark .neon3 { bottom: 20%; left: 50%; width: 25%; height: 25%; animation-delay: 2s; }

/* Анимированные капли дождя для тёмной темы */
.rain-drop {
    position: absolute;
    top: -20px;
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0.3));
    animation: fall 0.5s linear infinite;
    pointer-events: none;
    z-index: -3;
}

/* Солнце и месяц исправлены */
.sun {
    position: absolute;
    top: 30%;
    right: 30%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(255, 150, 0, 0.9) 0%, rgba(255, 200, 0, 0.6) 50%, transparent 70%);
    animation: breathing 8s ease-in-out infinite;
    transition: transform 1.2s ease, opacity 1.2s ease;
    pointer-events: none;
    z-index: -5;
    opacity: 0.8;
    filter: blur(30px);
}

/* Месяц - меньше размытие, лучше видимость */
.moon {
    position: absolute;
    top: 30%;
    left: 30%;
    width: 180px;
    height: 180px;
    background: transparent;
    border-radius: 50%;
    box-shadow: 
        inset -35px 0 0 rgba(255, 255, 255, 0.95),
        0 0 30px rgba(255, 255, 255, 0.6);
    animation: breathing 10s ease-in-out infinite;
    transition: transform 1.2s ease, opacity 1.2s ease;
    pointer-events: none;
    z-index: -5;
    opacity: 0.9;
    filter: blur(5px);
}

.light .sun {
    opacity: 0.8;
    transform: translateY(0);
}
.light .moon {
    opacity: 0;
    transform: translateY(100vh);
}
.dark .sun {
    opacity: 0;
    transform: translateY(100vh);
}
.dark .moon {
    opacity: 0.9;
    transform: translateY(0);
}

/* Дополнительные градиентные слои для большей насыщенности */
.gradient-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -2;
}

.light .gradient-overlay {
    background: radial-gradient(circle at 70% 30%, rgba(255, 81, 185, 0.4) 0%, transparent 50%),
                radial-gradient(circle at 30% 70%, rgba(231, 158, 225, 0.4) 0%, transparent 50%);
}

.dark .gradient-overlay {
    background: radial-gradient(circle at 70% 30%, rgba(41, 21, 60, 0.6) 0%, transparent 50%),
                radial-gradient(circle at 30% 70%, rgba(28, 25, 31, 0.6) 0%, transparent 50%);
}

/* === ЖИДКОЕ СТЕКЛО === */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-radius: 36px;
    border: 1px solid var(--glass-border);
    box-shadow: 
        var(--glass-shadow),
        var(--glass-inset-light),
        var(--glass-inset-dark);
    transition: all 0.6s ease;
    color: var(--text-primary);
}

.glass-card:hover {
    transform: translateY(-6px);
    box-shadow: 
        0 16px 50px rgba(0,0,0,0.15),
        inset 0 1px 12px rgba(255,255,255,0.45),
        inset 0 -1px 12px rgba(255,255,255,0.25);
}

.dark .glass-card:hover {
    box-shadow: 
        0 16px 50px rgba(0,0,0,0.8),
        inset 0 1px 12px rgba(138, 43, 226, 0.2),
        inset 0 -1px 12px rgba(100, 80, 255, 0.15);
}

/* === ЧАСЫ === */
.engraved-time {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 1;
    position: relative;
    white-space: nowrap;
    color: var(--text-primary);
}

.engraved-time span {
    display: inline-block;
    min-width: 0.8em;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.engraved-time span.flip {
    animation: engravedFlip 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Светлая тема */
.light .engraved-time {
    text-shadow: 
        2px 2px 4px rgba(0,0,0,0.15),
        0 0 8px rgba(255,255,255,0.6);
}

/* Тёмная тема - текст светлее */
.dark .engraved-time {
    text-shadow: 
        0 0 12px rgba(138, 43, 226, 0.7),
        0 0 25px rgba(110, 90, 255, 0.4),
        0 2px 6px rgba(0,0,0,0.6);
}

/* === ОБЩИЕ СТИЛИ ТЕКСТА === */
.text-primary {
    color: var(--text-primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

/* Иконки Feather наследуют цвет */
svg.feather {
    stroke: currentColor;
}

/* Логотип */
.logo-square {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(20px) !important;
}

.logo-circle {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%) !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Стили для компонентов */
weather-card, radio-player {
    color: var(--text-primary) !important;
}

/* Кнопки */
.btn-primary {
    background: var(--accent-gradient) !important;
    color: white !important;
}

/* Поле ввода */
.input-field {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* === СТИЛИ ДЛЯ РАДИО ПЛЕЕРА === */

/* Скрываем ползунок громкости по умолчанию */
radio-player .volume-slider {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
    pointer-events: none;
}

/* Показываем ползунок при наведении на весь радио-плеер */
radio-player:hover .volume-slider {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto;
}
/* Добавьте в конец файла перед медиа-запросами */
.search-engine-selector {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.search-engine-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.search-engine-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.search-engine-option input[type="radio"] {
    display: none;
}

.search-engine-option input[type="radio"]:checked + label {
    background: var(--accent-gradient);
    color: white;
    border-color: var(--accent-color);
}

.search-engine-option svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Стили для активного состояния */
.search-engine-option.active {
    background: var(--accent-gradient);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

/* Темная тема для переключателей */
.dark .search-engine-option {
    background: rgba(30, 30, 50, 0.6);
    border-color: rgba(200, 160, 255, 0.15);
}

.dark .search-engine-option:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
/* Стили для полосы громкости */
.volume-slider {
    -webkit-appearance: none;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    margin-top: 8px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.dark .volume-slider {
    background: rgba(255, 255, 255, 0.15);
}

/* Стили для отображения текущего трека */
.track-info {
    max-width: 100%;
    overflow: hidden;
    position: relative;
    margin-bottom: 8px;
}
/* === СТИЛИ ДЛЯ СКРЫВАЮЩЕЙСЯ ПАНЕЛИ ВЫБОРА ПОИСКОВИКА === */

.search-engine-container {
    position: relative;
    width: 100%;
    max-width: 500px; /* Увеличил ширину */
    margin: 0 auto 2rem auto; /* Добавил отступ снизу */
}

.search-engine-panel {
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 200px;
    opacity: 1;
    transform: translateY(0);
    padding: 1rem 0; /* Добавил паддинг для отступов */
}

.search-engine-panel.hidden {
    max-height: 0;
    opacity: 0;
    transform: translateY(-10px);
    margin-bottom: 0;
    padding: 0; /* Убираем паддинг при скрытии */
}

/* Кнопка-стрелка - опускаем ниже */
#searchEngineToggle {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    margin-top: 1rem; /* Опускаем стрелку ниже */
    transform: translateY(0);
}

#searchEngineToggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.dark #searchEngineToggle {
    background: rgba(30, 30, 50, 0.6);
    border-color: rgba(200, 160, 255, 0.15);
}

/* Анимация стрелки */
#searchEngineToggle i {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Кнопки выбора поисковика - обновленные стили */
.search-engine-option {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Увеличил расстояние */
    padding: 0.75rem 1.5rem; /* Увеличил паддинг */
    border-radius: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.4s ease;
    font-size: 0.95rem;
    font-weight: 500;
    min-width: 140px; /* Минимальная ширина */
    justify-content: center;
}

.search-engine-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
}

/* Активное состояние (выбранный поисковик) */
.search-engine-option.active {
    background: var(--accent-gradient) !important;
    color: white !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 2px 17px rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.search-engine-option input[type="radio"] {
    display: none;
}

.search-engine-option svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.3s ease;
}

.search-engine-option:hover svg {
    transform: scale(1.1);
}

/* Темная тема для кнопок */
.dark .search-engine-option {
    background: rgba(30, 30, 50, 0.7);
    border-color: rgba(200, 160, 255, 0.2);
}

.dark .search-engine-option:hover {
    border-color: rgba(167, 139, 250, 0.5);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5);
}

/* Контейнер для кнопок - фиксируем ширину */
.search-engine-panel > div {
    display: flex;
    gap: 1.5rem; /* Увеличил расстояние между кнопками */
    justify-content: center;
    flex-wrap: nowrap;
    width: 100%;
}

/* Плавная анимация для всей панели */
.search-engine-panel {
    will-change: max-height, opacity, transform;
}

/* Адаптивность для маленьких экранов */
@media (max-width: 640px) {
    .search-engine-container {
        max-width: 95%;
    }
    
    .search-engine-panel > div {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .search-engine-option {
        min-width: 200px;
        width: 100%;
        max-width: 250px;
    }
    
    #searchEngineToggle {
        margin-top: 0.5rem;
        width: 36px;
        height: 36px;
    }
}
.track-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    transition: all 0.3s ease;
}

/* При наведении показываем полный текст с прокруткой */
radio-player:hover .track-text {
    animation: marquee 15s linear infinite;
    padding-left: 100%;
}

/* Анимация для бегущей строки при наведении */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Адаптивность */
@media (max-width: 768px) {
    .engraved-time { font-size: 3.5rem; }
    .glass-card { border-radius: 28px; }
    weather-card, radio-player { 
        position: static !important; 
        width: 90% !important; 
        margin: 2rem auto 0 !important;
    }
    .sun, .moon { 
        width: 200px !important;
        height: 200px !important;
    }
    .sun { filter: blur(20px); }
    .moon { filter: blur(3px); }
    
    /* На мобильных показываем ползунок всегда */
    radio-player .volume-slider {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
    
    radio-player:hover .track-text {
        animation: none;
        padding-left: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}