/* ===== CSS Variables ===== */
:root {
    /* Основные цвета */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --secondary: #7c3aed;
    --secondary-dark: #5b21b6;
    --success: #10b981;
    --success-dark: #059669;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --danger: #ef4444;
    --danger-dark: #dc2626;

    /* Нейтральные цвета */
    --white: #ffffff;
    --black: #000000;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Текстовые цвета */
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-tertiary: var(--gray-400);

    /* Фоновые цвета */
    --bg-primary: var(--white);
    --bg-secondary: var(--gray-50);
    --bg-tertiary: var(--gray-100);

    /* Границы */
    --border: var(--gray-200);
    --border-light: var(--gray-100);
    --border-dark: var(--gray-300);

    /* Тени */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Радиусы */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Анимации */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3.5rem;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

.btn-login {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-login:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    color: var(--primary);
}

/* ===== Header & Navigation ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

/* ИСПРАВЛЕННЫЙ КОНТЕЙНЕР ДЛЯ ХЕДЕРА */
.header .container {
    padding: 0 20px;
}

/* Основной нав */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

/* Логотип */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 24px;
    font-weight: 700;
    padding: 5px 0;
    flex-shrink: 0;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 800;
    flex-shrink: 0;
}

.logo-text {
    color: var(--text-primary);
    white-space: nowrap;
}

.logo-text span {
    color: var(--primary);
}

/* Десктопная навигация - ИСПРАВЛЕНО */
.nav-desktop {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
    margin-left: 40px;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    gap: 40px;
}

.nav-list {
    display: flex;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color var(--transition-fast);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

/* Языковой переключатель */
.language-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
    color: var(--text-primary);
    flex-shrink: 0;
}

.language-switcher:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
}

.flag-icon {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
}

/* Мобильная навигация */
.nav-mobile {
    display: none;
    align-items: center;
    gap: 15px;
}

/* Бургер меню */
.nav-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.nav-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
}

.burger-line {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

/* Мобильное меню */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    height: 100vh;
    background: var(--white);
    z-index: 1100;
    transition: right 0.3s ease;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1099;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.mobile-menu-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
}

.mobile-menu-close {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.mobile-menu-close:hover {
    background: var(--gray-200);
    color: var(--primary);
}

.mobile-menu-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu-item {
    margin-bottom: 5px;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.mobile-menu-link:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

.mobile-menu-link i {
    width: 20px;
    text-align: center;
    color: var(--text-tertiary);
}

.mobile-menu-link:hover i {
    color: var(--primary);
}

.mobile-menu-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.mobile-menu-footer .btn {
    margin-bottom: 15px;
}

.mobile-menu-language {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.language-current {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== Footer ===== */
.footer {
    background: var(--gray-900);
    color: var(--white);
    padding: 60px 0 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    text-decoration: none;
    font-size: 24px;
    font-weight: 700;
}

.footer-logo .logo-text {
    color: var(--white);
}

.footer-logo .logo-text span {
    color: var(--primary-light);
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.footer-social a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.link-group h4 {
    color: var(--white);
    margin-bottom: 20px;
    font-size: 18px;
}

.link-group ul {
    list-style: none;
}

.link-group li {
    margin-bottom: 10px;
}

.link-group a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color var(--transition-fast);
    font-size: 14px;
}

.link-group a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.footer-bottom p {
    margin-bottom: 10px;
}

.footer-bottom p:last-child {
    margin-bottom: 0;
}

/* ===== Back to Top ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-full);
    border: none;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

/* ===== Video Modal ===== */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.video-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-full);
    border: none;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 10;
    transition: background var(--transition-fast);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ===== Animations ===== */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Responsive Styles ===== */
@media (max-width: 1200px) {
    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2.25rem;
    }
}

@media (max-width: 992px) {
    /* Переключаемся на мобильную навигацию */
    .nav-desktop {
        display: none;
    }

    .nav-mobile {
        display: flex;
    }

    .nav {
        padding: 12px 0;
        height: 64px;
    }

    .nav-logo {
        font-size: 22px;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
    }

    .language-switcher {
        padding: 6px 10px;
    }

    .language-switcher .current-language {
        display: none;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    /* Мобильный хедер - исправлены отступы */
    .nav {
        padding: 10px 0;
        height: 60px;
    }

    .nav-logo {
        font-size: 20px;
        gap: 8px;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .nav-mobile {
        gap: 10px;
    }

    .language-switcher {
        padding: 5px 8px;
    }

    .flag-icon {
        width: 18px;
        height: 13px;
    }

    .nav-toggle {
        width: 36px;
        height: 36px;
        padding: 6px;
    }

    .burger-line {
        width: 18px;
        height: 2px;
    }

    /* Мобильное меню - адаптация для планшетов */
    .mobile-menu {
        width: 280px;
    }

    .footer-links {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }

    .footer-links {
        grid-template-columns: 1fr;
    }

    /* Мобильный хедер - мелкие экраны */
    .nav {
        padding: 8px 0;
        height: 56px;
    }

    .nav-logo {
        font-size: 18px;
    }

    .logo-text {
        font-size: 18px;
    }

    .mobile-menu {
        width: 100%;
    }

    .mobile-menu-header {
        padding: 15px;
    }

    .mobile-menu-content {
        padding: 15px;
    }

    .mobile-menu-link {
        padding: 12px 15px;
    }
}