/* FlowMap — Nordic Flow-Based Map Styles */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  background: #f5f5f5;
  color: #333;
}

/* ---- Layout ---- */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

#toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: #1a2b3c;
  color: #fff;
  flex-wrap: wrap;
  z-index: 1000;
  flex-shrink: 0;
}

#toolbar h1 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

#toolbar label {
  font-size: 12px;
  color: #aac;
  margin-right: 3px;
}

#toolbar .sep {
  width: 1px;
  height: 22px;
  background: #3a4b5c;
}

#net-flow-btn {
  background: #243545;
  border: 1px solid #3a5f80;
  color: #aac;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

#net-flow-btn.active {
  background: #2a5f8a;
  border-color: #6ab0e0;
  color: #fff;
}

#date-input {
  border: 1px solid #3a5f80;
  background: #243545;
  color: #eef;
  padding: 4px 7px;
  border-radius: 4px;
  font-size: 13px;
}

#period-wrap {
  min-width: 120px;
  max-width: 160px;
  flex-shrink: 0;
}

#status {
  font-size: 12px;
  color: #8ab;
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

#map {
  flex: 1;
  min-height: 0;
}

/* ---- Tom Select (dark theme) ---- */
.ts-wrapper {
  font-size: 13px;
}

.ts-control {
  background: #243545 !important;
  border: 1px solid #3a5f80 !important;
  color: #eef !important;
  border-radius: 4px !important;
  padding: 3px 7px !important;
  min-height: 30px !important;
}

.ts-dropdown {
  background: #1e2f40 !important;
  border: 1px solid #3a5f80 !important;
  color: #eef !important;
}

.ts-dropdown .option {
  padding: 5px 10px;
}

.ts-dropdown .option:hover,
.ts-dropdown .option.active {
  background: #2a4a65 !important;
  color: #fff !important;
}

.ts-dropdown .option.selected {
  background: #1a3a55 !important;
}

input.ts-control,
.ts-control input {
  color: #eef !important;
}

/* ---- Zonnamn-labels ---- */
.zone-label {
  font-size: 13px;
  font-weight: 700;
  color: #111111;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.9), -1px -1px 0 rgba(255,255,255,0.9),
               1px -1px 0 rgba(255,255,255,0.9), -1px 1px 0 rgba(255,255,255,0.9);
  white-space: nowrap;
  pointer-events: none;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* ---- Dagspris per zon ---- */
.price-label {
  font-size: 11px;
  font-weight: 600;
  color: #cc2200;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.9), -1px -1px 0 rgba(255,255,255,0.9),
               1px -1px 0 rgba(255,255,255,0.9), -1px 1px 0 rgba(255,255,255,0.9);
  white-space: nowrap;
  pointer-events: none;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* ---- MW-värde bredvid pilar ---- */
.flow-label {
  font-size: 11px;
  font-weight: 600;
  color: #111111;
  background: rgba(255, 255, 255, 0.82);
  padding: 1px 4px;
  border-radius: 2px;
  white-space: nowrap;
  pointer-events: none;
  border: none;
  box-shadow: none;
}

/* ---- Flödes-tooltips (hover på pilar) ---- */
.flow-tooltip {
  font-size: 12px;
  background: rgba(26, 43, 60, 0.95);
  color: #eef;
  border: 1px solid #3a5f80;
  border-radius: 4px;
  padding: 5px 9px;
  white-space: nowrap;
  line-height: 1.6;
}

.flow-tooltip strong {
  color: #9bc;
}

/* ---- Kart-tooltips ---- */
.zone-tooltip {
  font-size: 12px;
  background: rgba(30, 45, 60, 0.92);
  color: #eef;
  border: 1px solid #3a5f80;
  border-radius: 4px;
  padding: 4px 8px;
  white-space: nowrap;
}

/* ---- Legend ---- */
#legend {
  position: absolute;
  bottom: 28px;
  right: 10px;
  z-index: 1000;
  background: rgba(26, 43, 60, 0.9);
  color: #eef;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.7;
  min-width: 150px;
  pointer-events: none;
}

#legend h4 {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #9bc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.legend-line {
  width: 28px;
  height: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-thick {
  height: 8px;
}

/* ---- Responsivitet för iframe-inbäddning ---- */
@media (max-width: 500px) {
  #toolbar {
    gap: 8px;
    padding: 6px 10px;
  }

  #toolbar h1 {
    font-size: 13px;
  }

  #period-wrap {
    min-width: 100px;
  }

  #status {
    display: none;
  }
}
