/* === VARIABLES & RESET === */
:root {
  --bg: #f5f5f5;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666666;
  --border: #e0e0e0;
  --primary: #1a6b3c;
  --primary-light: #e8f5e9;
  --accent: #d35400;
  --danger: #c0392b;
  --nav-bg: #ffffff;
  --nav-height: 60px;
  --header-height: 56px;
  --radius: 10px;

  /* Couleurs catégories */
  --cat-hotel: #2980b9;
  --cat-monument: #e67e22;
  --cat-nature: #27ae60;
  --cat-ville: #8e44ad;
  --cat-restaurant: #c0392b;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding-bottom: calc(var(--nav-height) + 16px);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* === HEADER === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  color: #fff;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h1 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* === BOTTOM NAV === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 500;
  gap: 2px;
  padding: 4px 0;
  min-width: 56px;
  transition: color 0.15s;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

/* === MAIN CONTENT === */
.main {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}

/* === CARDS === */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-hotel { background: var(--cat-hotel); }
.badge-monument { background: var(--cat-monument); }
.badge-nature { background: var(--cat-nature); }
.badge-ville { background: var(--cat-ville); }
.badge-restaurant { background: var(--cat-restaurant); }

.badge-statut {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.statut-a_voir { background: #fff3e0; color: #e65100; }
.statut-visite { background: #e8f5e9; color: #2e7d32; }
.statut-annule { background: #ffebee; color: #c62828; }

/* === FILTERS === */
.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filters select, .filters input {
  flex: 1;
  min-width: 120px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

.btn:active { opacity: 0.7; }

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

.btn-danger {
  background: var(--danger);
  color: #fff;
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

/* === FORMS === */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

/* === MAP === */
#map {
  width: 100%;
  height: calc(100vh - var(--header-height) - var(--nav-height));
  z-index: 1;
}

.marker-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  font-weight: 700;
}

/* === ITINERAIRE === */
.jour-header {
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}

.jour-section {
  margin-bottom: 20px;
}

/* === BUDGET === */
.budget-total {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
}

.budget-total .montant {
  font-size: 1.8rem;
  font-weight: 700;
}

.budget-total .label {
  font-size: 0.85rem;
  opacity: 0.9;
}

.budget-reste {
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius);
  padding: 12px 16px;
  text-align: center;
  margin-bottom: 16px;
  font-weight: 600;
}

.budget-reste.negatif {
  background: #ffebee;
  color: var(--danger);
}

.depense-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

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

.depense-montant {
  font-weight: 700;
  white-space: nowrap;
}

.depense-cat {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* === MODAL === */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--bg-card);
  border-radius: 16px 16px 0 0;
  padding: 20px 16px;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

.modal-header h2 {
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}

/* === JOURNAL === */
.jour-tab {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.jour-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.jour-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

/* === UTILITIES === */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }

/* === RESPONSIVE >= 768px === */
@media (min-width: 768px) {
  .main {
    max-width: 700px;
    padding: 24px;
  }

  .bottom-nav {
    max-width: 600px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 16px 16px 0 0;
  }
}
