/* Theme inspired by larochelledemain.fr */
:root {
  --bs-primary: #1e88e5; /* vibrant blue */
  --bs-primary-rgb: 30, 136, 229;
  --accent: #00bfa5; /* teal accent */
  --surface: #ffffff;
  --surface-weak: #f5f7fb;
  --border: rgba(0,0,0,0.1);
  --gradient-start: #1e88e5; /* blue */
  --gradient-end: #00bfa5;   /* teal */
}

html, body {
  height: 100%;
}

body, .btn, .form-control, .navbar, .card, .table {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', sans-serif;
}

h1, h2, h3, .navbar-brand {
  font-family: 'Poppins', 'Inter', sans-serif;
}

.navbar-brand {
  letter-spacing: 0.5px;
}

.leaflet-control.custom-add {
  background: var(--bs-primary);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  cursor: pointer;
}
.leaflet-control.custom-add:hover {
  background: #1565c0;
}

.marker-white {
  background: #fff;
  border: 2px solid #333;
  border-radius: 50%;
  width: 14px;
  height: 14px;
}

/* Toast styling */
#appToast {
  border: 0;
}

/* Navbar gradient to match branding */
.navbar-gradient {
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
}
.navbar-gradient-door {
  background: linear-gradient(90deg, #28a745, #20c997, #17a2b8);
}
/* --- */
/* Auth page styling similar to adherents site */
body.auth-page {
  min-height: 100vh;
  background: radial-gradient(1200px 800px at 10% -10%, rgba(30,136,229,0.15), transparent 60%),
              radial-gradient(1000px 600px at 100% 0%, rgba(0,191,165,0.15), transparent 50%),
              linear-gradient(180deg, #f8fbff, #f3f7fb);
}
.auth-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}
.btn-primary {
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  border: 0;
}
.btn-primary:hover { filter: brightness(0.95); }

/* Modal branding */
.modal-brand .modal-content {
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}
.modal-brand .modal-header {
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
  border-bottom: 0;
}
.modal-brand .modal-title { font-family: 'Poppins','Inter',sans-serif; font-weight: 600; }
.modal-brand .btn-outline-secondary { border-color: #cfd6e4; color: #4b5563; }
.modal-brand .btn-outline-secondary:hover { background: #f3f7fb; }
.modal-brand .btn-outline-warning { border-color: #f4c76c; color: #b08900; }
.modal-brand .btn-outline-danger { border-color: #e5a3a3; color: #b42318; }
.modal-brand .btn-success { background: #28a745; border: 0; }

/* Filters and Legend controls */
.leaflet-control.filter-control,
.leaflet-control.legend-control {
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 0.9rem;
  color: #1f2937;
}

/* Itinerary control */
.leaflet-control.itinerary-control {
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 0.9rem;
}

.filter-control .fc-title,
.legend-control .legend-title {
  font-weight: 700;
  color: var(--bs-primary);
  margin-bottom: 6px;
}

.filter-control .fc-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin-bottom: 8px;
}

.form-check-sm .form-check-input {
  width: 1rem;
  height: 1rem;
}
.form-check-sm .form-check-label {
  margin-left: 0.25rem;
  font-size: 0.86rem;
}

.legend-control .legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  white-space: nowrap;
}
.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #222;
  display: inline-block;
}

/* ---- Palmarès ---- */
.palmares-page {
  min-height: 100vh;
  background: radial-gradient(1200px 700px at 5% -10%, rgba(30,136,229,0.18), transparent 55%),
              radial-gradient(900px 600px at 95% 10%, rgba(0,191,165,0.16), transparent 55%),
              linear-gradient(180deg, #f5f9ff, #f3f7fb 40%, #f8fafc 100%);
}

.palmares-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(30,136,229,0.12), rgba(0,191,165,0.16));
  border-bottom: 1px solid rgba(30, 136, 229, 0.12);
}

.palmares-hero::after {
  content: "";
  position: absolute;
  inset: -30% -10% auto auto;
  width: 340px;
  height: 340px;
  background: conic-gradient(from 180deg, rgba(30,136,229,0.18), rgba(0,191,165,0.2), rgba(30,136,229,0.12));
  border-radius: 50%;
  filter: blur(0.5px);
  opacity: 0.6;
  pointer-events: none;
}

.palmares-eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.2rem;
  color: #1366b3;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.palmares-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 18px;
  min-width: 150px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  color: #64748b;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #0f172a;
}

.stat-value-sm {
  font-size: 1rem;
}

.podium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  align-items: end;
}

.podium-card {
  background: linear-gradient(180deg, #ffffff, #f7fafd);
  border: 1px solid rgba(30, 136, 229, 0.12);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.podium-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(30,136,229,0.12), rgba(0,191,165,0.12));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.podium-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
}

.podium-card:hover::before {
  opacity: 1;
}

.podium-rank {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  position: relative;
  z-index: 1;
}

.podium-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0.35rem;
  position: relative;
  z-index: 1;
}

.podium-count {
  color: #1e88e5;
  font-weight: 600;
  margin-top: 0.35rem;
  position: relative;
  z-index: 1;
}

.podium-badge {
  margin-top: 1rem;
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #0ea5e9;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.podium-1 { min-height: 220px; border-color: rgba(15, 118, 110, 0.25); }
.podium-2 { min-height: 190px; border-color: rgba(30, 136, 229, 0.2); }
.podium-3 { min-height: 170px; border-color: rgba(14, 165, 233, 0.2); }

.podium-empty {
  text-align: center;
  color: #64748b;
  font-weight: 600;
}

.leaderboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
}

.leaderboard-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.leaderboard-badge {
  background: rgba(30, 136, 229, 0.12);
  color: #1d4ed8;
  font-weight: 600;
}

.leaderboard-list {
  display: grid;
  gap: 10px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 64px minmax(140px, 1fr) 1fr 64px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fbff;
  border: 1px solid rgba(30, 136, 229, 0.08);
}

.leaderboard-row.is-current {
  background: linear-gradient(90deg, rgba(0,191,165,0.18), rgba(30,136,229,0.08));
  border-color: rgba(0,191,165,0.35);
}

.leaderboard-rank {
  font-weight: 700;
  color: #1f2937;
}

.leaderboard-name {
  font-weight: 600;
  color: #0f172a;
}

.leaderboard-bar {
  height: 10px;
  background: rgba(30, 136, 229, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.leaderboard-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #1e88e5, #00bfa5);
  border-radius: 999px;
  transition: width 1s ease;
}

.leaderboard-count {
  text-align: right;
  font-weight: 700;
  color: #0f172a;
}

@media (max-width: 768px) {
  .leaderboard-row {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .leaderboard-count {
    text-align: left;
  }
}
