:root {
    --bg-primary: #0f0c29;
    --bg-secondary: #1a1647;
    --bg-third: #211e46;
    --accent-primary: #00d2ff;
    --accent-secondary: #ff2d75;
    --accent-hover: #ff007e;
    --hover-color: rgba(0, 230, 255, 0.4);
    --hover-color-secondary: rgba(255, 85, 153, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #a0a0c0;
    --chat-form: rgba(10, 8, 35, 0.6);
    --chat-input: rgba(255, 255, 255, 0.07);
    --message-gradient-dark: rgba(0, 210, 255, 0.5);
    --message-gradient-light: rgba(0, 210, 255, 0.2);
    --gradient-up: #00415c;
    --gradient-down: #9f1c45;
    --price-gradient: #68dfff;
    --custom-card: rgba(0, 0, 0, 0.3);
    --card-bg: rgba(15, 12, 41, 0.7);
    --card-hover: rgba(255, 255, 255, 0.12);
    --shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
    --shadow-small: 0 4px 8px rgba(255, 255, 255, 0.15);
    --header-height: 85px;
    --header-bg: rgba(15, 12, 41, 0.92);
    --border-light: rgba(255, 255, 255, 0.08);
    --border-light-strong: rgba(255, 255, 255, 0.2);
    --nav-link-padding: 12px 18px;
    --result-item: rgba(0, 0, 0, 0.2);
}


/* Светлая тема */
html.light-theme {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-third: #f0f2f5;
    --accent-primary: #007bff;
    --accent-secondary: #ff6b6b;
    --accent-hover: #ff846c;
    --hover-color: rgba(0, 230, 255, 0.4);
    --hover-color-secondary: rgba(255, 85, 153, 0.4);
    --chat-form: rgba(0, 123, 255, 0.1);
    --chat-input: rgba(255, 255, 255, 0.8);
    --message-gradient-dark: rgba(0, 123, 255, 0.5);
    --message-gradient-light: rgba(0, 123, 255, 0.2);
    --gradient-up: rgb(165, 214, 255);
    --gradient-down: rgb(255 184 178);
    --price-gradient: #007bff;
    --custom-card: rgba(255, 255, 255, 0.3);
    --text-primary: #333333;
    --text-secondary: #4b4b4b;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-hover: rgba(245, 245, 245, 0.95);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    --shadow-small: 0 4px 8px rgba(0, 0, 0, 0.15);
    --header-bg: rgba(255, 255, 255, 0.96);
    --border-light: rgba(0, 0, 0, 0.08);
    --border-light-strong: rgba(0, 0, 0, 0.2);
    --result-item: rgb(255, 255, 255);
}

html.light-theme .main-header {
    background: rgba(255, 255, 255, 0.9);
}

html.light-theme .nav-list a {
    color: var(--text-primary);
}

html.light-theme .balance-info {
    background: rgba(0, 123, 255, 0.1);
}
html{
    overflow-x: hidden;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.mt{
    margin-top: 50px;
}

header {
    text-align: center;
    position: relative; /* Добавляем для позиционирования auth-links */
}

/* Переносим анимацию только на контент шапки */
.header-content {
    animation: fadeInDown 0.8s ease;
}


body {
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    color: var(--text-primary);
    display: block;
    flex-direction: column;
    line-height: 1.6;
    overflow-x: hidden;
    height: -webkit-fill-available; /* фолбэк */
    height: 100dvh;
}

.container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto 40px;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
}

a {
    color: var(--message-gradient-dark);
    text-decoration: none;
}

.hidden {
    opacity: 0;
    height: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
    transform: translateY(20px);
}

.auth-links {
    position: absolute;
    top: 25px;
    right: 25px;
    display: flex;
    gap: 15px;
    align-items: center;
    opacity: 1 !important; /* Важно для предотвращения мигания */
    transform: none !important; /* Важно для предотвращения мигания */
}

.auth-link {
    color: var(--accent-primary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 12px;
    background: rgba(0, 210, 255, 0.1);
    transition: all 0.3s;
    font-size: 0.95rem;
}

.auth-link:hover {
    background: rgba(0, 210, 255, 0.2);
    text-decoration: none;
}

.user-greeting {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Стили для баланса */
.user-balance {
    display: flex;
    align-items: center;
    background: rgba(0, 210, 255, 0.1);
    border-radius: 12px;
    padding: 6px 12px;
    margin: 0 10px;
    border: 1px solid rgba(0, 210, 255, 0.2);
}

.balance-amount {
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 1.1rem;
    margin-right: 5px;
}

.balance-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Адаптивность */
@media (max-width: 768px) {
}

@media (max-width: 480px) {
    .container {
        padding: 0;
    }
}
/* Хедер - крупнее и выразительнее */
.main-header {
    background: var(--header-bg);
    backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-anchor: none;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    padding: 0 30px;
}

/* Логотип - крупнее */
.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 22px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    position: relative;
}

/* Навигация - стилизованные кнопки */
.nav-links {
    display: flex;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 15px;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-list a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
    padding: var(--nav-link-padding);
    transition: all 0.3s ease;
    border-radius: 10px;
    opacity: 0.9;
    display: inline-block;
    white-space: nowrap; /* Запрещаем перенос текста */
}

.nav-list a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Активные пункты меню с градиентом */
.nav-list a.active {
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
    color: white !important;
    opacity: 1;
    box-shadow: 0 5px 15px rgba(0, 210, 255, 0.3);
}

/* Специальные стили для кнопок Войти/Регистрация */
.nav-list .auth-link {
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
    color: white !important;
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 210, 255, 0.25);
    transition: all 0.3s ease;
}

.nav-list .auth-link:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 7px 20px rgba(0, 210, 255, 0.4);
    background: linear-gradient(45deg, #00c6ff, #ff2d75);
}

/* Иконка темы - крупнее */
.theme-toggle {
    display: none !important; /* Скрываем кнопку переключения темы */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    cursor: pointer;
    margin: auto;
    color: var(--text-primary);
    font-size: 1.3rem;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* Баланс - крупнее с иконкой */
.balance-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 1.1rem;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.balance-info:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15), inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.balance-amount {
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 1.2rem;
}

.balance-icon {
    font-size: 1.3rem;
    color: var(--accent-primary);
}

/* Гамбургер - крупнее */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.hamburger span {
    width: 100%;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center;
}

.hamburger span:nth-child(1) {
    width: 80%;
    align-self: flex-end;
}

.hamburger span:nth-child(3) {
    width: 60%;
    align-self: flex-start;
}

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

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

.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    width: 100%;
}

