/* 5m5.amgil.swiss — Base Styles
   Nautical, clean, responsive */

/* === Variables === */
:root {
  --navy: #1a2744;
  --navy-80: #1a2744cc;
  --sea: #3d7c98;
  --sea-light: #5ba3c2;
  --sand: #f5f0e8;
  --sand-dark: #e8e0d0;
  --white: #ffffff;
  --accent: #c4553a;
  --success: #4a8c5c;
  --warn: #d4a843;
  --text: #2c2c2c;
  --text-light: #6b6b6b;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(26,39,68,0.08);
  --max-w: 1100px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--sand); color: var(--text); line-height: 1.55; }
a { color: var(--sea); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* === Header === */
.site-header {
  background: var(--navy);
  color: var(--white);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-logo {
  font-size: 1.25em;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.site-logo span { color: var(--sea-light); font-weight: 400; }

/* Language Switcher */
#lang-switcher { display: flex; gap: 4px; }
.lang-btn {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.lang-btn:hover { border-color: var(--sea-light); }
.lang-btn.active {
  background: var(--sea);
  border-color: var(--sea);
}

/* === Navigation === */
#main-nav {
  background: var(--white);
  border-bottom: 1px solid var(--sand-dark);
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.nav-item {
  padding: 12px 20px;
  font-size: 0.88em;
  font-weight: 500;
  color: var(--text-light);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all 0.15s;
}
.nav-item:hover { color: var(--navy); text-decoration: none; background: var(--sand); }
.nav-item.active { color: var(--navy); border-bottom-color: var(--sea); }

/* === Main Content === */
.page { max-width: var(--max-w); margin: 0 auto; padding: 24px; }
.page-title { font-size: 1.5em; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.page-subtitle { color: var(--text-light); margin-bottom: 24px; font-size: 0.95em; }

/* === Cards === */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--sand-dark);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 1.05em; color: var(--navy); margin-bottom: 8px; }

/* === Tables === */
.table-wrap { overflow-x: auto; margin: 16px 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.88em; }
th { background: var(--navy); color: var(--white); font-weight: 600; text-align: left; padding: 10px 12px; white-space: nowrap; }
td { padding: 8px 12px; border-bottom: 1px solid var(--sand-dark); }
tr:hover td { background: rgba(61,124,152,0.04); }

/* === Forms === */
fieldset { border: none; }
label { display: block; font-size: 0.88em; font-weight: 500; color: var(--text-light); margin-bottom: 12px; }
label > input, label > select, label > textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 12px;
  border: 1px solid var(--sand-dark);
  border-radius: var(--radius);
  font-size: 0.95em;
  font-family: var(--font);
  transition: border-color 0.15s;
}
label > input:focus, label > select:focus, label > textarea:focus {
  outline: none;
  border-color: var(--sea);
  box-shadow: 0 0 0 3px rgba(61,124,152,0.12);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: var(--radius);
  font-size: 0.88em;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
}
.btn-primary { background: var(--sea); color: var(--white); }
.btn-primary:hover { background: var(--navy); }
.btn-secondary { background: var(--sand-dark); color: var(--text); }
.btn-secondary:hover { background: var(--sand); }
.btn-danger { background: var(--accent); color: var(--white); }

/* === Vote Matrix === */
.vote-grid {
  display: grid;
  gap: 2px;
  font-size: 0.82em;
  overflow-x: auto;
}
.vote-cell { padding: 8px 6px; text-align: center; }
.vote-header { background: var(--navy); color: var(--white); font-weight: 600; font-size: 0.85em; }
.vote-boat { background: var(--sand); text-align: left; font-weight: 500; }
.vote-yes { background: #d4edda; }
.vote-maybe { background: #fff3cd; }
.vote-no { background: #f8d7da; }
.vote-mine { outline: 2px solid var(--sea); outline-offset: -2px; cursor: pointer; }
.vote-count { background: var(--navy-80); color: var(--white); font-weight: 700; }

/* === Tags / Badges === */
.badge {
  display: inline-block;
  font-size: 0.72em;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-active { background: #d4edda; color: var(--success); }
.badge-inactive { background: #f8d7da; color: var(--accent); }
.badge-uncertain { background: #fff3cd; color: var(--warn); }

/* === Toast === */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.88em;
  font-weight: 500;
  color: var(--white);
  z-index: 1000;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.3s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--success); }
.toast-error { background: var(--accent); }

/* === Loading === */
.loading { text-align: center; padding: 48px; color: var(--text-light); }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--sand-dark);
  border-top-color: var(--sea);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Responsive === */
@media (max-width: 768px) {
  .site-header { padding: 12px 16px; }
  .page { padding: 16px; }
  .page-title { font-size: 1.25em; }
  .nav-item { padding: 10px 14px; font-size: 0.82em; }
}
