/* ===========================
   GENERELL LAYOUT FOR KARTET
   =========================== */

/* Hver brygge-blokk (B1, B2, B3...) */
.pier-row {
  display: inline-block;      /* gjør at bryggene kan stå ved siden av hverandre */
  vertical-align: top;
  margin-right: 16rem;
  margin-bottom: 2rem;
}

/* Teksten "Brygge B1" osv */
.pier-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Standard layout for brygger som ikke er "spesialhåndtert" med JS (f.eks. B3) */
.berth-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ===========================
   KORT FOR BÅTPLASSER
   =========================== */

.berth {
  position: relative;
  border-radius: 12px;
  padding: 0.35rem 0.5rem 0.4rem 0.5rem;
  border: 1px solid #dee2e6;
  background: #f8f9fa;
  font-size: 0.8rem;
  min-width: 140px;
  max-height: 50px;
  box-sizing: border-box;
}

.berth strong {
  display: block;
  margin-bottom: 0.1rem;
}

.berth .icons {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.75rem;
}

.berth .meta {
  display: block;
  font-size: 0.65rem;
  color: #444;
  line-height: 1.15;
}

/* Statusfarger: ledig / medlem / utleid */
.berth.vacant {
  background: #e8ffef;
  border-color: #b3ffca;
}

.berth.occupied {
  background: #ffe8e8;
  border-color: #ffb3b3;
}

.berth.rented {
  background: #fff7d6;
  border-color: #ffe08a;
}

/* ===========================
   BRYGGE B1
   - grå "brygge" + én side (høyre)
   =========================== */

