/* Meteolab 2027 - ARSO data table */
.ml-data-page-main {
  padding-bottom: 46px;
}

.ml-data-toolbar-card {
  background: #fff;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: 0 12px 34px rgba(15,23,42,.06);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
}

.ml-data-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ml-data-summary div {
  min-width: 116px;
  background: #f2f8fd;
  border: 1px solid rgba(21,130,199,.10);
  border-radius: 16px;
  padding: 10px 12px;
}

.ml-data-summary span,
.ml-data-toolbar label > span {
  display: block;
  font-size: .72rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #64748b;
  margin-bottom: 5px;
}

.ml-data-summary strong {
  font-size: 1.16rem;
  color: #0f172a;
}

.ml-data-toolbar {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 12px;
  align-items: end;
}

.ml-data-toolbar input,
.ml-data-toolbar select {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 14px;
  padding: 0 14px;
  background: #fff;
  color: #0f172a;
  font-weight: 650;
  outline: none;
}

.ml-data-toolbar input:focus,
.ml-data-toolbar select:focus {
  border-color: #002050;
  box-shadow: 0 0 0 3px rgba(21,130,199,.13);
}

.ml-data-table-card {
  padding: 0;
  overflow: hidden;
}

.ml-data-table-head {
  padding: 22px 22px 14px;
  align-items: center;
}

.ml-data-count {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #eaf5fc;
  color: #0d5f9c;
  font-weight: 800;
  font-size: .86rem;
  white-space: nowrap;
}

.ml-data-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 230px);
  border-top: 1px solid rgba(15,23,42,.08);
  -webkit-overflow-scrolling: touch;
}

.ml-data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1260px;
  font-size: .86rem;
}

.ml-data-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f4f8fc;
  color: #334155;
  text-align: right;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(15,23,42,.10);
  font-size: .76rem;
  line-height: 1.15;
  font-weight: 850;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.ml-data-table th:first-child,
.ml-data-table td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 5;
  background: #fff;
  min-width: 235px;
  box-shadow: 1px 0 0 rgba(15,23,42,.08);
}

.ml-data-table th:first-child {
  z-index: 6;
  background: #f4f8fc;
}

.ml-data-table th small {
  color: #64748b;
  font-weight: 750;
}

/* Sortiranje: nevtralna oznaka je vidna že pred prvim klikom. */
.ml-data-table th[data-sort] {
  position: sticky;
  cursor: pointer;
  user-select: none;
}

.ml-data-table th[data-sort]::after {
  content: ' ↕';
  color: #94a3b8;
  font-size: .78em;
  font-weight: 800;
}

.ml-data-table th[data-sort]:hover::after {
  color: #002050;
}

.ml-data-table th[data-sort].is-sort-asc::after {
  content: ' ↑';
  color: #002050;
}

.ml-data-table th[data-sort].is-sort-desc::after {
  content: ' ↓';
  color: #002050;
}

.ml-data-table td {
  padding: 11px 10px;
  text-align: right;
  border-bottom: 1px solid rgba(15,23,42,.065);
  color: #233143;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  background: #fff;
}

.ml-data-table tbody tr:hover td {
  background: #f8fbfe;
}

.ml-data-table tbody tr:hover td:first-child {
  background: #f8fbfe;
}

.ml-station-cell strong {
  display: block;
  color: #0f172a;
  font-size: .91rem;
  font-weight: 850;
}

.ml-station-cell small,
.ml-data-table td small {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: .72rem;
  font-weight: 650;
}

.ml-data-table tr.is-stale td,
.ml-data-table tr.is-stale .ml-value {
  color: #94a3b8 !important;
}

