/* ── CampingApp · main.css · v0.1.0-alpha ─────────────────────────── */

:root {
  --green-900: #14532d;
  --green-700: #15803d;
  --green-500: #22c55e;
  --green-200: #bbf7d0;
  --green-50:  #f0fdf4;

  --amber-400: #fbbf24;
  --amber-100: #fef3c7;

  --red-500:   #ef4444;
  --red-100:   #fee2e2;
  --blue-500:  #3b82f6;
  --blue-100:  #dbeafe;

  --stone-900: #1c1917;
  --stone-700: #44403c;
  --stone-400: #a8a29e;
  --stone-200: #e7e5e4;
  --stone-100: #f5f5f4;
  --stone-50:  #fafaf9;
  --white:     #ffffff;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.14);

  --topbar-h: 56px;
}

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

html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--stone-50);
  color: var(--stone-900);
  min-height: 100vh;
}

/* ── TOPBAR ──────────────────────────────────────────────────────────── */
#topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: var(--green-900);
  color: var(--white);
  box-shadow: var(--shadow-md);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-icon { font-size: 22px; }
.brand-name { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; letter-spacing: -.3px; }
.brand-version { font-size: .68rem; opacity: .55; padding: 2px 6px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; }

#main-nav { display: flex; gap: 4px; margin-left: 16px; }
.nav-btn {
  background: transparent; border: none; color: rgba(255,255,255,.75);
  font-family: var(--font-body); font-size: .85rem; cursor: pointer;
  padding: 6px 12px; border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.nav-btn:hover, .nav-btn.active { background: rgba(255,255,255,.15); color: #fff; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
#lang-picker {
  background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius-sm); padding: 4px 8px; font-size: .82rem; cursor: pointer;
}
#lang-picker option { background: var(--green-900); }

#user-email-label { font-size: .82rem; opacity: .8; }

