/* ================= CSS Переменные (Неоморфизм) ================= */
:root {
    --base-color: #F0F3F5;
    --base-color-depressed: #E6E9EC;
    --text-color: #333;
    --text-color-secondary: #555;
    --shadow-light: #FFFFFF;
    --shadow-dark: #B8C0C6;
    --accent-color: #007AFF;
}

/* ================= Базовые настройки и сброс ================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--base-color);
    transition: background-color 0.2s ease-in-out;
}
a { text-decoration: none; color: var(--text-color-secondary); }

/* ================= Типографика ================= */
h1, h2, h3 { font-family: 'Lato', sans-serif; margin-bottom: 1rem; font-weight: 700; }
h1 { font-size: 1.8rem; line-height: 1.3; }
h2 { font-size: 1.3rem; line-height: 1.4; }
h3 { font-size: 1.1rem; }

/* ================= Структура макета ================= */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ================= Элементы Форм ================= */
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label { font-weight: bold; color: var(--text-color-secondary); font-size: 0.9rem; margin-left: 0.5rem; }
input[type="text"], input[type="number"], textarea, select {
    width: 100%; font-family: inherit; font-size: 1rem; padding: 0.8rem 1rem;
    background-color: var(--base-color-depressed); border: none; border-radius: 12px;
    color: var(--text-color); transition: all 0.15s ease-in-out;
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}
textarea { min-height: 150px; resize: vertical; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
input[type="text"]:focus, input[type="number"]:focus, textarea:focus, select:focus {
    outline: none; background-color: var(--base-color);
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
}

/* ================= Кнопки (.btn) ================= */
.btn {
    display: inline-block; padding: 0.8rem 1.5rem; font-family: 'Lato', sans-serif;
    font-size: 1rem; font-weight: 700; text-align: center; color: var(--text-color-secondary);
    background-color: var(--base-color); border: none; border-radius: 12px; cursor: pointer;
    text-decoration: none; transition: all 0.15s ease-in-out;
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
}
.btn:active {
    color: var(--accent-color); background-color: var(--base-color-depressed);
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}
.btn-primary { color: var(--accent-color); font-weight: bold; }

/* ================= Шапка (Header) ================= */
.main-header { background-color: var(--base-color); color: var(--text-color); padding: 0.8rem 0; }
.main-header .container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-family: 'Lato', sans-serif; font-size: 1.5rem; font-weight: bold; color: var(--text-color); }
.main-nav { position: relative; display: flex; align-items: center; } /* Только кнопка меню */

/* ================= Главное содержимое (Main) ================= */
main { padding: 2rem 0; flex-grow: 1; }
.hero-section { text-align: center; padding: 1rem 0; margin-bottom: 3rem; }
.hero-section p { font-size: 1.1rem; }

/* ================= Карточки Инструментов ================= */
.tool-category { margin-bottom: 3rem; }
.tool-category h2 { padding-bottom: 0.5rem; border-bottom: 1px solid var(--shadow-dark); margin-bottom: 1rem; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.tool-card {
    background-color: var(--base-color); border-radius: 12px; padding: 0.8rem 1.2rem;
    transition: all 0.15s ease-in-out; display: flex; align-items: center; gap: 1rem; text-align: left;
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
}
.tool-card:active {
    transform: scale(0.98);
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}
.tool-card h3 { color: var(--text-color); margin-bottom: 0.25rem; }
.tool-card p { font-size: 0.9rem; color: var(--text-color-secondary); line-height: 1.4; }
.tool-card-content { flex-grow: 1; }
.tool-card-icon {
    width: 50px; height: 50px; object-fit: contain; background-color: var(--base-color-depressed);
    padding: 8px; border-radius: 8px;
    box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
}

/* ================= Подвал (Footer) ================= */
.main-footer { background-color: var(--base-color); color: var(--text-color-secondary); text-align: center; margin-top: 1rem; }
.footer-container { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.2rem; padding: 1rem 0; }
.footer-contact, .footer-social, .footer-copyright, .footer-about { display: flex; flex-direction: column; gap: 0.3rem; } /* Добавлен .footer-about */
.footer-social { order: 1; }
.footer-contact { order: 2; }
.footer-about { order: 3; }    /* Ссылка "О проекте" будет перед копирайтом */
.footer-copyright { order: 4; } /* Копирайт последним */

.footer-contact p, .footer-social p { font-size: 0.85rem; margin: 0; }
.footer-email, .footer-copyright p, .footer-link { font-size: 0.8rem; color: var(--text-color-secondary); margin: 0; } /* Добавлен .footer-link */
.footer-email:hover, .footer-link:hover { opacity: 0.8; text-decoration: none; } /* Добавлен :hover для .footer-link */
.social-icons { display: flex; justify-content: center; gap: 0.5rem; }
.social-icons a svg { width: 22px; height: 22px; fill: var(--text-color-secondary); transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out; }
.social-icons a:hover svg { opacity: 0.8; transform: scale(1.1); }

/* --- НАЧАЛО: Стили для новой ссылки в футере --- */
.footer-link {
    transition: opacity 0.2s ease; /* Плавность при наведении */
}
/* --- КОНЕЦ: Стили для новой ссылки в футере --- */

@media (min-width: 768px) {
    .footer-container { flex-direction: row; justify-content: space-between; align-items: center; padding: 1.2rem 0; }
    .footer-social, .footer-contact, .footer-copyright, .footer-about { order: 0; text-align: left; } /* Убираем специфичный порядок для десктопа */
    .footer-copyright { text-align: center; }
    .footer-about { text-align: center; } /* Центрируем ссылку "О проекте" */
    .footer-social { text-align: right; align-items: flex-end; }
}

/* ================= Выпадающее Меню ================= */
.dropdown-menu {
    display: none; 
    position: absolute; 
    top: 100%; 
    right: 0; 
    margin-top: 10px;
    background-color: var(--base-color); 
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    border-radius: 12px; 
    padding: 0.5rem; 
    width: 280px; 
    z-index: 100; 
    opacity: 0;
    transform: translateY(10px); 
    transition: opacity 0.2s ease, transform 0.2s ease;

    /* === ДОБАВЬ ЭТИ СТРОКИ === */
    max-height: 70vh; /* Ограничиваем высоту до 70% высоты экрана */
    overflow-y: auto; /* Добавляем верт. скроллбар ТОЛЬКО если нужно */
    /* ======================= */
}
.dropdown-menu.show { display: block; opacity: 1; transform: translateY(0); }
.dropdown-category-title { font-family: 'Roboto', sans-serif; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--text-color); padding: 0.8rem 0.5rem 0.2rem; margin: 0; }
.dropdown-menu a { font-family: 'Lato', sans-serif; font-weight: 400; display: block; padding: 0.4rem 0.5rem; color: var(--text-color-secondary); border-radius: 8px; font-size: 0.9rem; transition: all 0.15s ease; }
.dropdown-menu a:hover { background-color: var(--base-color-depressed); color: var(--text-color); }

