/* Fjern marger og padding fra body og html */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden; /* Forhindrer scrolling */
}

/* Gjør kartet fullskjerm */
#map {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}

/* =========================
   LOGO (responsiv)
   ========================= */

/* Logo-plassering */
#logo {
    position: absolute;
    top: 10px;
    left: 60px;         /* flytt vekk fra Leaflet zoom (+/-) */
    z-index: 1000;
    pointer-events: none; /* logo skal ikke stjele touch/pan på mobil */
}

/* Logo-størrelse: skalerer responsivt */
#logo img {
    width: clamp(70px, 12vw, 200px); /* min, responsiv, max */
    height: auto;
    opacity: 0.9; /* litt mindre visuelt trykk */
}

/* =========================
   LABELS FOR FARTØY
   ========================= */

/* ===== LABELS UTEN HVIT BAKGRUNN ===== */

.vessel-label,
.installation-label {
    background: transparent !important;
    border: none !important;
}

.vessel-label div,
.installation-label div {
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    border: none !important;

    font-size: 12px;
    font-weight: 700;
    color: #111;
    white-space: nowrap;

    /* lesbarhet uten boks */
    text-shadow:
        0 0 4px rgba(255,255,255,0.9),
        0 0 2px rgba(255,255,255,0.9);
}

/* =========================
   POPUP STYLING (Desktop)
   ========================= */

/* Standard popup styling */
.leaflet-popup-content-wrapper {
    width: auto !important;
    max-width: 800px;
    min-width: 600px;
    height: auto !important;
}

/* Popup-innhold */
.leaflet-popup-content {
    padding: 8px;
    font-size: 14px;
    margin: 0; /* Leaflet legger ofte på margin */
}

/* iFrame i popup */
.leaflet-popup-content iframe {
    width: 100% !important;
    height: 500px;
    border: none;
}

/* =========================
   MOBILTILPASNING
   ========================= */

@media (max-width: 600px) {

    /* Logo: mindre, litt mindre prangende */
    #logo {
        top: 8px;
        left: 55px; /* fortsatt vekk fra zoom */
    }

    #logo img {
        width: 85px;   /* override for mobil (du kan teste 70–100px) */
        opacity: 0.8;
    }

    /* Popup: bredde tilpasset skjerm */
    .leaflet-popup-content-wrapper {
        max-width: 92vw !important;
        min-width: 240px !important;
    }

    /* Popup-innhold: litt mindre tekst */
    .leaflet-popup-content {
        font-size: 12px !important;
        padding: 6px;
    }

    /* iFrame: lavere høyde på mobil */
    .leaflet-popup-content iframe {
        height: 220px !important;
    }
}
/* =========================
   HAVTIL RAPPORTER
   ========================= */

.havtil-section {
    margin-top: 8px;
    padding-top: 6px;
}

.havtil-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 13px;
}

.havtil-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.havtil-report-list {
    margin: 0;
    padding-left: 18px;
}

.havtil-report-item {
    margin-bottom: 8px;
    line-height: 1.3;
}

.havtil-report-item a {
    color: #1a5d96;
    text-decoration: none;
    font-weight: 500;
}

.havtil-report-item a:hover {
    text-decoration: underline;
}

.havtil-report-item small {
    color: #666;
}

/* Mobil */
@media (max-width: 600px) {

    .havtil-header {
        font-size: 12px;
    }

    .havtil-icon {
        width: 16px;
        height: 16px;
    }

    .havtil-report-item {
        margin-bottom: 10px;
    }
}

/* =========================
   FLIGHT OPS
   ========================= */

.flight-airport-marker,
.flight-airport-label,
.flight-hospital-marker,
.flight-hospital-label {
  background: transparent;
  border: none;
}

.flight-airport-symbol {
  width: 12px;
  height: 12px;
  background: #1f6fb2;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

.flight-hospital-symbol {
  width: 16px;
  height: 16px;
  background: white;
  border: 2px solid #b00020;
  border-radius: 3px;
  color: #b00020;
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  box-sizing: border-box;
}

.flight-airport-label,
.flight-hospital-label {
  color: #111;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  text-shadow:
    -1px -1px 0 white,
    1px -1px 0 white,
    -1px 1px 0 white,
    1px 1px 0 white;
}
.flight-airport-marker,
.flight-hospital-marker,
.flight-airport-label,
.flight-hospital-label {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}
.flight-ops-dot {
  display: block !important;
  width: 10px !important;
  height: 10px !important;
  background: #000 !important;
  border: 1px solid #fff !important;
  border-radius: 50% !important;
  box-sizing: border-box !important;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.9) !important;
}
.flight-grid-label {
  background: rgba(255, 255, 255, 0.8);
  border: none;
  box-shadow: none;
  color: #333;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 4px;
  white-space: nowrap;
}

.flight-grid-label::before {
  display: none;
}
#flightGridOverlay {
  position: absolute;
  inset: 0;
  z-index: 450;
  pointer-events: none !important;
  font-family: Arial, sans-serif;
}

#flightGridOverlay *,
#gridTop,
#gridLeft,
.gridTopLabel,
.gridLeftLabel {
  pointer-events: none !important;
}

#gridTop {
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  height: 20px;
}

#gridLeft {
  position: absolute;
  top: 0;
  left: 4px;
  bottom: 0;
  width: 60px;
}

.gridTopLabel {
  position: absolute;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
  text-shadow:
    1px 1px 2px white,
    -1px -1px 2px white;
}

.gridLeftLabel {
  position: absolute;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
  text-shadow:
    1px 1px 2px white,
    -1px -1px 2px white;
}
#flightPlanningPanel{
    display: none;
    position:absolute;
    left:50%;
    bottom:12px;
    transform:translateX(-50%);

    width:700px;
    max-width:90%;

    background:rgba(255,255,255,.95);

    border-radius:10px;
    box-shadow:0 2px 10px rgba(0,0,0,.35);

    z-index:1200;

    font-size:14px;
    
}

.flightPlanningHeader{
    padding:8px;
    font-weight:600;
    border-bottom:1px solid #ddd;
}

.flightPlanningBody{
    padding:10px;

    display:flex;
    gap:8px;
    align-items:center;
    flex-wrap:wrap;
}

.flightPlanningBody input{

    width:80px;

    text-transform:uppercase;

    padding:4px;
}

#flightPlanningResult{

    margin-left:15px;

    font-weight:600;
}
.flightPlanningHeader{
    display:flex;
    justify-content:space-between;
    align-items:center;

    padding:8px 12px;
    font-weight:bold;
    border-bottom:1px solid #ddd;
}

#toggleFlightPlanning{
    background:none;
    border:none;
    cursor:pointer;
    font-size:16px;
    font-weight:bold;
}