/* ── BUTTONS ─────────────────────────────────────────────────────────── */
.btn-primary, .btn-outline, .btn-success, .btn-danger {
  font-family: var(--font-body); font-size: .85rem; font-weight: 500;
  border-radius: var(--radius-sm); padding: 7px 16px;
  cursor: pointer; border: none; transition: all .15s;
}
.btn-primary  { background: var(--green-500); color: #fff; }
.btn-primary:hover  { background: var(--green-700); }
.btn-success  { background: #16a34a; color: #fff; }
.btn-success:hover  { background: var(--green-900); }
.btn-danger   { background: var(--red-500); color: #fff; }
.btn-danger:hover   { filter: brightness(1.1); }
.btn-outline  {
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,.45);
}
.btn-outline:hover { background: rgba(255,255,255,.12); }
.btn-outline.dark  { color: var(--stone-700); border-color: var(--stone-300); }
.btn-outline.dark:hover { background: var(--stone-100); }
.full-width { width: 100%; margin-top: 10px; }
button:disabled { opacity: .45; cursor: not-allowed; }

/* ── MAIN ────────────────────────────────────────────────────────────── */
#app { min-height: calc(100vh - var(--topbar-h)); }
.view { display: none; }
.view.active { display: block; }

/* ── BOOKING LAYOUT ──────────────────────────────────────────────────── */
.booking-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  height: calc(100vh - var(--topbar-h));
}

.booking-sidebar {
  background: var(--white);
  border-right: 1px solid var(--stone-200);
  padding: 16px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.sidebar-card {
  background: var(--stone-50);
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-md);
  padding: 14px;
}
.sidebar-card h3 { font-family: var(--font-display); font-size: 1rem; margin-bottom: 10px; color: var(--green-900); }
label { display: block; font-size: .8rem; color: var(--stone-700); margin-bottom: 3px; margin-top: 8px; }
.date-input, .text-input, select {
  width: 100%; padding: 7px 10px;
  border: 1px solid var(--stone-200); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .85rem;
  background: var(--white); color: var(--stone-900);
}
.date-input:focus, .text-input:focus, select:focus {
  outline: none; border-color: var(--green-500); box-shadow: 0 0 0 2px var(--green-200);
}

.tag-list { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.tag-chip {
  font-size: .72rem; padding: 3px 8px; border-radius: 999px;
  background: var(--green-200); color: var(--green-900); font-weight: 500;
}
.tag-chip.optional { background: var(--amber-100); color: #92400e; }

.optional-tags { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.optional-row { display: flex; align-items: center; gap: 8px; font-size: .82rem; }
.optional-row input[type=checkbox] { accent-color: var(--green-500); }

.vehicle-section { margin-top: 10px; }

.price-preview {
  background: var(--green-50); border: 1px solid var(--green-200);
  border-radius: var(--radius-sm); padding: 10px; margin-top: 10px; text-align: center;
}
.price-total { font-family: var(--font-display); font-size: 1.4rem; color: var(--green-900); font-weight: 700; }
.price-nights { font-size: .78rem; color: var(--stone-400); margin-top: 2px; }

.legend-card { display: flex; flex-direction: column; gap: 6px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: .8rem; }
.legend-dot { width: 16px; height: 16px; border-radius: 3px; border: 2px solid; flex-shrink: 0; }
.legend-dot.free     { border-color: #22c55e; background: transparent; }
.legend-dot.occupied { border-color: #ef4444; background: rgba(100,100,100,.35); }
.legend-dot.selected { border-color: #f59e0b; background: rgba(245,158,11,.25); }

/* ── MAP ─────────────────────────────────────────────────────────────── */
.map-container {
  position: relative; overflow: hidden; background: var(--stone-100);
  display: flex; flex-direction: column;
}
#map-wrapper {
  flex: 1; overflow: hidden; cursor: grab; position: relative;
  display: flex; align-items: center; justify-content: center;
}
#map-wrapper:active { cursor: grabbing; }
#svg-container {
  transform-origin: center center;
  transition: transform .1s;
  user-select: none;
}
#svg-container svg { display: block; width: 100%; max-width: 880px; }

.map-controls {
  position: absolute; top: 12px; right: 12px; z-index: 10;
  display: flex; flex-direction: column; gap: 4px;
}
.zoom-btn {
  width: 32px; height: 32px; border: none; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.9); color: var(--stone-700);
  font-size: 1.1rem; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: background .1s;
}
.zoom-btn:hover { background: var(--white); }
.map-hint { text-align: center; font-size: .78rem; color: var(--stone-400); padding: 6px; }

/* ── SVG PLOT STYLES ─────────────────────────────────────────────────── */
.plot {
  fill: transparent;
  stroke: #22c55e;
  stroke-width: 2.5;
  cursor: pointer;
  transition: fill .15s, stroke .15s;
}
.plot.occupied {
  fill: rgba(100,100,100,.35);
  stroke: #ef4444;
  cursor: not-allowed;
}
.plot.selected {
  fill: rgba(245,158,11,.25);
  stroke: #f59e0b;
  stroke-width: 3;
}
.plot:not(.occupied):hover {
  fill: rgba(34,197,94,.18);
  stroke: #16a34a;
}

/* ── MY RESERVATIONS ─────────────────────────────────────────────────── */
.view-inner { max-width: 860px; margin: 0 auto; padding: 32px 20px; }
.view-inner h2 { font-family: var(--font-display); font-size: 1.6rem; margin-bottom: 20px; color: var(--green-900); }

.res-list { display: flex; flex-direction: column; gap: 12px; }
.res-card {
  background: var(--white); border: 1px solid var(--stone-200);
  border-radius: var(--radius-md); padding: 16px;
  display: grid; grid-template-columns: 1fr auto;
  gap: 8px; align-items: start;
  box-shadow: var(--shadow-sm);
}
.res-card-main h4 { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 4px; }
.res-card-main p  { font-size: .82rem; color: var(--stone-400); }
.status-badge {
  font-size: .72rem; padding: 3px 10px; border-radius: 999px; font-weight: 500;
}
.status-badge.pending   { background: var(--amber-100); color: #92400e; }
.status-badge.confirmed { background: var(--green-200); color: var(--green-900); }
.status-badge.cancelled { background: var(--red-100);   color: #991b1b; }

/* ── ADMIN ───────────────────────────────────────────────────────────── */
.admin-layout { display: grid; grid-template-columns: 200px 1fr; min-height: calc(100vh - var(--topbar-h)); }
.admin-sidenav {
  background: var(--white); border-right: 1px solid var(--stone-200);
  padding: 16px 10px; display: flex; flex-direction: column; gap: 3px;
}
.admin-tab {
  text-align: left; background: transparent; border: none;
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .83rem; cursor: pointer;
  color: var(--stone-700); transition: background .12s;
}
.admin-tab:hover, .admin-tab.active { background: var(--green-50); color: var(--green-900); font-weight: 500; }
.admin-content { padding: 28px 32px; overflow-y: auto; }
.admin-content h2 { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 18px; color: var(--green-900); }

.admin-table { width: 100%; border-collapse: collapse; font-size: .83rem; }
.admin-table th { text-align: left; padding: 9px 12px; background: var(--stone-100); color: var(--stone-700); font-weight: 500; border-bottom: 1px solid var(--stone-200); }
.admin-table td { padding: 9px 12px; border-bottom: 1px solid var(--stone-100); }
.admin-table tr:hover td { background: var(--stone-50); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 14px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: .8rem; color: var(--stone-700); }
.form-group input, .form-group select, .form-group textarea {
  padding: 7px 10px; border: 1px solid var(--stone-200); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .85rem;
}
.toggle-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: .85rem; }
.toggle { position: relative; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--stone-200);
  border-radius: 999px; cursor: pointer; transition: background .2s;
}
.toggle-slider:before {
  content: ''; position: absolute; width: 16px; height: 16px;
  left: 3px; bottom: 3px; background: white; border-radius: 50%;
  transition: transform .2s;
}
.toggle input:checked + .toggle-slider { background: var(--green-500); }
.toggle input:checked + .toggle-slider:before { transform: translateX(18px); }

.section-divider { border: none; border-top: 1px solid var(--stone-200); margin: 20px 0; }

/* ── MODAL ───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; backdrop-filter: blur(3px);
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 28px; max-width: 560px; width: 90%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); position: relative;
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; font-size: 1rem;
  cursor: pointer; color: var(--stone-400);
}
.modal h3 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 16px; color: var(--green-900); }
.modal .form-group + .form-group { margin-top: 10px; }
.modal input, .modal select {
  width: 100%; padding: 8px 11px;
  border: 1px solid var(--stone-200); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .9rem;
}
.modal input:focus, .modal select:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 2px var(--green-200); }

.guest-block {
  border: 1px solid var(--stone-200); border-radius: var(--radius-sm);
  padding: 12px; margin-bottom: 10px;
}
.guest-block h4 { font-size: .85rem; color: var(--stone-700); margin-bottom: 8px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.add-guest-btn { background: none; border: 1px dashed var(--stone-300); border-radius: var(--radius-sm); padding: 7px; width: 100%; cursor: pointer; color: var(--stone-400); font-size: .82rem; }
.add-guest-btn:hover { border-color: var(--green-500); color: var(--green-700); }

/* ── TOAST ───────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 300;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--stone-900); color: var(--white);
  padding: 11px 18px; border-radius: var(--radius-md);
  font-size: .84rem; box-shadow: var(--shadow-lg);
  animation: slideIn .2s ease; max-width: 320px;
}
.toast.success { background: var(--green-900); border-left: 4px solid var(--green-500); }
.toast.error   { background: #7f1d1d; border-left: 4px solid var(--red-500); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── RESPONSIVE ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .booking-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .booking-sidebar { flex-direction: row; flex-wrap: wrap; height: auto; overflow-x: auto; }
  .sidebar-card { min-width: 240px; flex: 1; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidenav { flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--stone-200); }
}
