/* ============================================================
   Cyclocross Gullegem – Shifts Portaal
   Globale stijlen
   ============================================================ */

:root {
  --primary:    #E94E1B;
  --primary-dk: #c43e12;
  --black:      #222222;
  --grey:       #888888;
  --light:      #FAFBFD;
  --white:      #FFFFFF;
  --border:     #e2e6ea;
  --success:    #28a745;
  --warning:    #ffc107;
  --danger:     #dc3545;
  --info:       #17a2b8;
  --shadow:     0 2px 12px rgba(0,0,0,0.08);
  --radius:     8px;
  --font:       'Inter', 'Segoe UI', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--light);
  color: var(--black);
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- Typografie ---- */
h1, h2, h3, h4, h5 {
  font-weight: 700;
  line-height: 1.2;
  margin-top: 0;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

p { margin: 0 0 1rem; }

/* ---- Navigatie ---- */
.navbar {
  background: var(--black);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.navbar-brand:hover {
  text-decoration: none;
}

.navbar-brand img {
  height: 40px;
  filter: brightness(0) invert(1);
}

.navbar-brand span {
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.3px;
}

.navbar-brand .brand-sub {
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 400;
  display: block;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar-nav a {
  color: #ccc;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: all 0.2s;
  display: block;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  background: rgba(233,78,27,0.15);
  color: var(--primary);
  text-decoration: none;
}

.navbar-nav .btn-primary {
  background: var(--primary);
  color: #fff !important;
  padding: 8px 16px;
}

.navbar-nav .btn-primary:hover {
  background: var(--primary-dk);
}

.navbar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.navbar-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  transition: 0.3s;
}

/* ---- Hoofdlayout ---- */
.page-wrapper {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  width: 100%;
}

.page-header {
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header h1 {
  margin: 0;
  font-size: 1.75rem;
}

.page-header .subtitle {
  color: var(--grey);
  font-size: 0.95rem;
  margin-top: 4px;
}

/* ---- Kaarten ---- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h2, .card-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--light);
}

/* ---- Shift kaart ---- */
.shift-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  padding: 20px 24px;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shift-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.shift-card .shift-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--grey);
}

.shift-card .shift-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.shift-card h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--black);
}

.shift-card .shift-spots {
  font-size: 0.85rem;
  font-weight: 600;
}

.spots-available { color: var(--success); }
.spots-low { color: var(--warning); }
.spots-full { color: var(--danger); }

/* ---- Grid layouts ---- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ---- Knoppen ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
  font-family: var(--font);
  line-height: 1;
}

.btn:hover { text-decoration: none; }

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

.btn-primary:hover {
  background: var(--primary-dk);
  border-color: var(--primary-dk);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-dark {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.btn-dark:hover {
  background: #333;
  border-color: #333;
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--grey);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--light);
  color: var(--black);
}

.btn-success {
  background: var(--success);
  color: var(--white);
  border-color: var(--success);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}

.btn-warning {
  background: var(--warning);
  color: var(--black);
  border-color: var(--warning);
}

.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

.btn[disabled], .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Formulieren ---- */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--black);
}

.form-group label .required {
  color: var(--primary);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(233,78,27,0.1);
}

.form-control::placeholder { color: var(--grey); }

textarea.form-control { resize: vertical; min-height: 100px; }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23888' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

/* Filter dropdowns: breedte op inhoud + ruimte voor pijl */
#filterBar .form-group {
  flex: 0 0 auto !important;
  width: auto !important;
}

#filterBar select.form-control {
  width: auto !important;
  padding-right: 32px !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--grey);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
}

.badge-primary { background: rgba(233,78,27,0.12); color: var(--primary); }
.badge-success { background: rgba(40,167,69,0.12); color: var(--success); }
.badge-warning { background: rgba(255,193,7,0.15); color: #856404; }
.badge-danger  { background: rgba(220,53,69,0.12); color: var(--danger); }
.badge-grey    { background: rgba(136,136,136,0.12); color: var(--grey); }
.badge-dark    { background: rgba(34,34,34,0.1); color: var(--black); }

/* ---- Alerts ---- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.92rem;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-success { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border-color: #ffeeba; }
.alert-info    { background: #d1ecf1; color: #0c5460; border-color: #bee5eb; }

/* ---- Tabellen ---- */
.table-responsive { overflow-x: auto; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.data-table th {
  background: var(--light);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--grey);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

table.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.data-table tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: var(--light); }

/* ---- Tabs ---- */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  gap: 4px;
  overflow-x: hidden;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 10px 18px;
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--grey);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- Statistieken ---- */
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.stat-card .stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.stat-card .stat-label {
  color: var(--grey);
  font-size: 0.85rem;
  margin-top: 6px;
}

/* ---- Categorie badge ---- */
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
}

/* ---- Timeline dagoverzicht ---- */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--white);
}

.timeline-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

/* ---- Return/vergoeding blokken ---- */
.return-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.return-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  border: 2px solid var(--border);
  transition: border-color 0.2s;
}

.return-item.earned {
  border-color: var(--primary);
  background: rgba(233,78,27,0.04);
}

