﻿/* --- 1. СБРОС СТИЛЕЙ И ОСНОВА --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

/* --- 2. ПЕРЕМЕННЫЕ ТЕМЫ --- */
:root {
    /* Светлая тема (теперь с вашим фоном) */
    --bg-color: #F8FAFC;
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-inner-bg: #F1F5F9; /* Чуть темнее для инпутов */
    --text-color: #0F172A;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --link-color: #4361EE;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
    --blob-color-1: rgba(67, 97, 238, 0.12);
    --blob-color-2: rgba(60, 201, 240, 0.15);
}

[data-theme="dark"] {
    --bg-color: #0F172A;
    --card-bg: #1E293B;
    --card-inner-bg: #334155; /* Фон инпутов в темной теме */
    --text-color: #F8FAFC;
    --text-muted: #94A3B8;
    --border-color: #334155;
    --link-color: #3CC9F0;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    --blob-opacity: 0.1; /* Уменьшаем яркость пятен в темной теме */
    --blob-color-1: rgba(67, 97, 238, 0.05);
    --blob-color-2: rgba(60, 201, 240, 0.05);
}

/* Глобальные настройки фона для страниц авторизации */
.auth-page-wrapper {
    position: relative;
    min-height: 100vh;
    width: 100%;
    background-color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Важно, чтобы круги не создавали скролл */
}

/* Эффект перелива (Blobs) */
.blob {
    position: absolute;
    width: 800px; /* Увеличили размер для мягкости */
    height: 800px;
    border-radius: 50%;
    filter: blur(140px); /* Мощное размытие */
    z-index: 0;
    pointer-events: none;
}

.blob-1 {
    background: var(--blob-color-1);
    top: -200px;
    right: -100px;
}

.blob-2 {
    background: var(--blob-color-2);
    bottom: -200px;
    left: -100px;
}

/* Настройка для Темной темы */
[data-theme="dark"] .auth-page-wrapper {
    background-color: #0F172A !important;
}

[data-theme="dark"] .auth-blob {
    opacity: 0.1; /* В темной теме делаем пятна тусклее */
}

/* --- 3. ОБЩИЕ СТИЛИ ТЕЛА --- */
body {
    background: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    transition: background 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased; /* Делает шрифт более гладким */
}

main {
    flex: 1 0 auto;
}

