/* =============================================================================
   БАЗОВЫЕ СТИЛИ - SlotReviews.ru
   Навигация, футер, базовая типографика
============================================================================= */

/* CSS Variables */
:root {
    /* Цвета в стиле роскомнадзора */
    --primary-blue: #1e3a8a;        /* Темно-синий */
    --secondary-blue: #3b82f6;      /* Синий */
    --light-blue: #60a5fa;          /* Светло-синий */
    --very-light-blue: #dbeafe;     /* Очень светло-синий */
    --white: #ffffff;
    --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;

    /* Градиенты */
    --gradient-primary: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #60a5fa 100%);

    /* Размеры */
    --container-max-width: 1200px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;

    /* Шрифты */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Тени */
    --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);

    /* Z-индексы */
    --z-header: 100;
    --z-mobile-menu: 150;
    --z-modal: 1000;
    --z-toast: 1100;
}

/* =============================================================================
   RESET & BASE
============================================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    overflow-x: hidden;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Базовая типографика */
h1, h2, h3, h4, h5, h6 {
    color: var(--gray-900);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
}

h3 {
    font-size: 1.75rem;
    font-weight: 600;
}

h4 {
    font-size: 1.5rem;
    font-weight: 600;
}

h5 {
    font-size: 1.25rem;
    font-weight: 600;
}

h6 {
    font-size: 1.125rem;
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

a {
    color: var(--secondary-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-blue);
}

a:focus {
    outline: 2px solid var(--secondary-blue);
    outline-offset: 2px;
}

/* =============================================================================
   HEADER & NAVIGATION
============================================================================= */

.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    position: relative;
}

/* Логотип */
.nav__logo {
    flex-shrink: 0;
}

.nav__logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 1.25rem;
    transition: opacity 0.2s ease;
}

.nav__logo-link:hover {
    opacity: 0.8;
}

.nav__logo-link:focus {
    outline: 2px solid var(--secondary-blue);
    outline-offset: 4px;
    border-radius: 4px;
}

.nav__logo-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.nav__logo-text {
    font-weight: 700;
    white-space: nowrap;
}

/* Десктопное меню */
.nav__menu {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav__menu-items {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}

.nav__menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.nav__menu-item:hover,
.nav__menu-item.active {
    color: var(--primary-blue);
    background-color: var(--very-light-blue);
}

.nav__menu-item:focus {
    outline: 2px solid var(--secondary-blue);
    outline-offset: 2px;
}

.nav__menu-icon {
    font-size: 1rem;
    line-height: 1;
}

/* Мобильная кнопка-гамбургер */
.nav__mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.nav__mobile-toggle:hover {
    background-color: var(--gray-100);
}

.nav__mobile-toggle:focus {
    outline: 2px solid var(--secondary-blue);
    outline-offset: 2px;
}

.nav__mobile-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--gray-600);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Анимация гамбургера */
.nav__mobile-toggle--active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav__mobile-toggle--active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.nav__mobile-toggle--active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* =============================================================================
   TRUST BADGES
============================================================================= */

.trust-badges {
    background: var(--very-light-blue);
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.trust-badges__content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-blue);
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
}

.trust-badge__icon {
    font-size: 1rem;
    line-height: 1;
}

/* =============================================================================
   MAIN CONTENT
============================================================================= */

.main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
    flex: 1;
}

/* =============================================================================
   FOOTER
============================================================================= */

.footer {
    background: var(--primary-blue);
    color: var(--white);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer__content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer__section {
    min-width: 0;
}

.footer__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--white);
}

.footer__subtitle {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--light-blue);
}

.footer__description,
.footer__responsible {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 0;
}

.footer__links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer__links li {
    margin-bottom: 0.5rem;
}

.footer__links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-block;
}

.footer__links a:hover {
    color: var(--light-blue);
}

.footer__links a:focus {
    outline: 2px solid var(--light-blue);
    outline-offset: 2px;
}

.footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1rem;
    text-align: center;
}

.footer__copyright {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    margin: 0;
}

/* =============================================================================
   УТИЛИТАРНЫЕ КЛАССЫ
============================================================================= */

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* =============================================================================
   RESPONSIVE DESIGN
============================================================================= */

/* Планшеты и мелкие десктопы */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }

    .nav__menu-items {
        gap: 0.25rem;
    }

    .nav__menu-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .trust-badges__content {
        gap: 2rem;
    }
}