.brygge-b1-layout {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

/* selve grå brygga */
.brygge-b1-center {
  min-width: 60px;
  background: #ced4da;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.25rem;
  font-size: 0.8rem;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* kolonne med båtplasser på høyre side */
.brygge-b1-side {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ===========================
   BRYGGE B2
   - grå "brygge" i midten + to sider
   =========================== */

.brygge-b2-layout {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.brygge-b2-side {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* venstre/høyre kan styles separat om du vil */
.brygge-b2-left {
  /* f.eks. align-items: flex-end; hvis du vil ha annet uttrykk */
}

.brygge-b2-right {
}

/* selve grå brygga */
.brygge-b2-center {
  min-width: 60px;
  background: #ced4da;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.25rem;
  font-size: 0.8rem;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* ===========================
   SMÅ JUSTERINGER
   =========================== */

/* litt luft under headingen i kartet (h2) */
h2 {
  margin-bottom: 0.75rem;
}

/* sørg for at kartet ikke blir helt sprengt på små skjermer */
@media (max-width: 768px) {
  .pier-row {
    display: block;
    margin-right: 0;
  }

  .brygge-b1-layout,
  .brygge-b2-layout {
    justify-content: flex-start;
  }
}


/* === Layout for B1 + B2 + gjestebrygge + Kaia === */
.harbor-grid {
  display: grid;
  grid-template-columns: 1fr 3rem 1fr;
  grid-template-areas:
    "kaia kaia kaia"
    "b1 . b2"
    ".  . guest";
  column-gap: 1rem;
  row-gap: 0.75rem;
  align-items: start;
  padding: 2rem;
  border: 3px solid #ced4da;
  border-radius: 16px;
  background: #f8f9fa;
  width: fit-content;
  margin: 1rem auto;
}

/* posisjonering */
.harbor-grid .pier-row[data-pier="B1"] { grid-area: b1; transform: translateY(60px); }
.harbor-grid .pier-row[data-pier="B2"] { grid-area: b2; transform: translateY(60px); }
.harbor-grid .kaia-row { grid-area: kaia; }
.harbor-grid .guest-dock { grid-area: guest; }

/* Gjestebrygge */
.guest-dock {
  position: relative;
  justify-self: start;
  padding: 0;
  transform: translateY(-290px) translateX(-200px); 
  background: none;
  border: none;
  box-shadow: none;
}

.guest-title {
  font-weight: 700;
  margin-bottom: .5rem;
}

.guest-body {
  background: linear-gradient(#d6d8db, #c7cbd1);
  border-radius: 12px;
  min-height: 100px;
  width: 370px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.guest-body .hint {
  font-size: .9rem;
  color: #495057;
}

/* Kaia */
.kaia-row {
  display: flex;
  gap: 0.1rem;
  align-items: center;
  justify-self: start;
  transform: rotate(-6deg) translateY(-10px);
  flex-wrap: nowrap;
}

.kaia-berth {
  min-width: 120px;
  max-height: 46px;
}

.kaia-bar {
  width: 200px;
  height: 48px;
  background: #ced4da;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  border: 1px solid #bfc3c9;
}

/* Mobiltilpasning */
@media (max-width: 900px) {
  .harbor-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "kaia"
      "b1"
      "b2"
      "guest";
    column-gap: 0;
  }
}
/* ===========================
   NAVBAR STYLING
   =========================== */
.nav-elevated {
  background: linear-gradient(120deg, #0d6efd, #0b5ed7);
  box-shadow: 0 6px 18px rgba(13, 110, 253, 0.25);
}

.nav-elevated .navbar-brand {
  font-weight: 700;
  letter-spacing: 0.3px;
}

.nav-elevated .nav-link {
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  margin-right: 0.35rem;
  transition: all 120ms ease;
  color: #e9f2ff;
}

.nav-elevated .nav-link:hover,
.nav-elevated .nav-link:focus {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.nav-elevated .nav-link.active {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-weight: 700;
}

.nav-elevated .dropdown-menu {
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
  padding: 0.5rem;
}

.nav-elevated .dropdown-item {
  border-radius: 10px;
  padding: 0.4rem 0.8rem;
}

.nav-elevated .dropdown-item:hover,
.nav-elevated .dropdown-item:focus {
  background: rgba(13, 110, 253, 0.12);
}

.nav-elevated .dropdown-header {
  font-size: 0.8rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===========================
   GLOBAL UI POLISH
   =========================== */
body {
  background: radial-gradient(circle at 10% 20%, rgba(13,110,253,0.05), transparent 35%),
              radial-gradient(circle at 90% 10%, rgba(32,201,151,0.07), transparent 30%),
              #f7f9fc;
}

main.container {
  max-width: 1200px;
}

.card {
  border: 1px solid #e7eaf3;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.card-header {
  border-bottom: 1px solid #e7eaf3;
  background: linear-gradient(120deg, rgba(13,110,253,0.08), rgba(13,110,253,0.02));
}

.card-title, .card h5, .card h6 {
  letter-spacing: 0.2px;
}

.list-group-item {
  border-color: #eef1f6;
}

.table {
  background: #fff;
}

.table-hover tbody tr:hover {
  background-color: rgba(13, 110, 253, 0.04);
}

.form-control, .form-select {
  border-radius: 10px;
  border-color: #dce1ed;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: #6ea8fe;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.btn {
  border-radius: 10px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.btn:hover, .btn:focus {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.badge {
  letter-spacing: 0.2px;
}

.shadow-soft {
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

/* Kaia justeringer */
.kaia-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: flex-start;
  justify-self: start;
  transform: rotate(-6deg) translateY(-10px);
}

.kaia-bar {
  width: 200px;
  height: 18px;
  background: #ced4da;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  border: 1px solid #bfc3c9;
  position: relative;
}

.kaia-berth {
  min-width: 140px;
  max-height: 46px;
  margin-left: 18px;
}

.kaia-name {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  font-size: 0.85rem;
  color: #343a40;
  pointer-events: none;
}

/* ===========================
   Opt-in square badges (keep bootstrap defaults otherwise)
   =========================== */
.badge-square {
  border-radius: 0 !important;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  padding: 0.125rem 0.625rem;
  border: 1px solid transparent;
}

.badge-soft-success { background-color: #dcfce7 !important; color: #166534 !important; border-color: #4ade80 !important; }
.badge-soft-warning { background-color: #fef9c3 !important; color: #854d0e !important; border-color: #facc15 !important; }
.badge-soft-info    { background-color: #dbeafe !important; color: #1d4ed8 !important; border-color: #93c5fd !important; }
.badge-soft-danger  { background-color: #fee2e2 !important; color: #991b1b !important; border-color: #f87171 !important; }
.badge-soft-secondary { background-color: #e2e8f0 !important; color: #334155 !important; border-color: #cbd5e1 !important; }
.badge-soft-primary { background-color: #e0f2fe !important; color: #0ea5e9 !important; border-color: #7dd3fc !important; }
.badge-soft-dark    { background-color: #e5e7eb !important; color: #111827 !important; border-color: #cbd5e1 !important; }
.badge-soft-light   { background-color: #f8fafc !important; color: #1f2937 !important; border-color: #e2e8f0 !important; }