.return-item .return-count {
  font-size: 2rem;
  font-weight: 800;
  color: var(--grey);
}

.return-item.earned .return-count { color: var(--primary); }

.return-item .return-desc {
  font-size: 0.82rem;
  color: var(--grey);
  margin-top: 4px;
}

/* ---- Voettekst ---- */
.site-footer {
  background: var(--black);
  color: #666;
  padding: 20px 24px;
  text-align: center;
  font-size: 0.82rem;
  margin-top: auto;
}

.site-footer a { color: var(--primary); }

/* ---- Laadindicator ---- */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ---- Modal ---- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: 12px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { margin: 0; }

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--grey);
  line-height: 1;
  padding: 4px;
}

.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Hulpklassen ---- */
.hide-mobile  { /* verborgen op mobile */ }
.text-primary { color: var(--primary); }
.text-grey    { color: var(--grey); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-sm      { font-size: 0.85rem; }
.text-xs      { font-size: 0.78rem; }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 8px; }
.mb-1 { margin-bottom: 8px; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.mt-3 { margin-top: 24px; }
.mb-3 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.hidden { display: none !important; }
.w-full { width: 100%; }

/* ---- Lucide Icons ---- */
i[data-lucide] {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}
.btn i[data-lucide] { width: 0.9em; height: 0.9em; }
.icon-sm i[data-lucide], i[data-lucide].icon-sm { width: 0.8em; height: 0.8em; }
.icon-lg i[data-lucide], i[data-lucide].icon-lg { width: 1.25em; height: 1.25em; }

/* ---- Impersonatie balk ---- */
#impersonate-bar { font-family: var(--font-sans, system-ui); }


@media (max-width: 640px) {
  .main-content { padding: 16px 12px; }

  /* Grid overrides — 4-koloms → 2 kolommen, rest → 1 */
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }

  /* ── Navbar ─────────────────────────────────────── */
  .navbar { height: 56px; padding: 0 14px; }
  .navbar-brand img  { height: 32px; }
  .navbar-brand span { font-size: 0.95rem; }
  .navbar-brand .brand-sub { font-size: 0.72rem; }

  /* Hamburger */
  .navbar-toggle { display: block; }

  /* Dropdown menu: rechts uitlijnen, breedte op inhoud, semi-transparant */
  .navbar-nav {
    display: none;
    position: fixed;
    top: 56px;
    right: 0;
    left: auto;
    width: auto;
    min-width: 160px;
    background: rgba(20,20,20,0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    flex-direction: column;
    padding: 6px 0;
    gap: 0;
    box-shadow: -4px 8px 24px rgba(0,0,0,0.4);
    border-radius: 0 0 0 10px;
  }
  .navbar-nav.open { display: flex; }

  /* Menu items: tekst rechts, geen omkadering */
  .navbar-nav li { border-bottom: 1px solid rgba(255,255,255,0.07); }
  .navbar-nav li:last-child { border-bottom: none; }
  .navbar-nav a {
    border-radius: 0;
    padding: 10px 20px;
    font-size: 0.88rem;
    text-align: right;
    color: rgba(255,255,255,0.8);
  }
  .navbar-nav a:hover { background: rgba(233,78,27,0.12); color: var(--primary); }
  .navbar-nav a.active { color: var(--primary); background: none; font-weight: 600; }
  .navbar-nav .btn-primary {
    background: none;
    color: var(--primary) !important;
    padding: 10px 20px;
    text-align: right;
  }

  /* ── Filterblok ──────────────────────────────────── */
  #filterBar .card-body { padding: 8px 10px !important; }
  #filterBar .form-group { margin: 0 !important; }
  #filterBar label { display: none !important; }
  #filterBar select,
  #filterBar input[type="time"] {
    height: 34px !important;
    font-size: 0.8rem;
    padding: 0 6px !important;
    margin-top: 0 !important;
  }
  /* Filters op 1 rij via flex-wrap */
  #filterInner {
    flex-wrap: wrap;
    gap: 5px !important;
  }
  #filterBar .form-group { flex-shrink: 1; min-width: 0 !important; }
  #filterBar select { min-width: 0; max-width: none; }
  /* Tijdfilter: altijd naast elkaar */
  .filter-time-row {
    display: flex !important;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
  }
  .filter-time-row input[type="time"] { width: 90px !important; flex: 0 0 auto; }
  .filter-time-row .time-sep { font-size: 0.75rem; color: var(--grey); }

  /* ── Locatie label ────────────────────────────────── */
  .loc-label-text {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
  }

  /* ── Tag pill (locatie + shift) ───────────────────── */
  .tag-pill-loc {
    font-size: 0.68rem !important;
    padding: 2px 7px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    font-weight: 700;
  }

  /* ── Badges ───────────────────────────────────────── */
  .badge-pending-icon { width: 10px !important; height: 10px !important; }

  /* ── Verbergen op mobile ─────────────────────────── */
  .hide-mobile { display: none !important; }

  /* ── Profiel actie-knoppen ────────────────────────── */
  .shift-action-btns { display: flex; gap: 8px; align-items: stretch; }
  .shift-action-btns a { display: flex; align-items: center; }
}
