@import url("https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap");
@import url("./notifications.css");

:root {
  /* Colors */
  --bmw-blue: #0066b3;
  --bmw-dark-blue: #004d88;
  --bmw-sky: #6f9bd1;
  --bg-deep: #050507;

  /* Glassmorphism System */
  --glass-bg: rgba(18, 20, 24, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.03);

  /* Text */
  --text-main: #ffffff;
  --text-muted: #8ba4b6;

  /* UI Constants */
  --radius-xl: 24px;
  --radius-md: 12px;
  --transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow-glow: 0 0 20px rgba(0, 102, 179, 0.25);

  /* Safe Area Variables for Mobile */
  --sat: env(safe-area-inset-top);
  --sab: env(safe-area-inset-bottom);
  --sal: env(safe-area-inset-left);
  --sar: env(safe-area-inset-right);

  /* Fluid Typography & Spacing */
  --font-size-base: clamp(14px, 1.5vw, 16px);
  --font-size-h1: clamp(24px, 5vw, 40px);
  --font-size-h2: clamp(20px, 4vw, 32px);
  --font-size-h3: clamp(18px, 3vw, 24px);
  
  --container-padding: clamp(16px, 5vw, 40px);
  --header-height: clamp(60px, 10vh, 80px);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  width: 100%;
  height: -webkit-fill-available;
  background-color: var(--bg-deep);
}

body {
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
  background-color: transparent;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}
::-webkit-scrollbar-thumb {
  background: var(--bmw-dark-blue);
  border-radius: 4px;
}

#webgl-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  /* Вставляем градиент сюда. Так как блок fixed, фон тоже будет fixed */
  background: radial-gradient(circle at 50% -20%, #1a2a44 0%, #050507 70%);
}

/* --- HEADER --- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px max(4%, 20px); /* Умный отступ */
  padding-top: calc(10px + var(--sat)); /* Учет челки */
  height: calc(70px + var(--sat));
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--glass-border);
  background: rgba(5, 5, 7, 0.7);
}

.logo-container {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.main_logo_refr {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: white;
  gap: 12px;
}

.logo {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 50%;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}
.logo svg {
  width: 100%;
  height: 100%;
}

h1 {
  font-family: "Exo 2", sans-serif;
  font-weight: 700;
  font-size: clamp(1rem, 4vw, 1.5rem); /* Резиновый шрифт */
  color: white;
  white-space: nowrap;
}

/* Controls & Buttons */
.controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
  font-family: "Exo 2", sans-serif;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bmw-blue);
  border-color: var(--bmw-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}
.btn:active {
  transform: scale(0.96);
}

/* --- MAIN CONTAINER --- */
main.container {
  flex: 1;
  width: min(95%, 1100px); /* Максимальная ширина с защитой */
  margin: 20px auto;
  padding: 0;
  position: relative;
  min-height: 60vh;
}

/* Search Box */
#search-container {
  display: flex;
  flex-direction: column;
  gap: 25px;
  transition: var(--transition);
  margin-top: 40px;
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

#search-input,
#forum-search {
  /* <--- Добавили этот ID */
  width: 100%;
  background: rgba(0, 20, 50, 0.65);
  border: 2px solid rgba(0, 102, 179, 0.6);
  padding: 18px 25px;
  border-radius: var(--radius-xl);
  color: #fff;
  font-size: 15px;
  height: 56px;
  font-family: "Exo 2", sans-serif;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: var(--transition);
  box-shadow: 0 0 20px rgba(0, 102, 179, 0.25), 0 10px 30px rgba(0, 0, 0, 0.4);
}

#search-input:focus,
#forum-search:focus {
  /* <--- И тут тоже */
  outline: none;
  border-color: var(--bmw-blue);
  box-shadow: 0 0 30px rgba(0, 102, 179, 0.3);
}

.search-icon {
  position: absolute;
  right: 35px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bmw-blue);
  font-size: 20px;
  pointer-events: none;
}

/* Results & Cards */
#results-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 40px;
  animation: resultsSlideIn 0.1s cubic-bezier(0.45, 0, 0.55, 1);
}

#results-container.hidden {
  display: none;
}

@keyframes resultsSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Individual code items cascade animation */
.code-item {
  animation: codeItemSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.code-item:nth-child(1) {
  animation-delay: 0.03s;
}
.code-item:nth-child(2) {
  animation-delay: 0.06s;
}
.code-item:nth-child(3) {
  animation-delay: 0.09s;
}
.code-item:nth-child(4) {
  animation-delay: 0.12s;
}
.code-item:nth-child(5) {
  animation-delay: 0.15s;
}
.code-item:nth-child(6) {
  animation-delay: 0.18s;
}
.code-item:nth-child(7) {
  animation-delay: 0.21s;
}
.code-item:nth-child(8) {
  animation-delay: 0.24s;
}
.code-item:nth-child(9) {
  animation-delay: 0.27s;
}
.code-item:nth-child(10) {
  animation-delay: 0.3s;
}

@keyframes codeItemSlideIn {
  from {
    opacity: 0;
    transform: translateX(-15px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.code-item {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.01) 100%
  );
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.code-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(5px);
}
.code-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--bmw-blue);
  opacity: 0;
  transition: var(--transition);
}
.code-item:hover::before {
  opacity: 1;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}