.nav-list li.mobile-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
    border-bottom: none;
    width: 100%;
    justify-content: space-between;
  }

/* Адаптивность */
@media (max-width: 1180px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: var(--header-height);
        right: -320px;
        width: 320px;
        height: calc(100vh - var(--header-height));
        background: var(--header-bg);
        backdrop-filter: blur(25px);
        flex-direction: column;
        padding: 40px 30px;
        transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
        box-shadow: -8px 0 30px rgba(0, 0, 0, 0.2);
        border-left: 1px solid var(--border-light);
        z-index: 1000;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
        width: 100%;
    }

    .nav-list li {
        width: 100%;
        border-bottom: 1px solid var(--border-light);
    }

    .nav-list a {
        display: block;
        width: 100%;
        font-size: 1.1rem; /* Уменьшаем размер шрифта для мобильных */
        border-radius: 12px;
        margin-bottom: 5px;
        padding: 10px 15px; /* Уменьшаем отступы для мобильных */
    }

    .balance-info {
        padding: 12px 20px;
        font-size: 1rem;
    }
    .theme-toggle{
        margin-bottom: 10px;
    }
    .nav-list li.mobile-row {
        display: flex;
        gap: 10px;
        border-bottom: none;
        width: 100%;
        justify-content: space-between;
        margin-bottom: 15px;
      }

      .theme-toggle,
      .balance-info {
        width: 60px;
          height: 50px;
      }

     /* Добавьте эти правила */
  .nav-list li:has(.theme-toggle),
  .nav-list li:has(.balance-info) {
    border-bottom: none;
    width: 100%;
    flex: 1;
  }

  .nav-list li:has(.theme-toggle) {
    order: -1; /* Перемещает кнопку темы в начало */
    margin-right: 10px;
  }

  .nav-list li:has(.balance-info) {
    order: 0; /* Баланс остаётся рядом с кнопкой */
  }

  /* Создаём контейнер для этих двух элементов */
  .nav-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  /* Остальные пункты меню */
  .nav-list li:not(:has(.theme-toggle)):not(:has(.balance-info)) {
    width: 100%;
    border-bottom: 1px solid var(--border-light);
  }
}