/* --- Стили для Переключателя Темы ВНУТРИ Меню --- */
.dropdown-theme-switcher {
    padding: 0.4rem 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--base-color-depressed);
}
.dropdown-theme-switcher .theme-switcher-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    cursor: pointer;
    padding: 0;
}
.dropdown-theme-switcher .theme-switcher-text {
    font-family: 'Lato', sans-serif;
    font-weight: bold;
    color: var(--text-color-secondary);
    font-size: 0.9rem;
    padding-left: 0;
    line-height: normal;
    margin-right: 1rem;
}
.dropdown-theme-switcher .theme-switch-wrapper {
    position: relative;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
    margin-left: auto;
}
.dropdown-theme-switcher input[type="checkbox"] {
    opacity: 0; width: 0; height: 0; position: absolute;
}
.dropdown-theme-switcher .theme-switch-visual::before { /* Фон */
    content: ""; position: absolute; left: 0; top: 0;
    width: 38px; height: 22px; border-radius: 11px;
    background-color: var(--base-color-depressed);
    transition: background-color 0.2s ease-in-out;
    box-shadow: inset 1px 1px 2px var(--shadow-dark), inset -1px -1px 2px var(--shadow-light);
}
.dropdown-theme-switcher .theme-switch-visual::after { /* Кружок */
    content: ""; position: absolute; left: 3px; top: 3px;
    width: 16px; height: 16px; border-radius: 50%;
    background-color: #FFDA63; /* Солнце */
    box-shadow: 1px 1px 2px var(--shadow-dark), -1px -1px 2px var(--shadow-light);
    transition: transform 0.2s ease-in-out, background-color 0.2s ease, box-shadow 0.2s ease;
}
/* Включенное состояние (Луна) */
.dropdown-theme-switcher input[type="checkbox"]:checked + .theme-switch-visual::before {
    background-color: var(--accent-color);
}
.dropdown-theme-switcher input[type="checkbox"]:checked + .theme-switch-visual::after {
    transform: translateX(16px);
    background-color: var(--base-color);
    box-shadow: inset 3px -1px 0 0px #FFF, /* Луна */
               1px 1px 2px var(--shadow-dark), -1px -1px 2px var(--shadow-light);
}


/* ================= Страница Инструмента (Общие) ================= */
.breadcrumbs { margin-bottom: 1.5rem; font-size: 0.9rem; color: var(--text-color-secondary); }

/* Убираем стили для рекламных баннеров отсюда */
/*.tool-content-single-column, .ad-banner { ... }*/

/* Стиль только для .tool-content-single-column */
.tool-content-single-column {
    max-width: 700px; margin: 2rem auto; background-color: var(--base-color-depressed);
    padding: 1rem; border-radius: 12px; text-align: center; color: var(--text-color-secondary);
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

/* Стили для "невидимых" рекламных баннеров */
.ad-banner {
    max-width: 700px;
    margin: 2rem auto;
    border-radius: 12px;
    text-align: center;
    padding: 0;
    color: transparent;
    background-color: transparent;
    box-shadow: none;
}
.ad-banner-top { min-height: 90px; }
.ad-banner-bottom { min-height: 250px; }

.tool-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 1.5rem; }

