/* === ОСНОВА === */
:root {
  --page-max: 1200px;
  --page-pad: 80px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Rubik', sans-serif;
}

html, body {
  height: 100%;
}

body {
  background: #0d0d0d;
  color: #f5f5f5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* === ФОН (тёмная тема) === */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, #151515, #0b0b0b 80%);
  z-index: -2;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: -1;
}

/* === ЧАСТИЦЫ === */
.particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.particle {
  position: absolute;
  background: rgba(255, 165, 0, 0.5);
  border-radius: 50%;
}
@keyframes float {
  0% { transform: translate(0, 0); opacity: 0.5; }
  50% { transform: translate(20px, -100px); opacity: 0.8; }
  100% { transform: translate(0, -200px); opacity: 0; }
}

/* === HEADER === */
.navbar {
  width: 100%;
  border-bottom: 1px solid rgba(255, 165, 0, 0.2);
}
.navbar-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px var(--page-pad);
}
.navbar-left {
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo-btn {
  background: none;
  border: none;
  color: #ffa500;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.3s;
}
.logo-btn:hover {
  color: #ffcc66;
  text-shadow: 0 0 8px #ffa500;
}
.logo-image {
  height: 25px;
  width: auto;
  vertical-align: middle;
  transition: transform 0.2s ease;
}
.logo-image:hover { transform: scale(1.05); }

.search {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 165, 0, 0.3);
  background: rgba(20, 20, 20, 0.8);
  color: #fff;
  outline: none;
  font-size: 12px;
}
.search::placeholder { color: #888; }

.dropdown { position: relative; display: inline-block; }
.help-btn {
  background: none;
  border: none;
  color: #ffa500;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
}
.help-btn:hover {
  color: #ffcc66;
  text-shadow: 0 0 8px #ffa500;
}
.dropdown-content {
  display: none;
  position: absolute;
  background: rgba(26, 26, 26, 0.9);
  border: 1px solid #333;
  border-radius: 6px;
  min-width: 160px;
  top: 110%;
  overflow: hidden;
}
.dropdown-content a {
  display: block;
  padding: 8px 16px;
  color: #ffa500;
  text-decoration: none;
  font-size: 14px;
  transition: 0.2s;
}
.dropdown-content a:hover {
  background: rgba(255, 165, 0, 0.1);
  color: #ffa500;
  text-shadow: 0 0 8px #ffa500;
}
.dropdown-content.show {
  display: block;
  animation: fadeIn 0.15s ease-in-out;
  z-index: 100;
}
.dropdown-content-profile {
  right: 0;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === ПРАВАЯ ЧАСТЬ НАВБАРА === */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 26px;
}
.navbar-right a {
  color: #ffa500;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: 0.3s;
}
.navbar-right a:hover {
  color: #ffcc66;
  text-shadow: 0 0 8px #ffa500;
}

/* === ПРОФИЛЬНОЕ МЕНЮ === */
.profile-dropdown {
  position: relative;
  display: inline-block;
}
.profile-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  vertical-align: middle;
  transition: transform 0.2s ease;
}
.profile-icon:hover { transform: scale(1.1); }
.dropdown-content a.logout-link {
  color: #ff6b6b;
  font-weight: 500;
}
.dropdown-content a.logout-link:hover {
  background: rgba(255, 80, 80, 0.15);
  text-shadow: 0 0 8px #ff4d4d;
  color: #ff6b6b;
}

/* === FLASH СООБЩЕНИЯ === */
.flash-messages { margin-bottom: 10px; }
.flash {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
  margin-bottom: 6px;
}
.flash-error {
  background: rgba(255,0,0,0.15);
  border: 1px solid rgba(255,0,0,0.3);
  color: #ff4d4d;
  box-shadow: 0 0 12px rgba(255,0,0,0.2);
}
.flash-success {
  background: rgba(0,255,0,0.1);
  border: 1px solid rgba(0,255,0,0.3);
  color: #66ff66;
  box-shadow: 0 0 12px rgba(0,255,0,0.2);
}
.flash-warning {
  background: rgba(255,165,0,0.1);
  border: 1px solid rgba(255,165,0,0.3);
  color: #ffa500;
  box-shadow: 0 0 10px rgba(255,165,0,0.15);
}