/* Дополнительные адаптивные стили для навбара */
@media (max-width: 1024px) {
    .nav-list {
        gap: 8px;
    }
    
    .nav-list a {
        font-size: 1rem;
        padding: 8px 12px;
        white-space: nowrap; /* Запрещаем перенос текста */
    }
    
    .header-container {
        padding: 0 20px;
    }
}

@media (max-width: 900px) {
    .nav-list a {
        font-size: 0.95rem;
        padding: 6px 10px;
    }
    
    .logo {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .nav-list {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-list li {
        flex: 0 0 auto;
        width: auto;
        border-bottom: none;
    }
    
    .nav-list a {
        font-size: 0.9rem;
        padding: 5px 8px;
    }
}

/* Микроанимация для всей шапки при скролле */
.scrolled-header {
    height: 70px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.container:after {
  content: "";
  position: absolute;
  z-index: 10;
  left: 0; top: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0);
  pointer-events: none;
  transition: background 0.3s;
}

.container.with-overlay::after {
  background: rgba(0,0,0,0.5);
    pointer-events: all;
}

/* Футер */
.footer {
    background: var(--gradient-up);
    padding: 20px 20px;
    margin-top: 80px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-brand {
    flex: 1;
    min-width: 300px;
}

.footer-logo {
    width: 204px;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 15px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-links {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.footer-links h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
}

.footer-links h4::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 2px;
}

.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    transition: color 0.3s ease;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.cookie-banner {
    display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #2c3e50;
  color: white;
  padding: 15px;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
}

.cookie-buttons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.cookie-button {
  padding: 8px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#accept-cookies {
  background: #3498db;
  color: white;
}

#reject-cookies {
  background: #e74c3c;
  color: white;
}

.footer-credentials {
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.footer-credentials a {
    color: var(--accent-primary);
    text-decoration: none;
}

.footer-credentials a:hover {
    text-decoration: underline;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: #fff;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 500px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  gap: 10px;
}

.remember-choice {
  margin: 15px 0;
  display: flex;
  align-items: center;
}

/* Стили для модального окна AdBlock */
.adblock-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.adblock-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.adblock-modal-content {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-third));
    border-radius: 20px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-light-strong);
    position: relative;
    animation: slideInUp 0.3s ease;
}


.adblock-modal-body {
    padding: 40px 30px;
    color: var(--text-primary);
    text-align: center;
}

.adblock-icon {
    font-size: 3.5rem;
    color: var(--accent-primary);
    margin-bottom: 25px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.adblock-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: var(--text-primary);
    line-height: 1.3;
}

.adblock-message {
    font-size: 1rem;
    line-height: 1.5;
    margin: 0 0 30px 0;
    color: var(--text-secondary);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.adblock-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 10px;
}

.adblock-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 120px;
}

.adblock-btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}

.adblock-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 210, 255, 0.4);
}

.adblock-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-light-strong);
    backdrop-filter: blur(10px);
}

.adblock-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Адаптивность для модального окна */
@media (max-width: 600px) {
    .adblock-modal-content {
        width: 95%;
        margin: 20px;
        max-height: 85vh;
    }

    .adblock-modal-body {
        padding: 30px 20px;
    }

    .adblock-title {
        font-size: 1.3rem;
    }

    .adblock-message {
        font-size: 0.95rem;
    }

    .adblock-actions {
        flex-direction: column;
        gap: 10px;
    }

    .adblock-btn {
        width: 100%;
        min-width: auto;
    }
}

/* Светлая тема для модального окна */
html.light-theme .adblock-modal-content {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

html.light-theme .adblock-btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

html.light-theme .adblock-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}