.code-identifier {
  font-family: "Exo 2", sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--bmw-sky);
  letter-spacing: 0.5px;
}
.code-title {
  font-weight: 500;
  font-size: 16px;
  color: #fff;
}
.code-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Star Button */
.star-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.2);
  padding: 10px;
  transition: 0.2s;
}
.star-btn.active {
  color: #f1c40f;
  text-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}
.star-btn:hover {
  transform: scale(1.2);
  color: #fff;
}

/* Detail View */
#code-detail {
  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 30px;
  margin-bottom: 50px;
  animation: detailSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#code-detail.hidden {
  display: none;
}

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

.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 20px;
}
.header-title-wrapper {
  flex: 1;
}
.header-title-wrapper h2 {
  font-family: "Exo 2", sans-serif;
  font-size: clamp(1.5rem, 5vw, 2rem);
  color: #fff;
  line-height: 1.2;
  margin-bottom: 5px;
}

.back-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.back-btn:hover {
  background: var(--bmw-blue);
  transform: rotate(-90deg);
}

/* Detail Content Components */
.info-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  text-transform: uppercase;
}
.severity-high {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
}
.severity-medium {
  background: rgba(241, 196, 15, 0.2);
  color: #f1c40f;
  border: 1px solid rgba(241, 196, 15, 0.3);
}
.severity-low {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.detail-content h3 {
  color: var(--bmw-sky);
  font-size: 16px;
  margin: 25px 0 10px;
  font-family: "Exo 2", sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.description-text {
  font-size: 16px;
  line-height: 1.6;
  color: #e2e8f0;
}

.solutions-section ul {
  list-style: none;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--glass-border);
}
.solutions-section li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  padding-left: 25px;
}
.solutions-section li:last-child {
  border-bottom: none;
}
.solutions-section li::before {
  content: "\f0ad";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 13px;
  color: var(--bmw-blue);
  font-size: 12px;
}

.parts-buttons {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.btn-part {
  flex: 1;
  min-width: 140px;
  padding: 12px;
  background: rgba(0, 102, 179, 0.15);
  border: 1px solid var(--bmw-blue);
  color: #fff;
  border-radius: var(--radius-md);
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
}
.btn-part:hover {
  background: var(--bmw-blue);
  transform: translateY(-2px);
}
.btn-part.secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--glass-border);
}
.btn-part.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
}

.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 30px;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  background: rgba(255, 255, 255, 0.08);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-family: "Exo 2", sans-serif;
  color: #fff;
}

.empty-favs {
  text-align: -webkit-center;
}

/* Карточка результата поиска внутри чата */
.chat-result-link {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 15px;
  margin-bottom: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  text-align: left;
}

.chat-result-link:hover {
  background: rgba(0, 102, 179, 0.2); /* Подсветка BMW Blue */
  border-color: var(--bmw-blue);
  transform: translateX(5px);
}

.chat-result-code {
  font-family: "Exo 2", sans-serif;
  font-weight: 700;
  color: var(--bmw-sky);
  font-size: 15px;
  margin-bottom: 3px;
}

/* Стрелочка в карточке */
.chat-result-link i {
  color: var(--text-muted);
  font-size: 12px;
  transition: 0.2s;
}

.chat-result-link:hover i {
  color: white;
  transform: translateX(3px);
}