/* === FOOTER === */
.footer {
  margin-top: auto;
  text-align: center;
  color: #999;
  padding: 20px;
  border-top: 1px solid rgba(255, 165, 0, 0.2);
}
.footer .highlight {
  color: #ffa500;
  font-weight: 700;
}

/* === АДАПТИВ ДЛЯ МОБИЛЬНЫХ === */
@media (max-width: 900px) {
  :root {
    --page-pad: 20px;
  }

  .navbar {
    padding: 10px var(--page-pad);
    flex-wrap: wrap;
    gap: 10px;
  }

  .navbar-left {
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    justify-content: center;
  }

  .navbar-right {
    flex-wrap: wrap;
    gap: 14px;
    width: 100%;
    justify-content: center;
  }

  .search {
    flex: 1;
    min-width: 180px;
  }

  .help-btn {
    font-size: 13px;
  }
}

@media (max-width: 600px) {
  .navbar {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 12px;
  }

  .navbar-left,
  .navbar-right {
    justify-content: center;
    width: 100%;
  }

  .search {
    width: 100%;
    margin-top: 6px;
  }

  .logo-image {
    height: 22px;
  }

  .navbar-right a {
    font-size: 13px;
  }

  .profile-icon {
    width: 30px;
    height: 30px;
  }

  .footer {
    font-size: 13px;
    padding: 15px;
  }
}

/* Стиль кнопки темы */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  color: #ffa500;
  transition: transform 0.3s ease, color 0.3s ease;
}

/* =========================================================
   СВЕТЛАЯ ТЕМА — ФОН ДОЛЖЕН БЫТЬ ПОЛНОСТЬЮ ОДИНАКОВЫЙ (#fff)
   ========================================================= */

/* 1) Принудительно белый фон вообще везде */
html.light-theme,
body.light-theme {
  background: #fff !important;
  color: #000;
  transition: background 0.4s ease, color 0.4s ease;
}

/* 2) Убираем любые оверлеи/градиенты */
body.light-theme::before,
body.light-theme::after {
  display: none !important;
  content: none !important;
}

/* 3) На всякий случай отключаем “частицы” в светлой теме */
body.light-theme .particles {
  display: none !important;
}

/* 4) Убираем тени у шапки/подвала, которые создавали “серую полосу” */
body.light-theme .navbar {
  background: #fff;
  border-bottom: 1px solid #ccc;
  box-shadow: none !important;
}

body.light-theme .footer {
  background: #fff;
  border-top: 1px solid #ccc;
  color: #222;
  box-shadow: none !important;
}

/* 5) Текст/элементы */
body.light-theme .logo-btn,
body.light-theme .help-btn,
body.light-theme .navbar-right a {
  color: #000;
}

body.light-theme .logo-btn:hover,
body.light-theme .help-btn:hover,
body.light-theme .navbar-right a:hover {
  color: #ff9500;
  text-shadow: none;
}

body.light-theme .search {
  background: #fff;
  border: 1px solid #bbb;
  color: #000;
}

body.light-theme .search::placeholder {
  color: #666;
}

/* Выпадающие меню */
body.light-theme .dropdown-content {
  background: #fff;
  border: 1px solid #bebebe;
  box-shadow: none !important;
}

body.light-theme .dropdown-content a {
  color: #111;
  background: #fff;
  transition: all 0.2s ease;
}

body.light-theme .dropdown-content a:hover {
  color: #e19b00;
  background-color: #ebebeb;
}

body.light-theme .dropdown-content a.logout-link {
  color: #ff6b6b;
}

body.light-theme .dropdown-content a.logout-link:hover {
  background: rgba(255, 41, 41, 0.45);
  text-shadow: 0 0 1px #ff4d4d;
}

/* Кнопка языка */
.lang-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.lang-toggle img {
  width: 28px;
  height: auto;
  display: block;
  border: none;
  background: transparent !important;
  box-shadow: none !important;
  object-fit: contain;
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.2));
  transition: transform 0.3s ease;
}

.lang-toggle:hover img {
  transform: scale(1.1);
  filter: drop-shadow(0 0 3px rgba(255,165,0,0.6));
}
