@import url(https://fonts.googleapis.com/css2?family=Titillium+Web:wght@300;400;600;700&display=swap);
:root {
  --bg-main: #0b0d10;
  --bg-panel: rgba(21, 25, 31, 0.85);
  --text-main: #ffffff;
  --text-dim: #949ca6;
  --primary-red: #e10600;
  --accent-gold: #ffd700;
  --accent-cyan: #00d2be;
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --navbar-bg: rgba(0, 0, 0, 0.95);
  --overlay-color: rgba(0, 0, 0, 0.5);
  --input-bg: #000;
  --input-border: #444;
}

.light-mode {
  --bg-main: #f0f2f5;
  --bg-panel: rgba(255, 255, 255, 0.85);
  --text-main: #1a1d23;
  --text-dim: #5f6368;
  --primary-red: #e10600;
  --accent-gold: #d4af37;
  --glass-border: 1px solid rgba(0, 0, 0, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --navbar-bg: rgba(255, 255, 255, 0.95);
  --overlay-color: rgba(255, 255, 255, 0.6);
  --input-bg: #ffffff;
  --input-border: #ccc;
}

body {
  margin: 0;
  font-family: 'Titillium Web', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;

  /* Mobile Safe Areas - left/right/bottom only; top is handled by navbar */
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-red);
  border-radius: 3px;
}

/* --- NAVBAR --- */
.f1-navbar {
  /* Semi-transparent black background with blur */
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);

  /* Height & Layout */
  height: 60px;
  padding: 12px 40px;
  /* Safe area: push content below Dynamic Island / notch */
  padding-top: calc(12px + env(safe-area-inset-top));
  display: flex;
  justify-content: space-between;
  align-items: center;

  /* Bottom border: thinner (2px) & shadow */
  border-bottom: 2px solid var(--primary-red);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);

  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background 0.3s ease;
}

/* LEFT: LOGO */
.nav-logo {
  flex: 0 0 auto;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-main);
  margin-right: 40px;
}

.nav-logo span {
  color: var(--primary-red);
}

/* CENTER: MAIN LINKS */
.nav-center {
  flex: 1;
  display: flex;
  justify-content: flex-start;
  gap: 24px;
  align-items: center;
}

/* Desktop nav visible by default, mobile nav hidden */
.nav-center.desktop-nav {
  display: flex;
}

.nav-center.mobile-nav {
  display: none;
}

/* RIGHT: SECONDARY LINKS */
.nav-right {
  flex: 0 0 auto;
  display: flex;
  gap: 24px;
  align-items: center;
}

/* LINKS STYLING */
.nav-link {
  color: #A8AEB7;
  /* Gray by default */
  font-weight: 600;
  /* Normal weight */
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
  transition: color 0.25s ease, font-weight 0.25s ease;
  padding: 5px 0;
  position: relative;
  text-decoration: none;
}

/* Hover: Turn Red */
.nav-link:hover {
  color: #E10600;
}

/* Active: White + Bold + Red Underline */
.nav-link.active {
  color: #ffffff;
  font-weight: 800;
  /* Bolder */
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  /* Position slightly below */
  left: 0;
  width: 0;
  height: 2px;
  /* Thinner underline */
  background: var(--primary-red);
  transition: width 0.25s ease;
}

/* Active state underline */
.nav-link.active::after {
  width: 100%;
  /* or shorten it? User: "kısalt ve incelt". Full width of word is standard, maybe slightly less? Let's stick to 100% of word. */
}

/* HOVER DROPDOWN */
.nav-dropdown-container {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.dropdown-trigger {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(15, 15, 15, 0.95);
  /* Very dark, slightly transparent */
  backdrop-filter: blur(10px);
  padding: 10px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 2px solid var(--primary-red);
  border-radius: 0 0 8px 8px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.nav-dropdown-container:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu {
  max-height: 70vh;
  overflow-y: auto;
}

.dropdown-item {
  color: #A8AEB7;
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: 0.2s;
  border-left: 2px solid transparent;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
  border-left-color: var(--primary-red);
}

.dropdown-item.active {
  color: white;
  border-left-color: var(--primary-red);
  background: rgba(225, 6, 0, 0.1);
}

/* Hover underline effect (optional based on preference, user didn't explicitly forbid, but user focus is on color change. Let's keep underline for active only to be clean, or hover too? Commonly hover shows color, active shows line. Let's keep line for active.) */
.nav-link:hover::after {
  width: 0;
}

.home-container {
  position: relative;
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url(/assets/94195999175ffb6bf9a6.jpg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  background-color: var(--bg-main);
  opacity: 0.4;
  filter: blur(8px);
}

.hero-background::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, var(--overlay-color) 0%, var(--bg-main) 100%);
  z-index: 1;
  transition: background 0.3s;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 1200px;
  width: 90%;
  padding-top: calc(120px + env(safe-area-inset-top));
  padding-bottom: 40px;
}

.hero-title {
  font-size: 4.5rem;
  font-weight: 800;
  margin: 0;
  text-transform: uppercase;
  line-height: 1.1;
  letter-spacing: -1px;
  color: var(--text-main);
}

.highlight-text {
  color: var(--primary-red);
  text-shadow: 0 0 30px rgba(225, 6, 0, 0.4);
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-dim);
  margin: 20px auto 50px;
  max-width: 700px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.countdown-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-panel);
  border: var(--glass-border);
  padding: 25px 50px;
  border-radius: 20px;
  backdrop-filter: blur(15px);
  margin-bottom: 60px;
  box-shadow: var(--glass-shadow);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.timer {
  display: flex;
  gap: 40px;
  margin-top: 15px;
  justify-content: center;
}

.time-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.time-unit span {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.time-unit small {
  font-size: 0.8rem;
  color: var(--accent-gold);
  margin-top: 5px;
  letter-spacing: 2px;
  font-weight: bold;
  text-transform: uppercase;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  padding-bottom: 50px;
}

.feature-card {
  background: var(--bg-panel);
  border: var(--glass-border);
  padding: 30px;
  border-radius: 15px;
  text-align: left;
  transition: 0.3s;
  text-decoration: none;
  backdrop-filter: blur(10px);
}

.feature-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary-red);
  box-shadow: 0 10px 30px rgba(225, 6, 0, 0.15);
}

.feature-card h3 {
  color: var(--text-main);
  margin: 15px 0;
  font-size: 1.5rem;
}

.feature-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.card-link {
  color: var(--primary-red);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.telemetry-page {
  /* Subtract navbar height + padding + safe area */
  height: calc(100vh - 90px - env(safe-area-inset-top));
  margin-top: calc(90px + env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
}

.control-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(15px);
  padding: 15px 30px;
  display: flex;
  align-items: flex-end;
  gap: 20px;
  border-bottom: var(--glass-border);
  z-index: 10;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-group label {
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.f1-select {
  appearance: none;
  background-color: var(--input-bg);
  color: var(--text-main);
  padding: 10px 15px;
  padding-right: 35px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  min-width: 180px;
  cursor: pointer;
  transition: 0.3s;
  font-family: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%23999%27 stroke-width=%272%27%3E%3Cpolyline points=%276 9 12 15 18 9%27%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}

.f1-select:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 10px rgba(225, 6, 0, 0.3);
}

.f1-select option {
  background-color: var(--bg-main);
}

.f1-button {
  background: var(--primary-red);
  color: white;
  border: none;
  padding: 0 20px;
  height: 42px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.f1-button:hover {
  background: #ff1a1a;
  box-shadow: 0 0 15px rgba(225, 6, 0, 0.5);
}

.f1-button:active {
  transform: scale(0.98);
}

.btn-analyze {
  background: var(--primary-red);
  color: white;
  border: none;
  padding: 0 30px;
  height: 40px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
  letter-spacing: 1px;
}

.btn-analyze:hover {
  background: #ff1a1a;
  box-shadow: 0 0 15px rgba(225, 6, 0, 0.5);
}

.btn-analyze:disabled {
  background: #333;
  cursor: not-allowed;
  box-shadow: none;
}

.telemetry-content {
  padding: 20px;
  flex: 1;
  display: flex;
  gap: 20px;
  overflow-y: auto;
}

.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(15px);
  border: var(--glass-border);
  border-radius: 12px;
  box-shadow: var(--glass-shadow);
  position: relative;
  display: flex;
  flex-direction: column;
}

.metrics-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.1);
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 10px;
  align-self: center;
}