/* --- 4. HEADER (ШАПКА) --- */
header {
    width: 100%;
    padding: 0 4% !important;
    height: 85px !important; /* Увеличил до 90px и добавил принудительное применение */
    min-height: 85px !important; /* На всякий случай фиксируем минимальную высоту */
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start; /* Контент начинается слева (логотип) */
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

    /* Логотип */
    header .logo {
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

        header .logo a {
            font-family: 'Playfair Display', serif;
            font-weight: 700;
            font-size: 30px; /* Было 24px */
            font-style: italic;
            color: var(--text-color);
            text-decoration: none;
            transition: color 0.3s;
        }

.logo-img {
    height: 55px; /* Было 42px */
    width: auto;
    margin-right: 15px;
    vertical-align: middle;
}

/* Навигация */
header nav {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-left: 60px;
}

    header nav a {
        color: var(--text-color);
        text-decoration: none;
        font-weight: 600; /* Сделали чуть жирнее */
        font-size: 17px; /* Было 15px */
        transition: all 0.3s ease;
        position: relative;
    }

        header nav a::after {
            content: '';
            position: absolute;
            width: 0;
            height: 2px;
            bottom: -5px;
            left: 0;
            background-color: var(--link-color);
            transition: width 0.3s;
        }

        header nav a:hover::after {
            width: 100%;
        }

        header nav a:hover {
            color: var(--link-color);
        }

/* Кнопка переключения тем */
.theme-toggle {
    background: var(--card-inner-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px 20px; /* Увеличили размер кнопки */
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px; /* Увеличили шрифт */
    font-weight: 600;
    transition: all 0.3s ease;
}

    .theme-toggle i {
        font-size: 18px; /* Иконка луны/солнца стала больше */
    }

    .theme-toggle:hover {
        border-color: var(--link-color);
        background: var(--card-bg);
        transform: scale(1.05); /* Легкое увеличение при наведении */
    }

/* --- 5. КНОПКИ АВТОРИЗАЦИИ --- */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.login-btn {
    color: var(--text-color) !important;
    text-decoration: none;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s ease;
}

    .login-btn:hover {
        color: var(--link-color) !important;
        text-decoration: none !important;
    }

.register-btn {
    background: var(--link-color);
    color: #ffffff !important;
    text-decoration: none;
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

    .register-btn:hover {
        filter: brightness(1.1);
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
        text-decoration: none !important;
    }

/* --- 6. ОСНОВНОЙ КОНТЕНТ (MAIN) --- */
main {
    flex: 1 0 auto;
    width: 100%; /* Теперь main всегда на всю ширину */
    /* Убираем жесткие margin и padding здесь */
}

/* Создаем отдельный класс для страниц, где нужен порядок и узкий контент (текстовые страницы) */
.content-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

h1 {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

/* --- 7. ФУТЕР (MAIN FOOTER) --- */
.main-footer {
    flex-shrink: 0;
    background-color: var(--footer-bg);
    color: var(--text-color);
    padding: 60px 0 30px;
    /*margin-top: 60px;*/
    border-top: 1px solid var(--border-color);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 60px;
}

.footer-section {
    flex: 0 1 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

    .footer-section h4 {
        color: var(--link-color);
        font-size: 1.1rem;
        font-weight: 700;
        margin-bottom: 20px;
        text-transform: uppercase;
        letter-spacing: 0.1em;
    }

    .footer-section p {
        margin-bottom: 12px;
        color: var(--text-color);
        opacity: 0.9; 
        line-height: 1.6;
        font-size: 1rem;
    }

    .footer-section a {
        color: var(--text-color);
        text-decoration: none;
        transition: color 0.3s ease;
        font-weight: 500;
    }

        .footer-section a:hover {
            color: var(--link-color);
        }

/* Социальные сети */
.social-links {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    justify-content: center;
}

    .social-links a {
        font-size: 1.8rem;
        color: var(--text-color);
        transition: all 0.3s ease;
    }

        .social-links a:hover {
            transform: translateY(-5px);
            color: var(--link-color);
        }

.highlight {
    color: #ff4d4d;
    font-weight: 700;
}

.footer-bottom {
    text-align: center;
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 25px 20px 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Утилиты */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1.5rem;
}

/* Адаптивность футера */
@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-section {
        align-items: center;
    }
}
/* --- 8. АДМИН И БИЛЛИНГ ФУТЕРЫ --- */
.admin-footer, .billing-footer {
    background: var(--footer-bg);
    color: var(--text-muted);
    padding: 25px 40px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 14px;
    margin-top: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

    .admin-footer a {
        color: var(--link-color);
        text-decoration: none;
        font-weight: 600;
        transition: all 0.3s ease;
    }

        .admin-footer a:hover {
            opacity: 0.8;
            text-decoration: underline;
        }

    .admin-footer p::before {
        content: "🛡️";
        margin-right: 8px;
    }

/* --- 9. КАЛЬКУЛЯТОР (ОСНОВНОЙ БЛОК) --- */
.calculator-container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 40px;
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

    .calculator-container h1 {
        font-size: 28px;
        margin-bottom: 30px;
        color: var(--text-color);
    }

.calculator-warning {
    background: var(--card-inner-bg);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 30px;
    font-size: 14px;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.calculator-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.calculator-left, .calculator-right {
    background: var(--card-inner-bg);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

/* Заголовки внутри калькулятора */
.ad-platforms h3, .amount-section h3 {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 700;
}

/* Кнопки платформ и валют */
.platform-buttons, .currency-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.platform-btn, .currency-btn {
    padding: 12px 15px;
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 14px;
    flex: 1;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .platform-btn:hover, .currency-btn:hover {
        border-color: var(--link-color);
        transform: translateY(-1px);
    }

    .platform-btn.active, .currency-btn.active {
        background: var(--link-color);
        color: #fff;
        border-color: var(--link-color);
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    }

/* Поле ввода суммы */
.amount-input-container {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.amount-input {
    flex: 2;
    padding: 12px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-color);
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
}

    .amount-input:focus {
        outline: none;
        border-color: var(--link-color);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

/* Инфо-тексты */
.exchange-rate, .result-note {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 10px;
}

.commission-info {
    color: var(--link-color);
    font-weight: 600;
    font-size: 14px;
}

/* Результаты */
.result-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

    .result-item.highlighted {
        color: var(--link-color);
        font-weight: 700;
        font-size: 1.1rem;
    }

    .result-item.total {
        border-bottom: none;
        font-size: 1.3rem;
        font-weight: 800;
        color: var(--text-color);
        margin-top: 10px;
    }

.submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--link-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

    .submit-btn:hover {
        filter: brightness(1.1);
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
    }

/* --- 10. БЭЙДЖИ И АНИМАЦИИ --- */
.has-badge {
    position: relative;
}

    .has-badge::before {
        content: "Новое";
        position: absolute;
        top: -12px;
        right: -8px;
        background: linear-gradient(45deg, #ff6b6b, #ee5253);
        color: white;
        padding: 2px 8px;
        border-radius: 10px;
        font-size: 10px;
        font-weight: 800;
        text-transform: uppercase;
        animation: pulse 2s infinite;
    }

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Адаптивность калькулятора */
@media (max-width: 850px) {
    .calculator-content {
        grid-template-columns: 1fr;
    }

    .amount-input-container {
        flex-direction: column;
    }

    .currency-buttons {
        width: 100%;
    }

    .currency-btn {
        flex: 1;
    }
}

/* --- 11. ВЫПАДАЮЩЕЕ МЕНЮ ПОЛЬЗОВАТЕЛЯ И УВЕДОМЛЕНИЯ --- */
.user-dropdown {
    position: relative;
    margin-left: auto; /* МАГИЯ: это прижимает весь блок пользователя вправо */
    display: flex;
    align-items: center;
    gap: 15px; /* Расстояние между уведомлениями и профилем */
}

.user-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-inner-bg); /* Добавил легкий фон кнопке, чтобы она выделялась */
    border: 1px solid var(--border-color);
    cursor: pointer;
    color: var(--text-color);
    font-weight: 600;
    font-size: 14px;
    padding: 6px 16px; /* Сделал кнопку профиля чуть больше */
    border-radius: 50px; /* Овальная форма в стиле Apple/Google */
    transition: all 0.3s ease;
}

    .user-toggle:hover {
        background: var(--card-bg);
        box-shadow: var(--shadow-sm);
    }

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--link-color);
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.chevron {
    font-size: 10px;
    opacity: 0.6;
    transition: transform 0.3s ease;
}

/* Основной контейнер меню */
.user-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0; /* Меню открывается ровно под кнопкой по правому краю */
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 6px;
    display: none;
    flex-direction: column;
    min-width: 220px; /* Сделал меню чуть шире */
    z-index: 1100;
    box-shadow: var(--shadow-md);
}

    .user-menu.show {
        display: flex;
        animation: fadeInTop 0.2s ease-out;
    }

    /* Элементы списка внутри меню */
    .user-menu a,
    .user-menu button {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 10px 14px;
        border: none;
        background: none;
        color: var(--text-color) !important;
        font-size: 14px;
        font-weight: 500;
        text-align: left;
        text-decoration: none;
        cursor: pointer;
        border-radius: 10px;
        transition: all 0.2s ease;
    }

        .user-menu a:hover,
        .user-menu button:hover {
            background: var(--card-inner-bg) !important;
            color: var(--link-color) !important;
        }

/* Специальный стиль для кнопки выхода */
.logout-item {
    margin-top: 4px;
    border-top: 1px solid var(--border-color) !important;
    border-radius: 0 0 10px 10px !important;
}

    .logout-item:hover {
        background: rgba(239, 68, 68, 0.1) !important; /* Нежно-красный фон */
        color: #ef4444 !important; /* Ярко-красный текст */
    }

/* Анимация появления */
@keyframes fadeInTop {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Колокольчик уведомлений (если есть) */
.notification-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s;
}

    .notification-btn:hover {
        background: var(--card-inner-bg);
    }

.badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid var(--card-bg);
}

/* --- Красивый скроллбар --- */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--border-color); /* Цвет ползунка зависит от темы */
    border-radius: 10px;
}

    .custom-scrollbar::-webkit-scrollbar-thumb:hover {
        background: var(--text-muted);
    }

/* --- Эффект наведения на уведомление --- */
.notification-item-row:hover {
    background-color: var(--card-inner-bg) !important;
}

/* Фикс для стрелочки или выпадающего меню, если оно было жестко темным */
.user-menu {
    border-radius: 12px !important;
    overflow: hidden;
}

/*--------------------Для главной страницы---------------------------------*/
/* 1. Убираем ограничения с родительского контейнера, если внутри есть наш фон */
main:has(.full-screen-wrapper) {
    display: grid !important;
    grid-template-columns: 100%;
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 2. Сама обертка */
.full-screen-wrapper {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 85px); /* Высота экрана минус высота хедера */
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Начинаем сверху */
    padding-top: 40px;
    padding-bottom: 40px;
    overflow: hidden; /* Чтобы блобы не растягивали страницу */
}

    /* 3. Блобы внутри */
    .full-screen-wrapper .blob {
        position: absolute;
        width: 800px;
        height: 800px;
        border-radius: 50%;
        filter: blur(140px);
        z-index: 0;
        pointer-events: none;
    }

    .full-screen-wrapper .blob-1 {
        background: var(--blob-color-1);
        top: -100px;
        right: -100px;
    }

    .full-screen-wrapper .blob-2 {
        background: var(--blob-color-2);
        bottom: -100px;
        left: -100px;
    }

/* Если внутри main есть полноэкранный контент, отменяем центрирование и ширину */
main:has(.full-screen-wrapper),
main:has(.auth-page-wrapper) {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

main:has(.full-screen-wrapper),
main:has(.auth-page-wrapper) {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

/* Обертка, которая займет всё пространство */
.full-screen-wrapper {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 85px); /* Минус высота шапки */
    background-color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Чтобы блобы не создавали скролл */
    padding: 40px 20px;
}

    /* Позиционируем блобы так, чтобы они не раздували страницу */
    .full-screen-wrapper .blob {
        position: absolute;
        width: 800px;
        height: 800px;
        border-radius: 50%;
        filter: blur(140px);
        z-index: 0;
        pointer-events: none;
    }

.blob-1 {
    background: var(--blob-color-1);
    top: -200px;
    right: -100px;
}

.blob-2 {
    background: var(--blob-color-2);
    bottom: -200px;
    left: -100px;
}

/* Убираем отступ сверху у всех видов футеров, если они идут сразу после градиента */
main:has(.full-screen-wrapper) + footer,
main:has(.full-screen-wrapper) + .main-footer,
main:has(.full-screen-wrapper) + .billing-footer {
    margin-top: 0 !important;
}

/* Дополнительно: если футер находится ВНУТРИ body, но ВНЕ main */
body:has(.full-screen-wrapper) .main-footer {
    margin-top: 0 !important;
}

/* ---------------------- ГЛОБАЛЬНЫЙ КАСТОМНЫЙ СКРОЛЛБАР ---------------------------- */

/* 1. Ширина скроллбара */
::-webkit-scrollbar {
    width: 8px; /* Ширина для вертикального */
    height: 8px; /* Высота для горизонтального */
}

/* 2. Фон дорожки (трека), по которому двигается ползунок */
::-webkit-scrollbar-track {
    background: transparent; /* Оставляем прозрачным, чтобы не выбивался из дизайна */
}

/* 3. Сам ползунок */
::-webkit-scrollbar-thumb {
    background: #4361EE; /* Ваш фирменный синий цвет */
    border-radius: 10px; /* Закругленные края */
    border: 2px solid transparent; /* Отступ от краев дорожки, если нужно */
    background-clip: content-box;
}

    /* 4. Эффект при наведении на ползунок */
    ::-webkit-scrollbar-thumb:hover {
        background: #364fc7; /* Темно-синий при наведении */
    }

/* 5. Для Firefox (у него своя система стилизации) */
* {
    scrollbar-width: thin;
    scrollbar-color: #4361EE transparent;
}