/* =================================================================== */
/* --- Тема Synthwave "Outrun Sunset" --- v2.0 FINAL --- */
/* =================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');

/* --- 1. Анимации и ключевые кадры --- */

@keyframes synthwave-grid-perspective {
    from { transform: perspective(300px) rotateX(70deg) translateY(200px); }
    to { transform: perspective(300px) rotateX(70deg) translateY(300px); }
}

@keyframes synthwave-aurora {
    0%   { opacity: 0.2; transform: scale(1.0); }
    50%  { opacity: 0.5; transform: scale(1.1); }
    100% { opacity: 0.2; transform: scale(1.0); }
}

@keyframes synthwave-text-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow:
            0 0 5px var(--accent-secondary),
            0 0 10px var(--accent-secondary),
            0 0 20px var(--accent-secondary),
            0 0 40px var(--accent-color),
            0 0 70px var(--accent-color);
        opacity: 1;
    }
    20%, 24%, 55% { opacity: 0.5; text-shadow: none; }
}

@keyframes synthwave-scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

@keyframes synthwave-slideIn {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* --- 2. Переменные для ТЕМНОЙ темы (Outrun Sunset) --- */
body.theme-synthwave:not(.gsearch-light-theme) {
    --sw-bg: #0d0221;
    --sw-surface: rgba(26, 13, 51, 0.6);
    --sw-text: #f0f0f0;
    --sw-text-secondary: #a39fc9;
    --sw-accent-primary: #ff00ff;   /* Magenta */
    --sw-accent-secondary: #00ffff; /* Cyan */
    --sw-accent-tertiary: #ffff00; /* Yellow */
    --sw-border: #ff00ff;
    --sw-grid: rgba(0, 255, 255, 0.2);
    --sw-glow: rgba(255, 0, 255, 0.5);
}

/* --- 3. Переменные для СВЕТЛОЙ темы (Retro Daylight) --- */
body.theme-synthwave.gsearch-light-theme {
    --sw-bg: #f5f0ff;
    --sw-surface: rgba(255, 255, 255, 0.7);
    --sw-text: #2d1b69;
    --sw-text-secondary: #6b46c1;
    --sw-accent-primary: #8b5cf6;   /* Purple */
    --sw-accent-secondary: #ec4899; /* Pink */
    --sw-accent-tertiary: #f59e0b; /* Orange */
    --sw-border: #8b5cf6;
    --sw-grid: rgba(139, 92, 246, 0.2);
    --sw-glow: rgba(139, 92, 246, 0.4);
}

/* --- 4. Применение общих стилей --- */

body.theme-synthwave {
    background-color: var(--sw-bg);
    color: var(--sw-text);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    overflow-x: hidden;
    position: relative;
}

/* Анимированный фон с сеткой в перспективе */
body.theme-synthwave::before {
    content: '';
    position: fixed;
    top: 50%; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    background-image:
        linear-gradient(to right, var(--sw-grid) 1px, transparent 1px),
        linear-gradient(to bottom, var(--sw-grid) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
    transform-origin: top center;
    animation: synthwave-grid-perspective 5s linear infinite;
}
/* Анимированный фон "Аврора" */
body.theme-synthwave::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at 70% 80%, var(--sw-accent-primary), transparent 50%),
                radial-gradient(ellipse at 30% 20%, var(--sw-accent-secondary), transparent 50%);
    z-index: -3;
    animation: synthwave-aurora 10s ease-in-out infinite alternate;
}

/* Голографические блоки */
.theme-synthwave .gsearch-result-item,
.theme-synthwave .gsearch-ai-box,
.theme-synthwave .gsearch-info-panel,
.theme-synthwave .calculator-widget,
.theme-synthwave .weather-widget {
    background: var(--sw-surface);
    border: 1px solid var(--sw-border);
    border-radius: 10px !important;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 20px var(--sw-glow);
    position: relative;
    overflow: hidden;
    animation: synthwave-slideIn 0.5s ease-out;
    padding: 15px;
}

/* Эффект сканирующей линии */
.theme-synthwave .gsearch-result-item::after,
.theme-synthwave .gsearch-ai-box::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 255, 255, 0.1) 49%, var(--sw-accent-secondary) 50%, rgba(0, 255, 255, 0.1) 51%, transparent 100%);
    opacity: 0.5;
    animation: synthwave-scanline 8s linear infinite;
    pointer-events: none;
}

/* Заголовки */
.theme-synthwave .gsearch-result-title a {
    color: var(--sw-accent-secondary) !important;
    text-decoration: none !important;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
    animation: synthwave-text-flicker 5s linear infinite;
}
.theme-synthwave .gsearch-result-title a:hover {
    color: var(--sw-accent-tertiary) !important;
}

/* AI-блок с особым стилем */
.theme-synthwave .gsearch-ai-box {
    border-color: var(--sw-accent-secondary);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.5);
}

/* Пагинация */
.theme-synthwave .gsearch-pagination-link,
.theme-synthwave .gsearch-pagination-current {
    background: transparent !important;
    color: var(--sw-accent-primary) !important;
    border: 1px solid var(--sw-accent-primary) !important;
    border-radius: 4px !important;
    padding: 8px 16px;
    font-family: 'Orbitron', sans-serif;
    text-shadow: 0 0 10px var(--sw-glow);
    transition: all 0.3s ease;
}
.theme-synthwave .gsearch-pagination-link:hover {
    background: var(--sw-accent-primary) !important;
    color: var(--sw-bg) !important;
    box-shadow: 0 0 20px var(--sw-accent-primary);
    transform: translateY(-2px);
}
.theme-synthwave .gsearch-pagination-current {
    background: var(--sw-accent-primary) !important;
    color: var(--sw-bg) !important;
    box-shadow: 0 0 20px var(--sw-accent-primary);
}

/* Шапка */
.theme-synthwave .gsearch-header-container {
    background: rgba(13, 2, 33, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--sw-border);
}
body.theme-synthwave.gsearch-light-theme .gsearch-header-container {
    background: rgba(245, 240, 255, 0.8);
}

/* Поле ввода */
.theme-synthwave .gsearch-header-input {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--sw-border);
    color: var(--sw-text);
    border-radius: 4px !important;
}
body.theme-synthwave.gsearch-light-theme .gsearch-header-input {
    background: rgba(255,255,255,0.5);
}

/* Скроллбар */
.theme-synthwave ::-webkit-scrollbar { width: 12px; }
.theme-synthwave ::-webkit-scrollbar-track { background: var(--sw-bg); }
.theme-synthwave ::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--sw-accent-primary), var(--sw-accent-secondary));
    border-radius: 6px;
    border: 2px solid var(--sw-bg);
}