@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Light Marine Theme: White backgrounds, one blue */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-header: rgba(255, 255, 255, 0.95);
  
  --text-main: #000000; /* Pure black */
  --text-muted: #111827; /* Very dark gray */
  
  --accent: #0284c7; /* Classic marine blue */
  --accent-hover: #0369a1;
  
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  
  /* Status colors */
  --color-good: #059669;
  --color-medium: #d97706;
  --color-bad: #dc2626;
  --color-unknown: #94a3b8;
  --color-green: var(--color-good);
  --color-orange: var(--color-medium);
  --color-red: var(--color-bad);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

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

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 2rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--accent);
}

.brand {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.brand span {
  color: var(--accent);
  font-weight: 400;
}

nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

nav a {
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.15s ease;
}

nav a:hover, nav a.active {
  color: var(--text-main);
}

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Typography */
h1, h2, h3, h4 { margin-top: 0; margin-bottom: 0.75rem; color: var(--text-main); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
h1 { font-size: 1.8rem; border-bottom: 2px solid var(--accent); display: inline-block; padding-bottom: 4px; }
h2 { font-size: 1.3rem; }
p { margin-top: 0; margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  background-color: transparent;
  color: var(--accent) !important;
  transition: all 0.15s ease;
}

.btn:hover {
  background-color: var(--accent);
  color: #000 !important;
}

.btn-small { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn-ghost { background: transparent; border: 1px solid var(--border-light); color: var(--text-main) !important; }
.btn-ghost:hover { background: var(--border); border-color: var(--text-main); }

/* Grid & Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }

.card {
  background: var(--bg-card);
  border-radius: 2px;
  border: 1px solid var(--border);
  padding: 1rem;
  transition: all 0.2s ease;
}

a.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

a.card-link:hover .card {
  transform: translateY(-3px);
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* Form Styles */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; margin-bottom: 0.4rem; font-weight: 500; font-size: 0.95rem; }
.form-control {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15); }

/* Alerts / Flashes */
.flash { padding: 1rem; border-radius: var(--radius-md); margin-bottom: 1.5rem; font-weight: 500; border-left: 4px solid; }
.flash-success { background: rgba(16, 185, 129, 0.1); border-color: var(--color-good); color: var(--color-good); }
.flash-error { background: rgba(239, 68, 68, 0.1); border-color: var(--color-bad); color: #fca5a5; }

/* Marine-specific UI Components */
.confidence-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.confidence-fill {
  height: 100%;
  background: var(--accent);
}

.visi-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}
.bg-good { background-color: var(--color-good); }
.bg-medium { background-color: var(--color-medium); }
.bg-bad { background-color: var(--color-bad); }

.forecast-day {
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.forecast-day-header {
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.forecast-day-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-main);
}

.forecast-hours {
  display: flex;
  overflow-x: auto;
  gap: 0.75rem;
  padding: 1.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.forecast-hour-card {
  min-width: 90px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  padding: 0.75rem 0.5rem;
}

.hour-time { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.4rem; font-weight: 600; }
.hour-val { font-size: 1.25rem; font-weight: 800; margin-bottom: 0.2rem; }
.hour-sub { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; text-align: left; }

.confidence-indicator {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}
footer a { color: var(--text-muted); text-decoration: underline; }

@media (max-width: 640px) {
  .topbar { padding: 1rem; }
  .grid { grid-template-columns: 1fr; }
}

/* Bandeau de Lancement */
.launch-banner {
  background: var(--accent);
  color: #ffffff;
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
  text-align: center;
}
.launch-banner a {
  color: #ffffff;
  text-decoration: underline;
  font-weight: 700;
}

/* Barre de Navigation Mobile Ergonomique (Fixe en bas) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
.mobile-bottom-nav ul {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 56px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mobile-bottom-nav li {
  flex: 1;
  text-align: center;
}
.mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}
.mobile-bottom-nav a:hover, .mobile-bottom-nav a.active {
  color: var(--accent);
}
.mobile-bottom-nav .nav-icon {
  font-size: 1.15rem;
  line-height: 1;
  margin-bottom: 2px;
}

@media (max-width: 768px) {
  .mobile-bottom-nav { display: block; }
  body { padding-bottom: calc(65px + env(safe-area-inset-bottom, 0px)); }
}

/* Section Favoris Universels & Cartes Moyennes */
.favorites-section {
  margin-bottom: 1.5rem;
}
.fav-empty-banner {
  background: var(--bg-card);
  border: 1px dashed var(--border-light);
  border-radius: 4px;
  padding: 0.85rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.favorites-cards-container {
  display: flex;
  overflow-x: auto;
  gap: 1rem;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.fav-medium-card {
  min-width: 270px;
  max-width: 320px;
  flex: 0 0 285px;
  scroll-snap-align: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
}
.fav-medium-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.06);
  border-color: var(--accent);
}
.fav-star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.35rem;
  padding: 4px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f59e0b;
  line-height: 1;
  transition: transform 0.1s ease;
}
.fav-star-btn:hover {
  transform: scale(1.18);
}
.fav-star-btn.inactive {
  color: #94a3b8;
}

/* Modal Installation PWA */
.pwa-install-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.pwa-modal-box {
  background: var(--bg-card);
  border-radius: 8px;
  max-width: 440px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* --- Bouton Flottant & Bannière Relevé en Mer --- */
.btn-floating-obs {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 500;
  background: var(--accent);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
  transition: all 0.2s ease;
}
.btn-floating-obs:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.55);
}
.btn-floating-obs.active {
  background: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.35);
}

.obs-mode-banner {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: 24px;
  padding: 8px 18px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 90%;
  color: var(--text-main);
}

/* Modale Observation Éclair (15s) */
.obs-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 2500;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.obs-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-width: 520px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

.water-color-pills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 6px;
}
.water-color-pill {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-main);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  user-select: none;
}
.water-color-pill:hover {
  border-color: var(--accent);
}
.water-color-pill.active {
  border-color: var(--accent);
  background: rgba(2, 132, 199, 0.12);
  font-weight: 700;
  color: var(--accent);
}
.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Pastilles Badge d'Observation Récente sur la Carte */
.obs-map-pill-wrapper {
  background: transparent;
  border: none;
}
.obs-map-pill {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.obs-map-pill:hover {
  transform: scale(1.08);
  z-index: 1000 !important;
}
.obs-map-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Formulaire & Modale Feedback */
.feedback-cat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.feedback-cat-label:hover {
  border-color: var(--accent);
  background: rgba(2, 132, 199, 0.04);
}
.feedback-cat-label input[type="radio"] {
  accent-color: var(--accent);
  margin: 0;
}

/* Boutons de copie rapide */
.btn-copy-email {
  transition: all 0.2s ease;
}