/* Empty State & No Results */
/* Empty State & No Results */
.message-container {
  text-align: center;
  padding: 80px 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.05);
  animation: fadeInScale 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0 auto;
  max-width: 600px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.message-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.message-container.hidden {
  display: none;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.98) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.message-container i {
  font-size: 64px;
  margin-bottom: 24px;
  display: inline-block;
  background: linear-gradient(135deg, var(--bmw-blue), #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 10px 20px rgba(0, 102, 179, 0.3));
  animation: iconFloat 4s ease-in-out infinite;
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.message {
  place-self: center;
  font-size: 1rem;
  font-weight: 200;
  color: #fff;
  margin-bottom: 12px;
}

.sub-message {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}

/* --- AI CHAT WIDGET (REMOVED) --- */


/* Favorites Modal */
.favorites-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.favorites-modal.active {
  opacity: 1;
  visibility: visible;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.favorites-content {
  background: #121418;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.favorites-modal.active .favorites-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.favorites-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
}
.favorites-body {
  padding: 10px;
  overflow-y: auto;
}
.close-button {
  background: none;
  border: none;
  color: #aaa;
  font-size: 20px;
  cursor: pointer;
}

/* Footer */
footer {
  margin-top: auto;
  padding: 30px 20px;
  padding-bottom: calc(30px + var(--sab));
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid var(--glass-border);
}


/* Helpers */
.hidden {
  display: none !important;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- AUTH MODAL --- */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center; /* Centered by default */
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 20px; /* Add padding wrapper to prevent touching edges */
}

.auth-modal.active {
  opacity: 1;
  visibility: visible;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.auth-content {
  background: #121418;
  border: 1px solid var(--glass-border);
  width: 90%;
  max-width: 400px; /* Keep this constraint */
  max-height: 90vh; /* Viewport safety */
  overflow-y: auto; /* Enable scrolling */
  display: flex;
  flex-direction: column;
  padding: 30px; /* Keep padding */
  border-radius: 20px;
  position: relative;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-modal.active .auth-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.close-auth {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.close-auth:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transform: rotate(90deg);
}

/* Auth Forms & Inputs */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  color: #8ba4b6;
  font-size: 13px;
  margin-bottom: 8px;
  font-weight: 500;
}

.auth-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 16px;
  color: white;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  transition: all 0.3s ease;
}

.auth-input:focus {
  outline: none;
  border-color: var(--bmw-blue);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 15px rgba(0, 102, 179, 0.2);
}

.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.submit-btn {
  width: 100%;
  padding: 14px;
  background: var(--bmw-blue);
  color: white;
  border: none;
  border-radius: 30px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 10px;
  box-shadow: 0 10px 20px rgba(0, 102, 179, 0.3);
}

.submit-btn:hover {
  background: var(--bmw-dark-blue);
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(0, 102, 179, 0.4);
}

.btn-logout {
  width: 100%;
  padding: 12px;
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: 30px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  margin-top: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 0.2s;
}

.btn-logout:hover {
  background: rgba(231, 76, 60, 0.2);
  border-color: #e74c3c;
}


/* Tabs */
.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 10px;
}
.tab-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 16px;
  cursor: pointer;
  font-family: "Exo 2", sans-serif;
  padding: 5px 10px;
  transition: 0.3s;
}
.tab-btn.active {
  color: white;
  border-bottom: 2px solid var(--bmw-blue);
}

/* Forms */
.auth-form {
  display: none;
  flex-direction: column;
  gap: 15px;
}
.auth-form.active {
  display: flex;
}

.auth-form h2 {
  color: white;
  margin-bottom: 10px;
  font-family: "Exo 2", sans-serif;
}

.input-group {
  position: relative;
}
.input-group i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
}
.input-group input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  padding: 12px 12px 12px 40px;
  border-radius: 10px;
  color: white;
  outline: none;
  transition: 0.3s;
}
.input-group input:focus {
  border-color: var(--bmw-blue);
  background: rgba(255, 255, 255, 0.1);
}

.submit-btn {
  background: var(--bmw-blue);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  margin-top: 10px;
  transition: 0.3s;
}
.submit-btn:hover {
  background: var(--bmw-sky);
}

.auth-msg {
  font-size: 13px;
  text-align: center;
  min-height: 20px;
}

/* Generic Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active {
  opacity: 1;
  visibility: visible;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-content {
  background: #121418;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.9) translateY(20px);
  opacity: 1;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow-y: auto;
  min-height: 200px;
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-content .close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #aaa;
  font-size: 24px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s;
}

.modal-content .close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Footer & Main Layout */
main {
  flex: 1; /* Sticky footer push */
}

footer {
  margin-top: auto;
  background: rgba(0, 0, 0, 0.8);
  border-top: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  width: 100%;
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px;
}

.footer-text {
  margin: 0;
  color: #aaa;
  text-align: center;
}

.footer-subtext {
  font-size: 0.8em;
  color: #666;
  margin: 5px 0 0 0;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--text-muted, #aaa);
  text-decoration: none;
  font-size: 0.9em;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--bmw-blue);
}
/* Report Modal Specifics */
#report-modal {
    z-index: 2000; /* Ensure it's above everything */
}
#report-modal .auth-content {
    background: rgba(18, 20, 24, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
#report-modal textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    resize: vertical;
}
/* --- AdSense Containers --- */
.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    min-height: 90px; /* Default for leaderboard */
    background: rgba(255, 255, 255, 0.02); /* Subtle placeholder bg */
    border: 1px dashed rgba(255, 255, 255, 0.1); /* Helper border for dev (remove later if needed) */
    border-radius: var(--radius-md);
}

.ad-container.ad-header {
    margin-top: 20px;
    margin-bottom: 20px;
    max-width: 728px;
}

.ad-container.ad-footer {
    margin-top: 40px;
    margin-bottom: 20px;
    max-width: 728px;
}

.ad-container.ad-sidebar {
    min-height: 250px;
    max-width: 300px;
}

.ad-container.ad-in-content {
    margin: 30px auto;
    max-width: 728px;
}

/* Mobile Adjustments for Ads */
@media (max-width: 768px) {
    .ad-container {
        min-height: 50px;
    }
    .ad-container.ad-sidebar {
        margin: 20px auto; /* Center sidebar ads on mobile if stacked */
    }
}