.metric-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  padding: 6px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  transition: 0.3s;
}

.metric-btn.active {
  background: var(--primary-red);
  color: white;
}

.metric-btn:hover:not(.active) {
  color: var(--text-main);
  border-color: var(--text-dim);
}

.chart-wrapper {
  flex: 1;
  width: 100%;
  min-width: 0;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

.chart-container-inner {
  width: 100%;
  height: 100%;
}

.empty-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary-red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: block;
  margin: 40px auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Fix for loading spinner inside buttons */
button .loading-spinner,
.btn-analyze .loading-spinner,
.f1-button .loading-spinner {
  width: 20px;
  height: 20px;
  border-width: 2px;
  margin: 0 auto;
  display: inline-block;
  vertical-align: middle;
}

.drivers-page {
  padding: 40px;
  max-width: 1400px;
  margin: calc(100px + env(safe-area-inset-top)) auto 0 auto;
  /* Added top margin to clear navbar */
  height: auto;
}

.page-header {
  margin-bottom: 40px;
}

.page-header h1 {
  color: var(--text-main);
}

.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 30px;
}

.team-card {
  background: var(--bg-panel);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  overflow: hidden;
  border: var(--glass-border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.team-header {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.team-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-main);
}

.team-info-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.team-info-tag {
  font-size: 0.7rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.team-car-container {
  padding: 10px 20px;
  display: flex;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
}

.team-car-img {
  width: 85%;
  max-height: 120px;
  object-fit: contain;
}

.drivers-container {
  display: flex;
  justify-content: center;
  padding: 20px;
  gap: 15px;
}

.driver-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.driver-number {
  font-size: 2.5rem;
  font-weight: 900;
  opacity: 0.2;
  position: absolute;
  top: 0;
  right: 10px;
  line-height: 1;
  color: var(--text-main);
}

.driver-img-wrapper {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid;
  margin-bottom: 15px;
  margin-top: 10px;
  background: #111;
  z-index: 1;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.driver-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.driver-name {
  font-size: 0.9rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.driver-standing-img {
  width: 120px;
  height: 160px;
  object-fit: contain;
  margin-bottom: 10px;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.4));
}

.driver-lastname {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  text-transform: uppercase;
  line-height: 1;
}

@media (max-width: 600px) {
  .teams-grid {
    grid-template-columns: 1fr;
  }

  .drivers-container {
    flex-direction: row;
  }

  .driver-img-wrapper {
    width: 90px;
    height: 90px;
  }
}

.team-name-text {
  color: var(--text-main) !important;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-glass-card {
  background: var(--bg-panel);
  backdrop-filter: blur(15px);
  border: var(--glass-border);
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  max-width: 900px;
  margin: 0 auto 60px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-title {
  font-size: 4rem;
  font-weight: 900;
  margin: 0 0 20px 0;
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--text-main);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 40px;
  max-width: 700px;
  line-height: 1.6;
}

.countdown-section {
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.next-race-title {
  margin-bottom: 10px;
  font-size: 1.2rem;
  color: var(--accent-gold);
  letter-spacing: 2px;
  font-weight: 700;
  text-transform: uppercase;
}

.timer {
  display: flex;
  gap: 50px;
  justify-content: center;
}

.time-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.time-unit span {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.time-unit small {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 8px;
  letter-spacing: 2px;
  font-weight: bold;
  text-transform: uppercase;
}

.feature-grid {
  padding-bottom: 50px;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s;
}

.modal-content {
  background: #15191f;
  padding: 30px;
  border-radius: 15px;
  width: 90%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  color: white;
  text-align: center;
  animation: slideUp 0.3s;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 1.5rem;
  cursor: pointer;
}

.close-btn:hover {
  color: white;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 20px;
  text-align: left;
  margin-bottom: 20px;
}

.modal-driver-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 40% 10%;
  border: 3px solid #333;
  overflow: hidden;
}

.modal-title {
  margin: 0;
  font-size: 2rem;
  text-transform: uppercase;
  line-height: 1;
}

.modal-team {
  color: #aaa;
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 5px;
}

.modal-number {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 4rem;
  font-weight: 900;
  z-index: 0;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 10px;
}

.stat-box h3 {
  margin: 0;
  font-size: 1.8rem;
  color: white;
}

.stat-box p {
  margin: 5px 0 0;
  font-size: 0.8rem;
  color: #888;
  letter-spacing: 1px;
  font-weight: bold;
}

.clickable {
  cursor: pointer;
  transition: transform 0.2s;
}

.clickable:hover {
  transform: scale(1.05);
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}


.modal-car-container {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
  border-radius: 10px;
}

.modal-car-img {
  max-width: 90%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.5));
}


.team-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  text-align: left;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.detail-item span {
  display: block;
  font-size: 0.7rem;
  color: var(--accent-gold);
  font-weight: bold;
  margin-bottom: 2px;
}

.detail-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  border-radius: 8px;
}

/* CTA Custom Button */
.cta-button {
  display: inline-block;
  background: linear-gradient(90deg, var(--primary-red), #ff4d4d);
  color: white;
  padding: 18px 50px;
  font-size: 1.2rem;
  font-weight: 800;
  border-radius: 30px;
  text-decoration: none;
  box-shadow: 0 0 20px rgba(225, 6, 0, 0.4);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cta-button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 0 30px rgba(225, 6, 0, 0.6);
  background: linear-gradient(90deg, #ff1a1a, var(--primary-red));
}

@media (max-width: 600px) {
  .hero-glass-card {
    padding: 20px;
    width: 95%;
  }

  .timer {
    gap: 20px;
  }

  .time-unit span {
    font-size: 2rem;
  }

  .hero-title {
    font-size: 2.5rem;
  }
}

/* --- TELEMETRY PANELS --- */
.telemetry-left-panel {
  flex: 1;
  min-width: 350px;
}

.telemetry-right-panel {
  flex: 2;
  min-width: 0;
  padding: 10px 20px 20px 20px;
}

/* --- CHART PAGE CONTAINERS (used by analysis pages) --- */
.chart-page-container {
  width: 100%;
  max-width: 1100px;
  height: 500px;
  position: relative;
}

.chart-square-container {
  width: 600px;
  height: 600px;
  max-width: 100%;
  margin: 0 auto;
}

/* --- TRACK MAP --- */
.track-map-container {
  height: 100%;
  min-height: 300px;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

/* --- WEATHER WIDGET --- */
.weather-widget {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  padding: 15px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

/* =============================================================
   MOBILE RESPONSIVE - CAPACITOR / PHONE LAYOUT
   ============================================================= */

/* --- HAMBURGER BUTTON --- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1100;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-main);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.hamburger-line.open:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-line.open:nth-child(2) {
  opacity: 0;
}

.hamburger-line.open:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- OVERLAY BEHIND MOBILE NAV --- */
.nav-overlay {
  display: none;
}

/* --- MOBILE NAV FOOTER (theme toggle inside menu) --- */
.mobile-nav-footer {
  display: none;
}

/* =============================================================
   MOBILE BREAKPOINT: <= 768px
   ============================================================= */
@media (max-width: 768px) {

  /* --- NAVBAR --- */
  .f1-navbar {
    padding: 10px 16px;
    padding-top: calc(10px + env(safe-area-inset-top));
    height: 50px;
  }

  .nav-logo {
    font-size: 1.3rem;
    margin-right: 0;
  }

  .hamburger {
    display: flex;
  }

  /* Hide desktop nav and theme toggle on mobile */
  .nav-right {
    display: none;
  }

  .nav-center.desktop-nav {
    display: none;
  }

  /* --- MOBILE SLIDE-OUT MENU --- */
  .nav-center.mobile-nav {
    display: flex;
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: rgba(10, 12, 16, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: calc(80px + env(safe-area-inset-top)) 0 30px 0;
    gap: 0;
    overflow-y: auto;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-center.mobile-nav.mobile-open {
    right: 0;
  }

  .nav-center.mobile-nav .nav-link {
    padding: 14px 24px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    box-sizing: border-box;
  }

  .nav-center.mobile-nav .nav-link.active {
    background: rgba(225, 6, 0, 0.1);
    border-left: 3px solid var(--primary-red);
  }

  .nav-center.mobile-nav .nav-link::after {
    display: none;
  }

  /* Hide desktop dropdown — all links are flat in mobile menu */
  .nav-dropdown-container {
    display: none;
  }

  /* Mobile nav footer (theme toggle) */
  .mobile-nav-footer {
    display: flex;
    padding: 20px 24px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .mobile-nav-footer .theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    width: 100%;
    cursor: pointer;
  }

  /* Overlay */
  .nav-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
  }

  /* --- TELEMETRY PAGE --- */
  .telemetry-page {
    height: auto;
    min-height: calc(100vh - 70px - env(safe-area-inset-top));
    margin-top: calc(70px + env(safe-area-inset-top));
  }

  .control-panel {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .control-group {
    flex: 1 1 calc(50% - 10px);
    min-width: 0;
  }

  .f1-select {
    min-width: 0;
    width: 100%;
    padding: 8px 30px 8px 10px;
    font-size: 0.85rem;
  }

  .btn-analyze {
    width: 100%;
    flex: 1 1 100%;
    height: 44px;
    font-size: 0.9rem;
  }

  .telemetry-content {
    flex-direction: column;
    padding: 12px;
    gap: 12px;
    overflow-y: auto;
  }

  .glass-panel {
    min-width: 0 !important;
    width: 100% !important;
    flex: none !important;
  }

  .glass-panel[style] {
    min-width: 0 !important;
    flex: none !important;
  }

  .telemetry-left-panel {
    min-width: 0 !important;
    width: 100% !important;
    flex: none !important;
    max-height: 320px;
    overflow: hidden;
  }

  .telemetry-right-panel {
    min-width: 0 !important;
    width: 100% !important;
    flex: none !important;
    padding: 10px 12px 20px 12px !important;
  }

  .track-map-container {
    min-height: 200px;
    height: 300px;
    padding: 5px;
  }

  /* --- WEATHER WIDGET MOBILE --- */
  .weather-widget {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    justify-content: center;
  }

  .weather-widget>div {
    flex: 0 0 calc(33% - 10px);
    min-width: 70px;
  }

  .weather-widget>div>div:first-child {
    font-size: 1.3rem !important;
  }

  .weather-widget>div>div:nth-child(2) {
    font-size: 0.95rem !important;
  }

  .metrics-bar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px;
  }

  .metric-btn {
    padding: 6px 10px;
    font-size: 0.7rem;
  }

  .chart-wrapper {
    min-height: 300px;
    max-height: 500px;
    height: 400px;
    flex: none !important;
  }

  .chart-container-inner {
    min-height: 200px !important;
    max-height: 100% !important;
    height: auto !important;
  }

  /* --- HOME PAGE --- */
  .home-container {
    min-height: calc(100vh - 70px);
  }

  .hero-content {
    padding-top: calc(80px + env(safe-area-inset-top));
    padding-bottom: 20px;
    width: 95%;
  }

  .hero-title {
    font-size: 2rem !important;
  }

  .hero-subtitle {
    font-size: 0.95rem;
    margin-bottom: 25px;
  }

  .hero-glass-card {
    padding: 16px;
    width: 95%;
    margin-bottom: 30px;
  }

  .countdown-box {
    padding: 15px 20px;
  }

  .timer {
    gap: 15px;
  }

  .time-unit span {
    font-size: 1.8rem;
  }

  .time-unit small {
    font-size: 0.65rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    padding-bottom: 30px;
  }

  .feature-card {
    padding: 20px;
  }

  .feature-card h3 {
    font-size: 1.2rem;
  }

  .cta-button {
    padding: 14px 30px;
    font-size: 1rem;
  }

  /* --- DRIVERS PAGE --- */
  .drivers-page {
    padding: 16px;
    margin-top: calc(70px + env(safe-area-inset-top));
  }

  .teams-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .drivers-container {
    padding: 15px;
    gap: 10px;
  }

  .driver-img-wrapper {
    width: 80px;
    height: 80px;
  }

  .driver-lastname {
    font-size: 1.1rem;
  }

  .driver-name {
    font-size: 0.75rem;
  }

  .driver-number {
    font-size: 1.8rem;
  }

  /* --- STANDINGS / RESULTS TABLES --- */
  table {
    font-size: 0.8rem;
  }

  table th,
  table td {
    padding: 10px 8px !important;
  }

  /* --- MODALS --- */
  .modal-content {
    width: 95%;
    padding: 20px;
  }

  .modal-title {
    font-size: 1.5rem;
  }

  .modal-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 15px;
  }

  .stat-box h3 {
    font-size: 1.4rem;
  }

  .modal-driver-img {
    width: 70px;
    height: 70px;
  }

  .modal-number {
    font-size: 2.5rem;
  }

  /* --- RACE REPLAY --- */
  .race-replay-container {
    margin-top: calc(70px + env(safe-area-inset-top)) !important;
    padding: 12px !important;
  }

  .selection-panel {
    flex-wrap: wrap !important;
    gap: 10px !important;
    padding: 12px !important;
  }

  .selection-panel select {
    min-width: 0 !important;
    width: 100%;
  }

  .selection-panel>div {
    flex: 1 1 100%;
  }

  .selection-panel button {
    width: 100%;
  }

  /* --- ANALYSIS CARD (Telemetry) --- */
  .analysis-card {
    padding: 15px !important;
  }

  /* --- GENERAL SPACING OVERRIDES --- */
  .empty-state h3 {
    font-size: 1.1rem;
  }

  .empty-state p {
    font-size: 0.85rem;
  }

  .empty-icon {
    font-size: 2.5rem;
  }

  /* --- PREDICTIONS PAGE --- */
  .predictions-container {
    padding: 12px;
  }

  /* --- CIRCUIT GUIDE --- */
  .circuit-info-grid {
    grid-template-columns: 1fr !important;
  }

  /* =============================================================
     CHART & ANALYSIS PAGE CONTAINERS - MOBILE
     ============================================================= */

  .chart-page-container {
    width: 100% !important;
    max-width: 100% !important;
    height: 300px !important;
  }

  .chart-square-container {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1;
    max-height: 350px;
  }

  /* Force all direct children of telemetry-content to be full-width */
  .telemetry-content>div,
  .telemetry-content>div>div {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Prevent horizontal overflow on all pages */
  main {
    overflow-x: hidden;
  }

  .app-container {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Force body-level overflow protection */
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }
}

/* =============================================================
   EXTRA SMALL SCREENS (< 400px)
   ============================================================= */
@media (max-width: 400px) {
  .f1-navbar {
    padding: 8px 12px;
    padding-top: calc(8px + env(safe-area-inset-top));
    height: 45px;
  }

  .nav-logo {
    font-size: 1.1rem;
  }

  .control-group {
    flex: 1 1 100%;
  }

  .hero-title {
    font-size: 1.6rem !important;
  }

  .timer {
    gap: 10px;
  }

  .time-unit span {
    font-size: 1.5rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .teams-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════
   LIVE DASHBOARD STYLES
   ═══════════════════════════════════════════════ */

/* ── Navbar LIVE link ── */
.nav-link-live {
  color: #e10600 !important;
  font-weight: 800 !important;
}

.live-nav-dot {
  display: inline-block;
  animation: livePulse 1.5s ease-in-out infinite;
  font-size: 0.7em;
  margin-right: 2px;
}

@keyframes livePulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

/* ── Home card ── */
.feature-card-live {
  border: 1px solid rgba(225, 6, 0, 0.3) !important;
  background: linear-gradient(135deg, rgba(225, 6, 0, 0.08), var(--bg-panel)) !important;
}

.feature-card-live:hover {
  border-color: #e10600 !important;
  box-shadow: 0 10px 40px rgba(225, 6, 0, 0.25) !important;
}

.live-pulse-icon {
  animation: livePulse 1.5s ease-in-out infinite;
}

/* ── Beta banner ── */
.live-beta-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  background: rgba(255, 152, 0, 0.08);
  border-bottom: 1px solid rgba(255, 152, 0, 0.2);
  color: #ffb74d;
  font-size: 0.78rem;
  letter-spacing: 0.3px;
}

.live-beta-tag {
  background: #ff9800;
  color: #000;
  font-weight: 800;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 1.5px;
  flex-shrink: 0;
}

/* ── Control bar ── */
.live-control-panel {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.live-status-section {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.3);
}

.live-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #666;
  transition: background 0.3s;
}

.live-status-dot.connected {
  background: #4caf50;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}

.live-status-dot.connecting {
  background: #ff9800;
  animation: livePulse 1s ease-in-out infinite;
}

.live-status-dot.disconnected {
  background: #e10600;
}

.live-status-text {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.live-badge-container {
  margin-left: auto;
}

.live-badge {
  background: #e10600;
  color: #fff;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 1px;
  padding: 5px 14px;
  border-radius: 4px;
  animation: liveBadgePulse 2s ease-in-out infinite;
}

@keyframes liveBadgePulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(225, 6, 0, 0.4);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(225, 6, 0, 0);
  }
}

/* ── Dashboard Grid ── */
.live-dashboard-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 15px;
  width: 100%;
  min-height: 0;
}

.live-col-left {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.live-col-right {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 0;
}

.live-panel-row {
  display: flex;
  gap: 15px;
}

.live-panel-row>* {
  flex: 1;
  min-width: 0;
}

/* ── Panel title ── */
.panel-title {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 12px 15px;
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Position Tower ── */
.position-tower {
  overflow: hidden;
}

.position-tower-header {
  display: flex;
  align-items: center;
  padding: 6px 15px 6px 20px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.position-tower-body {
  overflow-y: auto;
  max-height: calc(100vh - 260px);
}

.position-row {
  display: flex;
  align-items: center;
  padding: 8px 15px 8px 0;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.position-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.position-row.selected {
  background: rgba(225, 6, 0, 0.1);
  border-left: 0;
}

.position-row.selected .team-color-bar {
  box-shadow: 0 0 6px currentColor;
}

.team-color-bar {
  width: 4px;
  height: 100%;
  min-height: 28px;
  border-radius: 0 2px 2px 0;
  margin-right: 10px;
  flex-shrink: 0;
}

.pt-col {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.pt-pos {
  width: 28px;
  text-align: center;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.pt-driver {
  flex: 1;
  min-width: 0;
}

.driver-code {
  font-weight: 700;
  color: #fff;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
}

.pt-gap,
.pt-int {
  width: 75px;
  text-align: right;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.pt-tyre {
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  margin-left: 6px;
}

.tyre-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.3);
}

/* ── Strategy Panel ── */
.strategy-panel {
  overflow: hidden;
}

.strategy-legend {
  display: flex;
  gap: 12px;
  padding: 8px 15px;
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 600;
}

.strategy-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.strategy-bars {
  padding: 0 15px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 300px;
  overflow-y: auto;
}

.strategy-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.strategy-driver-code {
  width: 35px;
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-align: right;
  flex-shrink: 0;
}

.strategy-bar-track {
  flex: 1;
  height: 16px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.strategy-stint-block {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}

.stint-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.55rem;
  font-weight: 800;
  color: #000;
}

/* ── Race Control Feed ── */
.rc-feed {
  overflow: hidden;
}

.rc-feed-body {
  max-height: 200px;
  overflow-y: auto;
  padding: 8px 0;
}

.rc-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 15px;
  font-size: 0.8rem;
  transition: background 0.15s;
}

.rc-message:hover {
  background: rgba(255, 255, 255, 0.02);
}

.rc-time {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 55px;
}

.rc-icon {
  flex-shrink: 0;
  font-size: 0.85rem;
}

.rc-text {
  color: #fff;
  flex: 1;
  line-height: 1.35;
}

.rc-driver {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Weather Card ── */
.weather-card {
  min-width: 200px;
}

.weather-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 10px 12px;
}

.weather-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
}

.weather-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.weather-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.rain-active {
  color: #0091ff !important;
}

.wind-dir {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.8rem;
  transition: transform 0.3s;
}

/* ── Telemetry Panel ── */
.live-telemetry-panel,
.live-chart-panel {
  padding: 0;
  overflow: hidden;
}

.live-telemetry-panel canvas,
.live-chart-panel canvas {
  padding: 10px;
}

/* ── Mobile Responsive — Tablets (≤ 768px) ── */
@media (max-width: 768px) {
  .live-dashboard-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .live-panel-row {
    flex-direction: column;
    gap: 10px;
  }

  .live-control-panel {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }

  .live-control-panel .control-group {
    flex: 1;
    min-width: 140px;
  }

  .live-control-panel .control-group label {
    font-size: 0.6rem;
  }

  .live-control-panel .f1-select {
    font-size: 0.75rem;
    padding: 6px 8px;
  }

  .live-control-panel .btn-analyze {
    padding: 6px 14px;
    font-size: 0.7rem;
    min-width: auto;
  }

  .live-badge-container {
    margin-left: auto;
  }

  .live-beta-banner {
    font-size: 0.72rem;
    padding: 6px 12px;
    gap: 8px;
  }

  .live-beta-tag {
    font-size: 0.6rem;
    padding: 2px 6px;
  }

  /* Panel titles */
  .panel-title {
    font-size: 0.78rem;
    padding: 10px 12px;
    letter-spacing: 1px;
  }

  /* Position tower */
  .position-tower-body {
    max-height: 400px;
  }

  .position-row {
    padding: 10px 12px 10px 0;
    min-height: 44px;
  }

  .pt-pos {
    font-size: 0.9rem;
    width: 26px;
  }

  .driver-code {
    font-size: 0.85rem;
  }

  .pt-gap,
  .pt-int {
    width: 65px;
    font-size: 0.72rem;
  }

  .pt-tyre {
    width: 22px;
    margin-left: 4px;
  }

  .tyre-dot {
    width: 14px;
    height: 14px;
  }

  /* Strategy */
  .strategy-bars {
    padding: 0 12px 10px;
    max-height: 250px;
  }

  .strategy-row {
    gap: 6px;
  }

  .strategy-driver-code {
    width: 32px;
    font-size: 0.65rem;
  }

  .strategy-bar-track {
    height: 14px;
  }

  .strategy-legend {
    gap: 8px;
    padding: 6px 12px;
    font-size: 0.65rem;
  }

  /* Race control */
  .rc-feed-body {
    max-height: 180px;
  }

  .rc-message {
    padding: 6px 12px;
    font-size: 0.76rem;
    gap: 6px;
  }

  .rc-time {
    font-size: 0.65rem;
    min-width: 48px;
  }

  /* Weather */
  .weather-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding: 8px 10px;
  }

  .weather-item {
    padding: 6px 2px;
  }

  .weather-label {
    font-size: 0.55rem;
  }

  .weather-value {
    font-size: 0.85rem;
  }

  /* Charts */
  .live-chart-panel div[style*="height"],
  .live-telemetry-panel div[style*="height"] {
    height: 200px !important;
  }
}

/* ── Mobile Responsive — Phones (≤ 480px) ── */
@media (max-width: 480px) {
  .live-dashboard-grid {
    gap: 8px;
  }

  .live-control-panel {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 10px;
  }

  .live-control-panel .control-group {
    min-width: 0;
    width: 100%;
  }

  .live-status-section {
    padding: 5px 10px;
    gap: 6px;
  }

  .live-status-text {
    font-size: 0.62rem;
  }

  .live-badge {
    font-size: 0.65rem;
    padding: 4px 10px;
  }

  .live-badge-container {
    margin-left: 0;
    text-align: center;
  }

  .live-beta-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    font-size: 0.68rem;
    padding: 6px 10px;
  }

  /* Panel titles compact */
  .panel-title {
    font-size: 0.72rem;
    padding: 8px 10px;
  }

  /* Position tower — hide INT column on small screens */
  .position-tower-header .pt-int {
    display: none;
  }

  .position-row .pt-int {
    display: none;
  }

  .position-tower-body {
    max-height: 350px;
  }

  .position-row {
    padding: 8px 8px 8px 0;
    min-height: 42px;
  }

  .pt-pos {
    width: 24px;
    font-size: 0.82rem;
  }

  .driver-code {
    font-size: 0.78rem;
  }

  .pt-gap {
    width: 60px;
    font-size: 0.68rem;
  }

  .team-color-bar {
    width: 3px;
    margin-right: 6px;
  }

  /* Strategy compact */
  .strategy-bars {
    padding: 0 8px 8px;
    max-height: 220px;
    gap: 3px;
  }

  .strategy-driver-code {
    width: 28px;
    font-size: 0.6rem;
  }

  .strategy-bar-track {
    height: 12px;
  }

  .stint-label {
    font-size: 0.5rem;
  }

  .strategy-legend {
    gap: 6px;
    padding: 4px 8px;
    font-size: 0.6rem;
    flex-wrap: wrap;
  }

  /* Race control compact */
  .rc-feed-body {
    max-height: 160px;
  }

  .rc-message {
    padding: 5px 8px;
    font-size: 0.72rem;
  }

  .rc-time {
    font-size: 0.6rem;
    min-width: 42px;
  }

  .rc-icon {
    font-size: 0.75rem;
  }

  .rc-driver {
    font-size: 0.6rem;
  }

  /* Weather 2-col on small phones */
  .weather-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    padding: 6px 8px;
  }

  .weather-label {
    font-size: 0.5rem;
  }

  .weather-value {
    font-size: 0.8rem;
  }

  /* Charts smaller on phones */
  .live-chart-panel div[style*="height"],
  .live-telemetry-panel div[style*="height"] {
    height: 170px !important;
  }

  .live-telemetry-panel canvas,
  .live-chart-panel canvas {
    padding: 6px;
  }

  /* Empty states compact */
  .live-dashboard-grid .empty-state {
    padding: 18px 10px !important;
  }

  .live-dashboard-grid .empty-icon {
    font-size: 1.5rem;
  }

  .live-dashboard-grid .empty-state p {
    font-size: 0.78rem !important;
  }
}

/* ── Capacitor / Safe Areas ── */
@supports (padding: env(safe-area-inset-top)) {
  .telemetry-page .live-control-panel {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .telemetry-page .live-beta-banner {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
}

/* ── Prevent horizontal overflow everywhere ── */
.live-dashboard-grid,
.live-col-left,
.live-col-right,
.position-tower,
.strategy-panel,
.rc-feed,
.weather-card,
.live-chart-panel,
.live-telemetry-panel {
  overflow-x: hidden;
  max-width: 100%;
}

/* ── Touch-friendly scrollbars (thin for mobile) ── */
.position-tower-body,
.strategy-bars,
.rc-feed-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.position-tower-body::-webkit-scrollbar,
.strategy-bars::-webkit-scrollbar,
.rc-feed-body::-webkit-scrollbar {
  width: 4px;
}

.position-tower-body::-webkit-scrollbar-thumb,
.strategy-bars::-webkit-scrollbar-thumb,
.rc-feed-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

/* ── Smooth touch scrolling (iOS) ── */
.position-tower-body,
.strategy-bars,
.rc-feed-body {
  -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════════════════════════════════
   PAYWALL MODAL
   ═══════════════════════════════════════════════════════════ */

.paywall-modal {
  background: linear-gradient(145deg, #15191f 0%, #1a1f28 100%);
  padding: 40px 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 420px;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(225, 6, 0, 0.08);
  color: white;
  text-align: center;
  animation: slideUp 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.paywall-badge {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e10600, #ff4444);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 0 25px rgba(225, 6, 0, 0.4);
}

.paywall-title {
  font-size: 1.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0 0 8px;
}

.paywall-highlight {
  background: linear-gradient(90deg, #e10600, #ff6b35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.paywall-feature-name {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0 0 24px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.paywall-features {
  text-align: left;
  margin: 0 auto 28px;
  max-width: 300px;
}

.paywall-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.paywall-cta {
  background: linear-gradient(135deg, #e10600, #ff2a2a);
  color: white;
  border: none;
  padding: 14px 40px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 300px;
  font-family: inherit;
}

.paywall-cta:hover {
  background: linear-gradient(135deg, #ff1a1a, #ff4444);
  box-shadow: 0 0 25px rgba(225, 6, 0, 0.5);
  transform: translateY(-1px);
}

.paywall-cta:active {
  transform: translateY(0);
}

.paywall-cta:disabled {
  background: #333;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.paywall-subtext {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin: 14px 0 0;
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════
   PREMIUM GUARD (Locked Page Overlay)
   ═══════════════════════════════════════════════════════════ */

.premium-locked-container {
  position: relative;
  min-height: 60vh;
}

.premium-blurred-preview {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
  opacity: 0.4;
}

.premium-locked-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.premium-locked-content {
  background: var(--bg-panel);
  backdrop-filter: blur(15px);
  border: var(--glass-border);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  box-shadow: var(--glass-shadow);
  max-width: 400px;
}

.premium-lock-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(225, 6, 0, 0.2), rgba(225, 6, 0, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  border: 2px solid rgba(225, 6, 0, 0.3);
  color: var(--primary-red);
}

.premium-locked-title {
  font-size: 1.4rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0 0 12px;
  color: var(--text-main);
}

.premium-locked-desc {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 0 0 24px;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════
   PAYWALL RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .paywall-modal {
    padding: 30px 20px;
    width: 95%;
  }

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

  .paywall-cta {
    padding: 12px 30px;
    font-size: 0.9rem;
  }

  .premium-locked-content {
    padding: 25px;
    margin: 0 16px;
  }
}

@media (max-width: 400px) {
  .paywall-modal {
    padding: 24px 16px;
  }

  .paywall-badge {
    width: 50px;
    height: 50px;
  }

  .paywall-title {
    font-size: 1.15rem;
  }
}

/* ═══════════════════════════════════════════════════════════
   PRO BADGE on Feature Cards
   ═══════════════════════════════════════════════════════════ */

.feature-card-pro {
  position: relative;
}

.pro-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #e10600, #ff4444);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 3px;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(225, 6, 0, 0.3);
}

/* Subtle border glow for premium cards */
.feature-card-pro::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(225, 6, 0, 0.15);
  pointer-events: none;
}

/* Nav links with PRO indicator */
.nav-link-pro::after {
  content: 'PRO';
  font-size: 0.5rem;
  font-weight: 800;
  background: var(--primary-red);
  color: white;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 5px;
  vertical-align: super;
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════
   AUTH MODAL
   ═══════════════════════════════════════════════════════════ */

.auth-modal {
  background: linear-gradient(145deg, #15191f 0%, #1a1f28 100%);
  padding: 40px 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  color: white;
  text-align: center;
  animation: slideUp 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-icon {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.auth-title {
  font-size: 1.4rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0 0 6px;
}

.auth-subtitle {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0 0 24px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0 14px;
  transition: border-color 0.3s;
}

.auth-input-group:focus-within {
  border-color: var(--primary-red);
}

.auth-input-group input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: white;
  font-size: 0.9rem;
  padding: 13px 0;
  font-family: inherit;
}

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

.password-toggle {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0;
  display: flex;
}

.auth-error {
  color: #ff4444;
  font-size: 0.8rem;
  margin: 0;
  text-align: left;
}

.auth-success {
  color: #4caf50;
  font-size: 0.8rem;
  margin: 0;
  text-align: left;
}

.auth-submit {
  background: linear-gradient(135deg, #e10600, #ff2a2a);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  margin-top: 4px;
}

.auth-submit:hover {
  background: linear-gradient(135deg, #ff1a1a, #ff4444);
  box-shadow: 0 0 20px rgba(225, 6, 0, 0.4);
}

.auth-submit:disabled {
  background: #333;
  cursor: not-allowed;
}

.auth-switch {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin: 18px 0 0;
}

.auth-switch span {
  color: var(--primary-red);
  cursor: pointer;
  font-weight: 700;
}

.auth-switch span:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════
   NAVBAR AUTH BUTTON
   ═══════════════════════════════════════════════════════════ */

.nav-auth-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-auth-btn:hover {
  border-color: var(--primary-red);
  color: var(--primary-red);
}

.nav-user-menu {
  position: relative;
}

.nav-user-btn {
  background: rgba(225, 6, 0, 0.15);
  border: 1px solid rgba(225, 6, 0, 0.3);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.3s;
}

.nav-user-btn:hover {
  background: rgba(225, 6, 0, 0.25);
}

.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #15191f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px;
  min-width: 160px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 2001;
}

.nav-user-dropdown-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: white;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  transition: background 0.2s;
}

.nav-user-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-user-dropdown-item.signout {
  color: var(--primary-red);
}

.nav-plan-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  margin-left: 6px;
}

.nav-plan-badge.free {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
}

.nav-plan-badge.premium {
  background: linear-gradient(135deg, #e10600, #ff4444);
  color: white;
}

@media (max-width: 768px) {
  .auth-modal {
    padding: 30px 20px;
    width: 95%;
  }

  .auth-title {
    font-size: 1.2rem;
  }
}

/* ============================
   LANGUAGE SELECTOR
   ============================ */
.nav-lang-menu {
  position: relative;
}

.nav-lang-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.nav-lang-btn:hover {
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
}

.nav-lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #15191f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 6px;
  min-width: 150px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 2001;
}

.nav-lang-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: inherit;
  transition: all 0.2s;
}

.nav-lang-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.nav-lang-item.active {
  color: var(--primary-red);
  font-weight: 700;
}

/* ============================
   USER AVATAR IN NAVBAR
   ============================ */
.nav-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e10600, #ff4444);
  color: white;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0;
  flex-shrink: 0;
}

/* ============================
   AUTH MODAL ENHANCEMENTS
   ============================ */
.auth-forgot {
  text-align: right;
  margin-top: -6px;
}

.auth-forgot span {
  color: var(--text-dim);
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.2s;
}

.auth-forgot span:hover {
  color: var(--primary-red);
}

.password-strength {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -4px;
}

.password-strength-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
}

.password-strength-fill.strength-1 {
  background: #ff4444;
}

.password-strength-fill.strength-2 {
  background: #ffaa00;
}

.password-strength-fill.strength-3 {
  background: #44cc44;
}

.password-strength-fill.strength-4 {
  background: #00cc88;
}

.password-strength-text {
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 40px;
}

.password-strength-text.strength-1 {
  color: #ff4444;
}

.password-strength-text.strength-2 {
  color: #ffaa00;
}

.password-strength-text.strength-3 {
  color: #44cc44;
}

.password-strength-text.strength-4 {
  color: #00cc88;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
  color: var(--text-dim);
  font-size: 0.72rem;
  white-space: nowrap;
}

.auth-social {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}

.auth-social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: not-allowed;
  transition: all 0.2s;
  opacity: 0.5;
}

/* ============================
   PROFILE PAGE
   ============================ */
.profile-page {
  max-width: 900px;
  margin: calc(100px + env(safe-area-inset-top)) auto 0 auto;
  padding: 30px 20px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 30px;
  background: var(--bg-panel);
  border: var(--glass-border);
  border-radius: 16px;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e10600, #ff4444);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  letter-spacing: 1px;
}

.profile-header-info {
  flex: 1;
}

.profile-name {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.profile-email {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 4px 0 8px;
}

.profile-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-meta-item {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.profile-panel {
  background: var(--bg-panel);
  border: var(--glass-border);
  border-radius: 14px;
  padding: 24px;
  backdrop-filter: blur(10px);
}

.profile-panel-account {
  grid-column: 1 / -1;
}

.profile-panel-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.profile-stat-card {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-red);
}

.profile-stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.profile-field {
  margin-bottom: 16px;
}

.profile-field label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.profile-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: white;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s;
  box-sizing: border-box;
}

.profile-input:focus {
  border-color: var(--primary-red);
}

.profile-input option {
  background: #15191f;
  color: white;
}

.profile-save-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #e10600, #ff2a2a);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s;
  margin-top: 8px;
}

.profile-save-btn:hover {
  box-shadow: 0 0 20px rgba(225, 6, 0, 0.3);
}

.profile-save-btn:disabled {
  background: #333;
  cursor: not-allowed;
}

.profile-password-row {
  display: flex;
  gap: 10px;
}

.profile-password-row .profile-input {
  flex: 1;
}

.profile-btn-sm {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
}

.profile-btn-sm:hover {
  background: rgba(255, 255, 255, 0.15);
}

.profile-btn-sm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.profile-msg {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  margin: 6px 0 0;
}

.profile-danger-zone {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(225, 6, 0, 0.2);
}

.profile-danger-zone h4 {
  color: var(--primary-red);
  font-size: 0.85rem;
  margin: 0 0 6px;
}

.profile-danger-text {
  color: var(--text-dim);
  font-size: 0.75rem;
  margin: 0 0 12px;
}

.profile-input-danger {
  border-color: rgba(225, 6, 0, 0.3);
}

.profile-input-danger:focus {
  border-color: var(--primary-red);
}

.profile-btn-danger {
  padding: 10px 20px;
  background: rgba(225, 6, 0, 0.15);
  border: 1px solid rgba(225, 6, 0, 0.3);
  border-radius: 8px;
  color: var(--primary-red);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
}

.profile-btn-danger:hover {
  background: rgba(225, 6, 0, 0.25);
}

.profile-btn-danger:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .profile-meta {
    justify-content: center;
  }

  .profile-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================
   FORUM STYLES
   ============================ */
.forum-page {
  max-width: 900px;
  margin: calc(100px + env(safe-area-inset-top)) auto 0 auto;
  padding: 30px 20px;
}

.forum-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.forum-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
}

.forum-subtitle {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 6px 0 0;
}

.forum-new-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #e10600, #ff2a2a);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s;
  white-space: nowrap;
}

.forum-new-btn:hover {
  box-shadow: 0 0 20px rgba(225, 6, 0, 0.3);
}

.forum-new-btn:disabled {
  background: #333;
  cursor: not-allowed;
}

/* SEARCH AREA */
.forum-search-container {
  margin-bottom: 24px;
}

.forum-search-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.forum-search-input-group {
  flex: 1;
  min-width: 250px;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0 16px;
  transition: all 0.3s ease;
}

.forum-search-input-group.tag-filter {
  flex: 0 1 250px;
}

.forum-search-input-group:focus-within {
  border-color: var(--primary-red);
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 15px rgba(225, 6, 0, 0.1);
}

.forum-search-input-group .search-icon {
  color: var(--text-dim);
  font-size: 1.2rem;
  margin-right: 12px;
}

.forum-search-input-group input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: white;
  padding: 12px 0;
  font-family: inherit;
  font-size: 0.95rem;
}

.forum-search-input-group input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.forum-search-btn {
  background: var(--primary-red);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 0 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 46px;
}

.forum-search-btn:hover {
  background: #ff1a1a;
  box-shadow: 0 0 20px rgba(225, 6, 0, 0.4);
  transform: translateY(-1px);
}

.forum-search-btn:active {
  transform: translateY(0);
}

@media (max-width: 600px) {
  .forum-search-input-group {
    min-width: 100%;
  }

  .forum-search-btn {
    width: 100%;
  }
}

.forum-categories {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.forum-category-tab {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.forum-category-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.forum-category-tab.active {
  background: rgba(225, 6, 0, 0.15);
  border-color: rgba(225, 6, 0, 0.4);
  color: var(--primary-red);
}

.forum-thread-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.thread-card {
  display: block;
  background: var(--bg-panel);
  border: var(--glass-border);
  border-radius: 14px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
}

.thread-card:hover {
  border-color: rgba(225, 6, 0, 0.3);
  transform: translateY(-1px);
}

.thread-pinned {
  font-size: 0.65rem;
  color: var(--accent-gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.thread-card-content {
  display: flex;
  gap: 14px;
}

.thread-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(225, 6, 0, 0.3), rgba(255, 68, 68, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  border: 1px solid rgba(225, 6, 0, 0.2);
}

.thread-avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 0.85rem;
}

.thread-card-body {
  flex: 1;
  min-width: 0;
}

.thread-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.3;
}

.thread-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.thread-author {
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}

.thread-time {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.thread-category-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.thread-category-badge.cat-race_discussion {
  background: rgba(225, 6, 0, 0.15);
  color: #ff6666;
}

.thread-category-badge.cat-technical_analysis {
  background: rgba(0, 210, 190, 0.15);
  color: var(--accent-cyan);
}

.thread-category-badge.cat-predictions {
  background: rgba(255, 215, 0, 0.15);
  color: var(--accent-gold);
}

.thread-category-badge.cat-general {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}

.thread-card-preview {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0 0 10px;
  line-height: 1.5;
}

.thread-card-stats {
  display: flex;
  gap: 16px;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.thread-card-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.forum-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.forum-empty p {
  margin: 0;
  font-size: 0.95rem;
}

.forum-empty-sub {
  margin-top: 8px !important;
  font-size: 0.8rem !important;
  opacity: 0.7;
}

.forum-loading {
  text-align: center;
  padding: 30px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.forum-load-more {
  display: block;
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.forum-load-more:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Thread Detail */
.forum-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  margin-bottom: 20px;
  transition: color 0.2s;
}

.forum-back-btn:hover {
  color: white;
}

.thread-detail {
  background: var(--bg-panel);
  border: var(--glass-border);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.thread-detail-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.thread-detail-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 0 8px;
  line-height: 1.3;
}

.thread-detail-body {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
}

.thread-detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.like-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: var(--text-dim);
  padding: 6px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.like-btn:hover {
  border-color: rgba(225, 6, 0, 0.3);
  color: #ff6666;
}

.like-btn.liked {
  color: var(--primary-red);
  border-color: rgba(225, 6, 0, 0.4);
  background: rgba(225, 6, 0, 0.1);
}

.like-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.like-btn-sm {
  padding: 4px 10px;
  font-size: 0.75rem;
}

.thread-delete-btn {
  background: none;
  border: 1px solid rgba(225, 6, 0, 0.2);
  border-radius: 8px;
  color: var(--text-dim);
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.thread-delete-btn:hover {
  color: var(--primary-red);
  border-color: rgba(225, 6, 0, 0.4);
}

/* Comments */
.thread-comments {
  background: var(--bg-panel);
  border: var(--glass-border);
  border-radius: 14px;
  padding: 24px;
  backdrop-filter: blur(10px);
}

.thread-comments-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin: 0 0 20px;
}

.comment-item {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.comment-item:last-of-type {
  border-bottom: none;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex !important;
  /* Ensure it's visible */
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--text-dim);
  flex-shrink: 0;
}

.comment-content {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.comment-author {
  font-size: 0.8rem;
  font-weight: 700;
}

.comment-time {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.comment-body {
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0 0 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-actions {
  display: flex;
  gap: 8px;
}

.comment-delete-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  opacity: 0.5;
  transition: all 0.2s;
}

.comment-delete-btn:hover {
  opacity: 1;
  color: var(--primary-red);
}

/* Reply */
.thread-reply-box {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.thread-reply-input {
  width: 100%;
  padding: 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: white;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.3s;
  box-sizing: border-box;
}

.thread-reply-input:focus {
  border-color: var(--primary-red);
}

.thread-reply-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #e10600, #ff2a2a);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  margin-top: 10px;
  transition: all 0.3s;
}

.thread-reply-btn:hover {
  box-shadow: 0 0 20px rgba(225, 6, 0, 0.3);
}

.thread-reply-btn:disabled {
  background: #333;
  cursor: not-allowed;
}

.forum-signin-prompt {
  text-align: center;
  padding: 20px;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Create Thread Modal */
.create-thread-modal {
  background: linear-gradient(145deg, #15191f 0%, #1a1f28 100%);
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 550px;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  color: white;
  animation: slideUp 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.create-thread-title {
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0 0 24px;
}

.create-thread-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.create-thread-field label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

/* ============================
   RTL SUPPORT (Arabic)
   ============================ */
[dir="rtl"] .f1-navbar {
  flex-direction: row-reverse;
}

[dir="rtl"] .nav-right {
  flex-direction: row-reverse;
}

[dir="rtl"] .nav-center.desktop-nav {
  flex-direction: row-reverse;
}

[dir="rtl"] .nav-user-dropdown {
  right: auto;
  left: 0;
}

[dir="rtl"] .nav-lang-dropdown {
  right: auto;
  left: 0;
}

[dir="rtl"] .thread-card-content {
  flex-direction: row-reverse;
}

[dir="rtl"] .comment-item {
  flex-direction: row-reverse;
}

[dir="rtl"] .profile-header {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .auth-input-group {
  flex-direction: row-reverse;
}

[dir="rtl"] .auth-forgot {
  text-align: left;
}

/* Forum responsive */
@media (max-width: 768px) {
  .forum-header {
    flex-direction: column;
    gap: 14px;
  }

  .forum-new-btn {
    width: 100%;
    justify-content: center;
  }

  .forum-categories {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .forum-category-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .thread-detail {
    padding: 20px;
  }

  .thread-detail-title {
    font-size: 1.1rem;
  }

  .thread-detail-header {
    flex-direction: column;
    gap: 12px;
  }

  .create-thread-modal {
    width: 95%;
    padding: 24px;
  }
}

/* Light mode overrides for new components */
.light-mode .nav-lang-btn {
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--text-dim);
}

.light-mode .nav-lang-btn:hover {
  color: var(--text-main);
  border-color: rgba(0, 0, 0, 0.3);
}

.light-mode .nav-lang-dropdown {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.light-mode .nav-lang-item {
  color: var(--text-dim);
}

.light-mode .nav-lang-item:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-main);
}

.light-mode .profile-input {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--text-main);
}

.light-mode .profile-input option {
  background: #ffffff;
  color: var(--text-main);
}

.light-mode .profile-stat-card {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

.light-mode .thread-card {
  border-color: rgba(0, 0, 0, 0.08);
}

.light-mode .thread-card:hover {
  border-color: rgba(225, 6, 0, 0.3);
}

.light-mode .thread-avatar {
  background: linear-gradient(135deg, rgba(225, 6, 0, 0.2), rgba(255, 68, 68, 0.1));
}

.light-mode .comment-avatar {
  background: rgba(0, 0, 0, 0.06);
}

.light-mode .thread-reply-input {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--text-main);
}

.light-mode .create-thread-modal {
  background: linear-gradient(145deg, #ffffff 0%, #f5f5f5 100%);
  color: var(--text-main);
  border-color: rgba(0, 0, 0, 0.1);
}

.light-mode .auth-social-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

.light-mode .like-btn {
  border-color: rgba(0, 0, 0, 0.1);
}

/* Spinner fix for News loading state */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary-red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: block;
  margin: 40px auto;
}

/* F1 News specific styles */
.page-title {
  color: var(--text-main);
  font-size: 2.5rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 10px 0;
}

.f1-card {
  background: var(--bg-panel);
  border: var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(10px);
}

.f1-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-red);
  box-shadow: 0 10px 30px rgba(225, 6, 0, 0.15);
}

.news-card {
  display: flex !important;
  flex-direction: column;
}

/* --- ADMIN DASHBOARD --- */
.admin-container {
  display: flex;
  min-height: 100vh;
  background-color: #0b0d10;
  color: var(--text-main);
  font-family: 'Titillium Web', sans-serif;
}

.admin-sidebar {
  width: 260px;
  background: rgba(15, 15, 15, 0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.admin-sidebar-header {
  padding: 30px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-logo-text {
  color: var(--primary-red);
  font-size: 1.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0;
  line-height: 1;
}

.admin-logo-sub {
  color: var(--text-dim);
  font-size: 0.75rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  display: block;
  margin-top: 5px;
  font-weight: 600;
}

.admin-nav {
  flex: 1;
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  color: var(--text-dim);
  border-radius: 8px;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.85rem;
  text-decoration: none;
}

.admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.admin-nav-item.active {
  background: rgba(225, 6, 0, 0.1);
  color: var(--primary-red);
  border-left-color: var(--primary-red);
}

.admin-sidebar-footer {
  padding: 20px 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-main {
  flex: 1;
  margin-left: 260px;
  background: radial-gradient(circle at top right, rgba(225, 6, 0, 0.05) 0%, transparent 50%), #0b0d10;
  padding: 40px;
  min-height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.admin-content-wrapper {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

.admin-mobile-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  padding: 10px;
  cursor: pointer;
}

.admin-mobile-header {
  display: none;
}

/* Admin Dashboard Subpages (Shared Styles) */
.admin-page-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-page-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.admin-page-subtitle {
  color: var(--text-dim);
  font-size: 1rem;
  margin-top: 5px;
}

.admin-card {
  background: rgba(20, 22, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-card-title {
  font-size: 1.2rem;
  color: var(--text-main);
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-container {
    display: block;
  }

  .admin-sidebar {
    transform: translateX(-100%);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 90;
  }

  .admin-mobile-btn {
    display: block;
  }

  .admin-main {
    margin-left: 0;
    padding: 20px;
    padding-top: 80px;
    /* space for mobile header */
  }
}

/* Admin Dashboard Tables & Forms */
.admin-search-wrapper {
  position: relative;
  width: 100%;
  max-width: 300px;
  display: flex;
  align-items: center;
}

.admin-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.admin-input {
  width: 100%;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 10px 10px 10px 40px;
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
  transition: 0.2s;
}

.admin-input:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 5px rgba(225, 6, 0, 0.3);
}

.admin-table-container {
  background: rgba(10, 10, 10, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-th {
  padding: 15px 20px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  letter-spacing: 1px;
  cursor: pointer;
  transition: 0.2s;
}

.admin-th:hover {
  color: var(--text-main);
}

.admin-td {
  padding: 15px 20px;
  font-size: 0.9rem;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.admin-tr-hover:hover {
  background: rgba(255, 255, 255, 0.02);
}

.admin-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid transparent;
}

.admin-badge-admin {
  background: rgba(225, 6, 0, 0.15);
  color: var(--primary-red);
  border-color: rgba(225, 6, 0, 0.3);
}

.admin-badge-user {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border-color: rgba(255, 255, 255, 0.1);
}

.admin-badge-banned {
  background: rgba(255, 0, 0, 0.15);
  color: #ff4444;
  border-color: rgba(255, 0, 0, 0.3);
}

.admin-table-footer {
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-icon-btn:hover:not(:disabled) {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

.admin-icon-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.admin-menu-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 5px;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 50;
  min-width: 150px;
  overflow: hidden;
  padding: 5px 0;
}

.admin-menu-item {
  width: 100%;
  text-align: left;
  padding: 10px 15px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.admin-menu-item.danger {
  color: #ff4444;
}

/* Modals & Dialogs */
.admin-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-dialog {
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 25px;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.admin-dialog-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 15px;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.admin-dialog-text {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 25px;
  line-height: 1.5;
}

.admin-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.admin-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.2s;
  border: none;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.admin-btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
}

.admin-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.admin-btn.primary {
  background: var(--primary-red);
  color: white;
}

.admin-btn.primary:hover {
  background: #ff1a1a;
  box-shadow: 0 0 15px rgba(225, 6, 0, 0.4);
}

/* POLL STYLES */
.forum-poll-container {
  margin-top: 24px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

.forum-poll-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.forum-poll-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.poll-option-wrapper {
  position: relative;
  width: 100%;
  height: 48px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.poll-option-wrapper:hover:not(.voted-other) {
  border-color: rgba(225, 6, 0, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.poll-option-wrapper.user-voted {
  border-color: var(--primary-red);
  box-shadow: 0 0 15px rgba(225, 6, 0, 0.1);
}

.poll-option-wrapper.voted-other {
  opacity: 0.7;
  cursor: default;
}

.poll-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(225, 6, 0, 0.1), rgba(225, 6, 0, 0.2));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.poll-option-wrapper.user-voted .poll-progress-bar {
  background: linear-gradient(90deg, rgba(225, 6, 0, 0.2), rgba(225, 6, 0, 0.3));
}

.poll-option-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  z-index: 2;
  font-size: 0.95rem;
  font-weight: 600;
}

.poll-option-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.poll-option-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.poll-option-percent {
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
}

.forum-poll-footer {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ===== FOOTER ===== */
.site-footer {
  background: rgba(0, 0, 0, 0.85);
  border-top: 1px solid rgba(225, 6, 0, 0.3);
  padding: 28px 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.footer-logo {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-main);
}

.footer-logo-accent {
  color: var(--primary-red);
}

.footer-tagline {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 2px 0 0;
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 0;
  align-items: center;
}

.footer-link {
  font-size: 0.78rem;
  color: var(--text-dim);
  padding: 2px 8px;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--primary-red);
}

.footer-divider {
  color: rgba(255, 255, 255, 0.15);
  font-size: 0.78rem;
}

.footer-copyright {
  font-size: 0.7rem;
  color: rgba(148, 156, 166, 0.6);
  margin: 0;
  line-height: 1.5;
}

/* ===== COOKIE BANNER ===== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  background: rgba(10, 12, 16, 0.97);
  border-top: 1px solid rgba(225, 6, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 14px 24px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
  animation: slide-up 0.3s ease;
}

@keyframes slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.cookie-banner-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.cookie-banner-text {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0;
  flex: 1;
  min-width: 200px;
  line-height: 1.5;
}

.cookie-link {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 7px 18px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Titillium Web', sans-serif;
  cursor: pointer;
  transition: opacity 0.2s;
  border: none;
}

.cookie-btn:hover {
  opacity: 0.85;
}

.cookie-btn-decline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-dim);
}

.cookie-btn-accept {
  background: var(--primary-red);
  color: #fff;
}

/* ===== LEGAL PAGES ===== */
.legal-page {
  min-height: 100vh;
  padding: 100px 24px 60px;
  background: var(--bg-main);
}

.legal-container {
  max-width: 800px;
  margin: 0 auto;
}

.legal-header {
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(225, 6, 0, 0.3);
}

.legal-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}

.legal-updated {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0;
}

.legal-body {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.legal-section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-red);
  margin: 0 0 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.legal-section p,
.legal-section li {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.75;
}

.legal-section ul {
  padding-left: 20px;
  list-style: disc;
}

.legal-section a {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.legal-section a:hover {
  color: var(--primary-red);
}

.legal-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 12px;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.legal-table th,
.legal-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-dim);
  vertical-align: top;
}

.legal-table th {
  color: var(--text-main);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(225, 6, 0, 0.2);
}

.legal-table tr:last-child td {
  border-bottom: none;
}

/* Light mode overrides */
.light-mode .site-footer {
  background: rgba(240, 242, 245, 0.95);
  border-top-color: rgba(225, 6, 0, 0.2);
}

.light-mode .cookie-banner {
  background: rgba(255, 255, 255, 0.97);
  border-top-color: rgba(225, 6, 0, 0.3);
}

.light-mode .cookie-btn-decline {
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--text-dim);
}

/* Mobile footer */
@media (max-width: 600px) {
  .cookie-banner-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .footer-legal-links {
    gap: 4px 0;
  }

  .legal-title {
    font-size: 1.5rem;
  }
}