/* ================= Cookie-баннер ================= */
#cookie-consent-banner {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); max-width: 500px;
    width: calc(100% - 40px); background-color: var(--base-color); color: var(--text-color);
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
    border-radius: 12px; z-index: 1000; padding: 1rem 1.5rem; display: flex; flex-direction: row;
    justify-content: space-between; align-items: center; gap: 1.5rem; opacity: 1; transition: opacity 0.5s ease;
}
#cookie-consent-banner p { margin: 0; font-size: 0.8rem; line-height: 1.4; text-align: left; }
#cookie-consent-banner button { /* Использует .btn */ }

/* ================= Переключатели (Neumorphism) - ОБЩИЕ ================= */
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-label input[type="checkbox"] { opacity: 0; width: 0; height: 0; position: absolute; }
.checkbox-label span:not(.theme-switcher-text):not(.tooltip):not(.theme-switch-visual) { /* Текст */
    position: relative; display: inline-block; padding-left: 50px; line-height: 26px;
    cursor: pointer; color: var(--text-color-secondary);
}
.checkbox-label span:not(.theme-switcher-text):not(.tooltip):not(.theme-switch-visual)::before { /* Фон */
    content: ""; position: absolute; left: 0; top: 0; width: 44px; height: 26px; border-radius: 13px;
    background-color: var(--base-color-depressed); transition: background-color 0.2s ease-in-out;
    box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
}
.checkbox-label span:not(.theme-switcher-text):not(.tooltip):not(.theme-switch-visual)::after { /* Кружок */
    content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%;
    background-color: var(--base-color);
    box-shadow: 1px 1px 3px var(--shadow-dark), -1px -1px 3px var(--shadow-light);
    transition: transform 0.2s ease-in-out, background-color 0.2s ease, box-shadow 0.2s ease;
}
/* Включенное состояние */
.checkbox-label input[type="checkbox"]:checked + span:not(.theme-switcher-text):not(.tooltip):not(.theme-switch-visual) { color: var(--accent-color); }
.checkbox-label input[type="checkbox"]:checked + span:not(.theme-switcher-text):not(.tooltip):not(.theme-switch-visual)::before { background-color: var(--accent-color); }
.checkbox-label input[type="checkbox"]:checked + span:not(.theme-switcher-text):not(.tooltip):not(.theme-switch-visual)::after {
    transform: translateX(18px);
    background-color: #fff; /* Белый кружок в светлой теме */
}


/* ================= ТЕМНАЯ ТЕМА (body.dark-mode) ================= */
body.dark-mode {
    --base-color: #2E3236;
    --base-color-depressed: #262A2E;
    --text-color: #EAEAEA;
    --text-color-secondary: #AAAAAA;
    --shadow-light: #3A4045;
    --shadow-dark: #22262A;
    --accent-color: #0A84FF;

    .social-icons a svg { fill: var(--text-color-secondary); }

    /* Возвращаем стили для Луны в темной теме */
    .dropdown-theme-switcher input[type="checkbox"]:checked + .theme-switch-visual::after {
        background-color: var(--base-color); /* Фон кружка темный */
        box-shadow: inset 3px -1px 0 0px #FFF, /* Луна белая */
                   1px 1px 2px var(--shadow-dark), -1px -1px 2px var(--shadow-light);
    }

    /* Стиль для кружка ОБЫЧНЫХ переключателей в темной теме */
     .checkbox-label input[type="checkbox"]:checked + span:not(.theme-switcher-text):not(.tooltip):not(.theme-switch-visual)::after {
        background-color: var(--base-color); /* Кружок темный */
        box-shadow: 1px 1px 2px var(--shadow-dark), -1px -1px 2px var(--shadow-light);
    }

    /* Стили для ПОДСКАЗКИ (?) в темной теме */
    .tooltip::before {
        background-color: var(--base-color);
        color: var(--text-color);
        box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
    }
}
/* === НОВОГОДНЯЯ ШАПКА НА ЛОГО === */
.logo {
    position: relative; /* Важно: чтобы шапка "прилипла" именно к логотипу */
    display: inline-block; /* Чтобы блок логотипа не растягивался на всю ширину */
    z-index: 10; /* Чтобы лого было выше других элементов */
}

.logo::after {
    content: '';
    /* Путь к твоей картинке */
    background-image: url('/assets/images/santa-hat.png'); 
    
    background-size: contain;
    background-repeat: no-repeat;
    position: absolute;
    
    width: 25px;   /* Ширина шапки */
    height: 25px;  /* Высота шапки */
    top: -2px;    /* Поднимаем вверх (минус - это вверх) */
    left: -9px;   /* Сдвигаем влево, чтобы села на букву R */
    
    transform: rotate(-20deg); /* Наклон влево, чтобы сидела залихватски */
    pointer-events: none; /* Чтобы шапка не мешала кликать по логотипу */
    z-index: 11;
}