.ml-value {
  font-weight: 850;
}
.ml-value.is-cold { color: #2563eb; }
.ml-value.is-warm { color: #c97800; }
.ml-value.is-hot { color: #dc2626; }
.ml-value.is-rain { color: #0d77c8; }
.ml-value.is-rain-heavy { color: #1d4ed8; }
.ml-value.is-wind { color: #0f766e; }
.ml-value.is-wind-strong { color: #c2410c; }
.ml-value.is-humid { color: #1d4ed8; }
.ml-value.is-dry { color: #b45309; }

.ml-data-mobile-list {
  display: none;
  padding: 14px;
  gap: 12px;
}

.ml-station-mobile-card {
  border: 1px solid rgba(15,23,42,.09);
  border-radius: 18px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15,23,42,.06);
}

.ml-station-mobile-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.ml-station-mobile-card header strong {
  font-size: 1rem;
  color: #0f172a;
}

.ml-station-mobile-card header span {
  font-size: .74rem;
  font-weight: 800;
  color: #64748b;
  white-space: nowrap;
}

.ml-mobile-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ml-mobile-values div {
  background: #f5f9fd;
  border-radius: 14px;
  padding: 9px 10px;
}

.ml-mobile-values span {
  display: block;
  margin-bottom: 3px;
  font-size: .68rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #64748b;
}

.ml-mobile-values strong {
  font-size: .96rem;
  color: #0f172a;
}

.ml-station-mobile-card footer {
  margin-top: 11px;
  color: #64748b;
  font-size: .78rem;
  font-weight: 650;
}

.ml-data-note .ml-card {
  margin-top: 18px;
  padding: 22px;
}

.ml-data-note h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: #0f172a;
}

.ml-data-note p {
  margin: 0;
  color: #526176;
  line-height: 1.6;
}

.ml-data-error {
  padding: 22px;
  color: #b42318;
  background: #fff4f2;
}

@media (max-width: 1100px) {
  .ml-data-toolbar-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .ml-data-toolbar-card {
    padding: 13px;
    border-radius: 18px;
  }
  .ml-data-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .ml-data-summary div {
    min-width: 0;
    padding: 9px;
  }
  .ml-data-summary span {
    font-size: .62rem;
  }
  .ml-data-summary strong {
    font-size: .98rem;
  }
  .ml-data-toolbar {
    grid-template-columns: 1fr;
  }
  .ml-data-table-head {
    padding: 18px 16px 10px;
  }
  .ml-data-table-wrap {
    display: none;
  }
  .ml-data-mobile-list {
    display: grid;
  }
  .ml-data-count {
    font-size: .78rem;
  }
}


/* Mobile: show the complete ARSO parameter set */
.ml-mobile-value-wide {
  grid-column: 1 / -1;
}

@media (max-width: 420px) {
  .ml-mobile-values {
    grid-template-columns: 1fr;
  }
  .ml-mobile-value-wide {
    grid-column: auto;
  }
}


/* Meteolab 2027 – poenoten prikaz strani Podatki */
.ml-data-page-main {
  padding-top: 0;
}

.ml-data-toolbar-card {
  margin-top: 0;
}

.ml-data-summary {
  align-items: stretch;
}

.ml-data-summary-latest {
  min-width: 235px !important;
}

.ml-data-summary-latest strong {
  display: block;
  font-size: .98rem;
  line-height: 1.25;
  white-space: nowrap;
}

.ml-data-summary-latest small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: .72rem;
  font-weight: 700;
}

@media (max-width: 760px) {
  .ml-data-summary-latest {
    grid-column: 1 / -1;
  }

  .ml-data-summary-latest strong {
    white-space: normal;
  }
}

/* Mobile-only table/cards switch. Desktop retains the original full table. */
.ml-mobile-view-switch, .ml-mobile-table-hint { display:none; }
@media (max-width:760px) {
  .ml-mobile-view-switch { display:flex; gap:4px; margin:0 14px 10px; padding:4px; width:fit-content; border-radius:12px; background:#edf2f8; }
  .ml-mobile-view-switch button { min-height:44px; padding:10px 18px; border:0; border-radius:9px; background:transparent; color:#002050; font:inherit; font-weight:750; cursor:pointer; }
  .ml-mobile-view-switch button[aria-pressed="true"] { background:#002050; color:#fff; }
  .ml-mobile-view-switch button:focus-visible { outline:3px solid #1582c7; outline-offset:2px; }
  #dataPage[data-mobile-view="table"] .ml-data-table-wrap { display:block; max-height:none; }
  #dataPage[data-mobile-view="table"] .ml-data-mobile-list { display:none; }
  #dataPage[data-mobile-view="table"] .ml-mobile-table-hint { display:block; margin:0 14px 12px; font-size:.75rem; line-height:1.4; color:#526176; }
  #dataPage[data-mobile-view="cards"] .ml-data-table-wrap { display:none; }
  #dataPage[data-mobile-view="cards"] .ml-data-mobile-list { display:grid; }
  .ml-data-table th:first-child, .ml-data-table td:first-child { min-width:155px; max-width:190px; white-space:normal; }
  .ml-data-table td { padding:9px 8px; }
  .ml-data-table th { padding:10px 8px; }
  .ml-station-cell strong { font-size:.82rem; }
  .ml-data-summary > div:not(.ml-data-summary-latest) { display:none; }
  .ml-data-summary { display:block; }
  .ml-data-summary-latest { min-width:0 !important; }
}
