/* ==========================================================================
   CHESSOV - Главный стилевой файл
   Дизайн: светлый, современный, корпоративный
   ========================================================================== */

/* Подключение шрифтов */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=DM+Sans:wght@300;400;500;600;700&display=swap');

/* CSS переменные */
:root {
    /* Основные цвета — светлая палитра */
    --color-bg: #ffffff;
    --color-bg-soft: #fdf9f7;
    --color-bg-accent: #fef6f3;
    --color-surface: #ffffff;
    --color-surface-alt: #faf7f5;

    /* Акцентные цвета */
    --color-primary: #ff6b9d;          /* Розовый */
    --color-primary-hover: #ff4d8a;
    --color-primary-soft: #ffe0ec;
    --color-secondary: #7dd3c0;        /* Мятный */
    --color-secondary-soft: #d9f5ee;
    --color-tertiary: #b8a5e3;         /* Лавандовый */
    --color-tertiary-soft: #ece5fa;
    --color-accent-gold: #f4c95d;      /* Золотистый */
    --color-accent-coral: #ff9a76;     /* Коралловый */

    /* Текст */
    --color-text: #2a2a3e;
    --color-text-soft: #5a5a6e;
    --color-text-muted: #9a9aae;
    --color-text-light: #c4c4d4;

    /* Границы и тени */
    --color-border: #f0ebe8;
    --color-border-soft: #f7f4f2;
    --shadow-sm: 0 2px 8px rgba(255, 107, 157, 0.06);
    --shadow-md: 0 8px 24px rgba(255, 107, 157, 0.08);
    --shadow-lg: 0 16px 48px rgba(255, 107, 157, 0.12);
    --shadow-hover: 0 12px 32px rgba(255, 107, 157, 0.15);

    /* Размеры */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-xl: 32px;
    --radius-full: 999px;

    /* Шрифты */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Переходы */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Контейнер */
    --container-max: 1280px;
    --container-padding: 24px;
}

/* Сброс стилей */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

/* Типографика */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.4rem, 3vw, 2rem); }
h4 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }

/* Контейнер */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    width: 100%;
}

/* ==========================================================================
   Кнопки
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all var(--transition-base);
    cursor: pointer;
    white-space: nowrap;
    border: 1.5px solid transparent;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: white;
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text);
}

.btn-ghost:hover {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.btn-sm {
    padding: 10px 20px;
    font-size: 14px;
}

.btn-lg {
    padding: 18px 36px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

/* ==========================================================================
   Шапка (Header)
   ========================================================================== */

.header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border-soft);
    z-index: 100;
    transition: all var(--transition-base);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.03em;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent-coral));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-family: var(--font-body);
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.25);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.header-nav a {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-soft);
    transition: color var(--transition-fast);
    position: relative;
}

.header-nav a:hover {
    color: var(--color-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Переключатель языка */
.lang-switch {
    display: flex;
    gap: 4px;
    background: var(--color-bg-soft);
    padding: 4px;
    border-radius: var(--radius-full);
}

.lang-switch button {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.lang-switch button.active {
    background: white;
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

/* Бургер-меню */
.burger {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--color-bg-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all var(--transition-fast);
}

.burger:hover {
    background: var(--color-primary-soft);
}

.burger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all var(--transition-base);
}

.burger.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.burger.active span:nth-child(2) {
    opacity: 0;
}

.burger.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Боковое меню */
.side-menu {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 100vw;
    height: 100vh;
    background: white;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow-y: auto;
    transition: right var(--transition-slow);
    padding: 32px;
}

.side-menu.active {
    right: 0;
}

.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(42, 42, 62, 0.4);
    backdrop-filter: blur(4px);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.side-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-border-soft);
}

.side-menu-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--color-text);
    transition: all var(--transition-fast);
}

.side-menu-close:hover {
    background: var(--color-primary-soft);
    transform: rotate(90deg);
}

.side-menu-section {
    margin-bottom: 32px;
}

.side-menu-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: 16px;
    font-weight: 600;
}

.side-menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.side-menu-list a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.side-menu-list a:hover {
    background: var(--color-primary-soft);
    color: var(--color-primary);
    transform: translateX(4px);
}

.side-menu-list a .menu-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-soft);
    border-radius: var(--radius-sm);
    font-size: 18px;
    transition: all var(--transition-fast);
}

.side-menu-list a:hover .menu-icon {
    background: white;
}

/* ==========================================================================
   Подвал (Footer)
   ========================================================================== */

.footer {
    background: linear-gradient(135deg, var(--color-bg-soft), var(--color-bg-accent));
    padding: 80px 0 32px;
    margin-top: 100px;
    border-top: 1px solid var(--color-border-soft);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 56px;
}

.footer-brand {
    max-width: 360px;
}

.footer-brand .logo {
    margin-bottom: 20px;
}

.footer-brand p {
    color: var(--color-text-soft);
    font-size: 15px;
    line-height: 1.7;
}

.footer-column h4 {
    font-family: var(--font-body);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text);
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-column ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-column ul a {
    color: var(--color-text-soft);
    font-size: 15px;
    transition: all var(--transition-fast);
}

.footer-column ul a:hover {
    color: var(--color-primary);
    padding-left: 4px;
}

.footer-bottom {
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-bottom p {
    color: var(--color-text-muted);
    font-size: 14px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-soft);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.social-links a:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
}

/* ==========================================================================
   Адаптивность
   ========================================================================== */

@media (max-width: 1024px) {
    .header-nav {
        display: none;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    :root {
        --container-padding: 16px;
    }

    .header-inner {
        height: 64px;
    }

    .logo {
        font-size: 22px;
    }

    .lang-switch {
        display: none;
    }

    .header-actions .btn:not(.btn-primary) {
        display: none;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer {
        padding: 56px 0 24px;
    }

    .side-menu {
        width: 100vw;
        right: -100vw;
    }
}

/* ==========================================================================
   Утилиты
   ========================================================================== */

.text-center { text-align: center; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }
.mb-64 { margin-bottom: 64px; }

.hidden { display: none !important; }

/* Скроллбар */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-soft);
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary-soft);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-in {
    animation: slideInRight 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Бейджи */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.badge-green {
    background: var(--color-secondary-soft);
    color: #2d8a78;
}

.badge-purple {
    background: var(--color-tertiary-soft);
    color: #6b5aa3;
}

.badge-gold {
    background: #fff4d6;
    color: #9a7b1f;
}

/* Уведомления (toast) */
.toast-container {
    position: fixed;
    top: 100px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    animation: slideInRight 0.4s ease forwards;
    pointer-events: auto;
    border-left: 4px solid var(--color-primary);
}

.toast.success { border-left-color: #2d8a78; }
.toast.error { border-left-color: #e85555; }
.toast.info { border-left-color: var(--color-tertiary); }

.toast-icon {
    font-size: 20px;
}

.toast-content {
    flex: 1;
    font-size: 14px;
    color: var(--color-text);
}

.toast-close {
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 18px;
}
