/* =============================================================
   VRP Dark Gold Premium Theme
   Activated via: body[data-theme="dark"]
   ============================================================= */

/* ── Color variable overrides ─────────────────────────────── */
body[data-theme="dark"] {
  --ocean-blue: #d4af37;
  --marine-blue: #111827;
  --very-light-blue: #1f2937;
  --powder-blue: #374151;
  --light-grey-blue: rgba(212, 175, 55, 0.3);
  --light-grey: #1f2937;
  --brownish-grey: #e5e7eb;
  --dark-grey: #9ca3af;
  --bright-orange: #d4af37;

  background-color: #111827;
  color: #f9fafb;
}

/* ── Base elements ────────────────────────────────────────── */
body[data-theme="dark"] a {
  color: #d4af37;
}
body[data-theme="dark"] a:hover {
  color: #f0d060;
}

body[data-theme="dark"] #wrapper {
  background-color: #111827;
}

body[data-theme="dark"] #header {
  background-color: transparent;
  border-bottom: 0px solid rgba(212, 175, 55, 0.2);
}

body[data-theme="dark"] #footer {
  /*background-color: #1f2937;*/  
  border-top: 1px solid rgba(212, 175, 55, 0.15);
  color: #9ca3af;
}

/* ── Cards and surfaces ───────────────────────────────────── */
body[data-theme="dark"] .inside,
body[data-theme="dark"] .ce_text,
body[data-theme="dark"] .mod_article {
  color: #f9fafb;
}

/* ── Navigation ───────────────────────────────────────────── */
body[data-theme="dark"] .vrp-nav {
  background-color: #1f2937;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
}
body[data-theme="dark"] .vrp-nav a {
  color: #9ca3af;
}
body[data-theme="dark"] .vrp-nav a.active,
body[data-theme="dark"] .vrp-nav a:hover {
  color: #d4af37;
}

/* ── Buttons ──────────────────────────────────────────────── */
body[data-theme="dark"] .btn,
body[data-theme="dark"] button[type="submit"],
body[data-theme="dark"] input[type="submit"] {
  background: linear-gradient(90deg, #d4af37, #f0d060);
  color: #111827;
  border: none;
}
body[data-theme="dark"] .btn:hover,
body[data-theme="dark"] button[type="submit"]:hover,
body[data-theme="dark"] input[type="submit"]:hover {
  background: linear-gradient(90deg, #c49b2a, #d4af37);
  color: #111827;
}

/* ── Forms and inputs ─────────────────────────────────────── */
body[data-theme="dark"] input[type="text"],
body[data-theme="dark"] input[type="email"],
body[data-theme="dark"] input[type="password"],
body[data-theme="dark"] input[type="number"],
body[data-theme="dark"] input[type="date"],
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
  background-color: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}
body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
  color: #6b7280;
}

/* ── Tables ───────────────────────────────────────────────── */
body[data-theme="dark"] table {
  background-color: #1f2937;
  color: #f9fafb;
}
body[data-theme="dark"] th {
  background-color: #374151;
  color: #d4af37;
}
body[data-theme="dark"] tr:nth-child(even) td {
  background-color: #263244;
}
body[data-theme="dark"] td {
  border-color: #374151;
}

/* ── VRP module cards ─────────────────────────────────────── */
body[data-theme="dark"] .stat-card,
body[data-theme="dark"] .info-box,
body[data-theme="dark"] .points-summary {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.2);
  color: #f9fafb;
}
body[data-theme="dark"] .stat-card.primary {
  border-top-color: #d4af37;
}

/* ── Training history table ───────────────────────────────── */
body[data-theme="dark"] #trainingsliste {
  background-color: #1f2937;
}

/* ── Message boxes ────────────────────────────────────────── */
body[data-theme="dark"] .message.success {
  background-color: rgba(74, 222, 128, 0.1);
  border-color: #4ade80;
  color: #4ade80;
}
body[data-theme="dark"] .message.error {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}
body[data-theme="dark"] .message.warning {
  background-color: rgba(212, 175, 55, 0.1);
  border-color: #d4af37;
  color: #d4af37;
}

/* ── Strava module ────────────────────────────────────────── */
body[data-theme="dark"] .vrp-strava-connect {
  background-color: #1f2937;
  border-color: rgba(212, 175, 55, 0.2);
}
body[data-theme="dark"] .vrp-strava-status {
  background-color: rgba(255, 255, 255, 0.05);
}

/* ── Points redemption ────────────────────────────────────── */
body[data-theme="dark"] .amount-buttons .amount-btn {
  background-color: #374151;
  border-color: rgba(212, 175, 55, 0.3);
  color: #f9fafb;
}
body[data-theme="dark"] .amount-buttons .amount-btn:hover,
body[data-theme="dark"] .amount-buttons .amount-btn.selected {
  background-color: rgba(212, 175, 55, 0.15);
  border-color: #d4af37;
  color: #d4af37;
}

/* ── Leaderboard ──────────────────────────────────────────── */
body[data-theme="dark"] .vrp-points-leaderboard {
  background-color: #1f2937;
}
body[data-theme="dark"] .stats-dashboard .stat-card {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(212, 175, 55, 0.2);
}

/* =============================================================
   MOBILE LAYOUT — sticky header + fixed footer nav
   Only active in dark theme on small screens
   ============================================================= */
@media (max-width: 768px) {

  /* Sticky header */
  body[data-theme="dark"] #header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #1f2937;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  }

  /* Extra padding on wrapper to avoid content hiding behind fixed footer nav.
     The vrp_points_navigation module must be placed in the Footer layout section. */
  body[data-theme="dark"] #wrapper {
    padding-bottom: 70px;
  }

  /* Fixed footer navigation tab bar */
  body[data-theme="dark"] #footer .vrp-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: #1f2937;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
  }

  body[data-theme="dark"] #footer .vrp-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    font-size: 10px;
    gap: 2px;
    flex: 1;
  }

  body[data-theme="dark"] #footer .vrp-nav a.active {
    color: #d4af37;
  }

  /* Hide any other footer content below the nav on mobile
     to avoid layout issues with the fixed nav overlay */
  body[data-theme="dark"] #footer .inside > *:not(.vrp-nav) {
    display: none;
  }
}
