:root{
  --bg-dim: rgba(10, 12, 16, .35);
  --card: rgba(255,255,255,.94);
  --text: #0e1726;
  --muted: #5f6b7a;
  --river: #3b82f6;
  --air: #ff7b55;
  --shadow: 0 18px 45px rgba(0,0,0,.18);
  --radius: 18px;
}

*{ box-sizing: border-box; }

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  min-height:100vh;
  background:#0b0f17;
}

/* -------- Bakgrundsbild via .bg -------- */

.bg{
  position: fixed;
  inset: 0;
  background: url("/background-mobile.jpg") no-repeat center center fixed;
  background-size: cover;
  z-index: 0;
}

/* Tablet */
@media (min-width: 481px) and (max-width: 767px) {
  .bg {
    background: url("/background-tablet.jpg") no-repeat center center fixed;
    background-size: cover;
  }
}

/* Desktop */
@media (min-width: 768px) {
  .bg {
    background: url("/background-desktop.jpg") no-repeat center center fixed;
    background-size: cover;
  }
}

.overlay{
  position:fixed;
  inset:0;
  background: linear-gradient(
    180deg,
    var(--bg-dim) 0%,
    rgba(10,12,16,.15) 40%,
    rgba(10,12,16,.55) 100%
  );
  z-index: 1;
  pointer-events: none;
}

/* -------- Layout -------- */

.wrap{
  width:min(1100px, 92vw);
  margin: clamp(14px, 3vw, 32px) auto 48px;
  display:flex;
  flex-direction:column;
  gap:18px;
  position: relative;
  z-index: 2; /* innehåll över bg+overlay */
}

.top{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  padding: 6px 2px;
}
.top h1{
  margin:0;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  letter-spacing:.5px;
  text-shadow: 0 2px 0 rgba(255,255,255,.25);
}
.updated{
  color: #e9eef7;
  font-size: .95rem;
  text-shadow: 0 1px 10px rgba(0,0,0,.6);
}

/* -------- Temperatur-kort -------- */

.cards{
  display:grid;
  gap:16px;
  grid-template-columns: repeat(2, minmax(0,1fr));
}

.card{
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
  backdrop-filter: blur(6px);
}

.card-top{
  display:flex;
  gap:16px;
  align-items:center;
  padding: 18px 18px 12px;
}

/* Ikonerna som i mockup (utan ruta) */
.icon-left{
  width:56px;
  height:auto;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  background: transparent;
  border: 0;
  box-shadow: none;
  flex: 0 0 auto;
  margin-right: 2px;
}
.river-icon{ color: var(--river); }
.air-icon{ color: var(--air); }

.icon-svg{
  width:44px;
  height:44px;
  display:block;
  opacity: 1;
  transform: translateY(2px);
}

.value .temp{
  font-size: clamp(2.4rem, 4.8vw, 3.25rem);
  font-weight: 700;
  letter-spacing: .2px;
}

.unit{
  margin-left: 4px;
  font-size: 1em;
  font-weight: 700;
  color: inherit;
  vertical-align: baseline;
  position: static;
}
.unit::before{
  content: "°";
  margin-right: 1px;
}

.delta{
  margin-top: 2px;
  color: #4b5563;   /* lite mörkare än muted */
  font-size: .95rem;
}

.card-bottom{
  border-top: 1px solid rgba(0,0,0,.06);
  padding: 10px 18px 14px;
  color:#1a2433;
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.label{ color: var(--muted); font-size: .9rem; }
.max{ font-weight:600; }

/* -------- Diagram-kort -------- */

.chart-card{
  width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 10px 6px;
  overflow: hidden;
  margin-top: 4px; /* <-- lägg till */
}

/* Lite mer “pop” på korten */
.card, .chart-card{
  box-shadow:
    0 20px 50px rgba(0,0,0,.22),
    0 1px 0 rgba(255,255,255,.6) inset;
}

.chart-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 8px 10px 12px;

  background: linear-gradient(180deg, rgba(0,0,0,.04), transparent);
  border-bottom: 1px solid rgba(0,0,0,.04);
}

.chart-title{
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.controls{
  display:flex;
  align-items:center;
  gap:10px;
}

.segmented{
  display:flex;
  background: rgba(0,0,0,.06);
  border-radius: 999px;
  padding:4px;
  gap:4px;
}

.seg{
  border:0;
  background: transparent;
  padding:8px 12px;
  border-radius: 999px;
  cursor:pointer;
  font-weight:600;
  color:#1b2738;
}
.seg.active{
  background:#1b2b40;
  color:white;
  box-shadow: 0 6px 14px rgba(0,0,0,.2);

  outline: 2px solid rgba(255,255,255,.7);
  outline-offset: -2px;
}

/* Öga-knappen + ikon */
.eye{
  border:0;
  background: rgba(0,0,0,.06);
  width:38px;
  height:38px;
  border-radius:999px;
  cursor:pointer;
  display:grid;
  place-items:center;
  color:#1b2b40; /* ikonfärg */
}

.eye:hover{
  background: rgba(0,0,0,.10);
}

.eye-icon{
  width:20px;
  height:20px;
  display:block;
}

#chartWrap{
  padding: 0 4px 6px;
}
#chart{
  width:100%;
}

/* -------- ApexCharts: tvinga linjer synliga + färger -------- */
#chart .apexcharts-series path {
  opacity: 1 !important;
  stroke-opacity: 1 !important;
  fill: none !important;
  stroke-width: 3px !important;
}
#chart .apexcharts-series:nth-of-type(1) path {
  stroke: var(--river) !important;
}
#chart .apexcharts-series:nth-of-type(2) path {
  stroke: var(--air) !important;
}

/* -------- Responsivt -------- */
@media (max-width: 760px){
  .cards{ grid-template-columns: 1fr; }
  .updated{ display:none; }
}