/* Мобильные устройства */
@media (max-width: 768px) {
    /* Общие стили */
    .container {
        padding: 0 15px;
    }

    /* Навигация */
    .nav {
        padding: 0.75rem 0;
    }

    .nav__logo-link {
        font-size: 1.125rem;
    }

    .nav__logo-icon {
        font-size: 1.25rem;
    }

    /* Мобильное меню */
    .nav__menu {
        position: absolute;
        top: calc(100% + 1px);
        left: 0;
        right: 0;
        background: var(--white);
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--gray-200);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        z-index: var(--z-mobile-menu);
    }

    .nav__menu--open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav__menu-items {
        flex-direction: column;
        padding: 0;
        gap: 0;
        align-items: stretch;
    }

    .nav__menu-item {
        width: 100%;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--gray-200);
        border-radius: 0;
        justify-content: flex-start;
    }

    .nav__menu-item:last-child {
        border-bottom: none;
    }

    .nav__menu-item:hover,
    .nav__menu-item.active {
        background-color: var(--very-light-blue);
    }

    .nav__mobile-toggle {
        display: flex;
    }

    /* Trust badges */
    .trust-badges {
        padding: 0.75rem 0;
    }

    .trust-badges__content {
        gap: 1.5rem;
        justify-content: space-around;
    }

    .trust-badge {
        font-size: 0.8rem;
        gap: 0.375rem;
    }

    .trust-badge__icon {
        font-size: 0.9rem;
    }

    /* Main content */
    .main {
        padding: 1.5rem 0;
    }

    /* Typography */
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    h3 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    h4 {
        font-size: 1.25rem;
    }

    h5 {
        font-size: 1.125rem;
    }

    h6 {
        font-size: 1rem;
    }

    /* Footer */
    .footer {
        padding: 2rem 0 1rem;
        margin-top: 2rem;
    }

    .footer__content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }

    .footer__section {
        text-align: center;
    }

    .footer__title {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .footer__subtitle {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .nav {
        padding: 0.5rem 0;
    }

    .nav__logo-link {
        font-size: 1rem;
        gap: 0.5rem;
    }

    .nav__logo-icon {
        font-size: 1.125rem;
    }

    .nav__mobile-toggle {
        width: 40px;
        height: 40px;
        padding: 0.375rem;
    }

    .nav__mobile-toggle span {
        width: 20px;
        height: 2px;
    }

    .trust-badges__content {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .trust-badge {
        font-size: 0.75rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .footer {
        padding: 1.5rem 0 1rem;
    }

    .footer__content {
        gap: 1rem;
    }
}

/* Очень большие экраны */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* =============================================================================
   ACCESSIBILITY
============================================================================= */

/* Уменьшенная анимация для пользователей с чувствительностью к движению */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Высокий контраст */
@media (prefers-contrast: high) {
    :root {
        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
        --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    }
}

/* Focus visible для современных браузеров */
@supports selector(:focus-visible) {
    a:focus {
        outline: none;
    }

    a:focus-visible {
        outline: 2px solid var(--secondary-blue);
        outline-offset: 2px;
    }
}

/* =============================================================================
   PRINT STYLES
============================================================================= */

@media print {
    .header,
    .trust-badges,
    .footer,
    .nav__mobile-toggle {
        display: none !important;
    }

    .main {
        padding: 0 !important;
        min-height: auto !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    a {
        color: black !important;
        text-decoration: underline !important;
    }
}

/* Добавить в static/public/css/base.css */

/* ==========================================================================
   NOTIFICATION BANNERS
   ========================================================================== */

.notification-banner {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    font-size: 14px;
    animation: slideDown 0.3s ease-out;
}

.notification-banner--info {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.notification-banner--warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.notification-banner--success {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.notification-banner--error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.notification-banner__content {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 40px;
}

.notification-banner__close {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-banner__close:hover {
    opacity: 1;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================================================================
   LOGO IMPROVEMENTS - ЧИСТАЯ ВЕРСИЯ БЕЗ ДУБЛЕЙ
   ========================================================================== */

.nav__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.nav__logo:hover {
    opacity: 0.8;
}

.nav__logo-icon {
    /* ФИКСИРОВАННЫЕ размеры контейнера */
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;

    /* Оформление */
    border-radius: 8px;
    background: transparent; /* ПРОЗРАЧНЫЙ ФОН */
    margin-right: 12px;

    /* Центрирование содержимого */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    /* КРИТИЧНО: скрываем всё что выходит за границы */
    overflow: hidden !important;
    position: relative !important;

    /* Запрещаем изменение размеров */
    flex-shrink: 0 !important;
    flex-grow: 0 !important;

    /* Плавный переход при наведении */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav__logo-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Фон только для эмодзи (когда нет загруженного логотипа) */
.nav__logo-icon:not(:has(picture)):not(:has(img)) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Для эмодзи, если нет загруженного логотипа */
.nav__logo-icon:not(:has(picture)):not(:has(img))::before {
    content: "🎰";
    font-size: 24px;
    line-height: 1;
    z-index: 1;
    color: white; /* Белый цвет эмодзи на фиолетовом фоне */
}

/* WebP picture элемент */
.nav__logo-icon picture {
    width: 100% !important;
    height: 100% !important;
    max-width: 40px !important;
    max-height: 40px !important;
    display: block !important;
    overflow: hidden !important;
}

/* ГЛАВНОЕ: все изображения логотипа строго ограничены размерами */
.nav__logo-icon img,
.nav__logo-image {
    /* ЖЕСТКИЕ ОГРАНИЧЕНИЯ */
    width: auto !important;
    height: auto !important;
    max-width: 40px !important;
    max-height: 40px !important;

    /* Правильное масштабирование */
    object-fit: cover !important;
    object-position: center !important;

    /* Оформление */
    border-radius: 6px;

    /* Убираем любые отступы */
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;

    /* Блочная модель */
    display: block !important;

    /* Плавность */
    transition: transform 0.2s ease;
}

/* Эффект при наведении на изображение */
.nav__logo-icon:hover img,
.nav__logo-icon:hover .nav__logo-image {
    transform: scale(1.05);
}

.nav__logo-text {
    font-weight: 600;
    font-size: 20px;
    white-space: nowrap;
    color: inherit;
}

/* ==========================================================================
   АДАПТИВНОСТЬ ЛОГОТИПА
   ========================================================================== */

@media (max-width: 1200px) {
    .nav__logo-icon {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        max-width: 38px !important;
        max-height: 38px !important;
    }

    .nav__logo-icon img,
    .nav__logo-image {
        max-width: 38px !important;
        max-height: 38px !important;
    }

    .nav__logo-icon picture {
        max-width: 38px !important;
        max-height: 38px !important;
    }

    .nav__logo-text {
        font-size: 19px;
    }
}

@media (max-width: 768px) {
    .nav__logo-icon {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        max-width: 36px !important;
        max-height: 36px !important;
        margin-right: 10px;
    }

    .nav__logo-icon img,
    .nav__logo-image {
        max-width: 36px !important;
        max-height: 36px !important;
    }

    .nav__logo-icon picture {
        max-width: 36px !important;
        max-height: 36px !important;
    }

    .nav__logo-text {
        font-size: 18px;
    }

    /* Уменьшаем размер эмодзи на планшетах */
    .nav__logo-icon:not(:has(picture)):not(:has(img))::before {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .nav__logo-icon {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
        margin-right: 8px;
    }

    .nav__logo-icon img,
    .nav__logo-image {
        max-width: 32px !important;
        max-height: 32px !important;
    }

    .nav__logo-icon picture {
        max-width: 32px !important;
        max-height: 32px !important;
    }

    .nav__logo-text {
        font-size: 16px;
    }

    /* Еще меньше эмодзи на телефонах */
    .nav__logo-icon:not(:has(picture)):not(:has(img))::before {
        font-size: 20px;
    }
}

@media (max-width: 360px) {
    .nav__logo-icon {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        max-width: 28px !important;
        max-height: 28px !important;
        margin-right: 6px;
    }

    .nav__logo-icon img,
    .nav__logo-image {
        max-width: 28px !important;
        max-height: 28px !important;
    }

    .nav__logo-icon picture {
        max-width: 28px !important;
        max-height: 28px !important;
    }

    .nav__logo-text {
        font-size: 15px;
    }

    .nav__logo-icon:not(:has(picture)):not(:has(img))::before {
        font-size: 18px;
    }
}