/* LRAL kosmiskie laikapstākļi — publiskais skats.
   Gaišā tēma ar zīmola krāsu #73281E, saskaņota ar pārējām LRAL lapām. */

.lsw { max-width: 1180px; margin: 0 auto; }

/* ------------------------------- Galvene ------------------------------- */

.lsw-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.lsw-head-title { font-size: 1.5rem; font-weight: 800; color: #1e293b; margin: 0 0 4px; }
.lsw-head-sub { margin: 0; color: #64748b; font-size: .92rem; }

.lsw-head-side { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lsw-updated { font-size: .78rem; color: #94a3b8; text-align: right; line-height: 1.4; }
.lsw-updated strong { color: #475569; font-size: .85rem; }

.lsw-refresh {
    padding: 8px 16px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 600;
    color: #73281E;
    text-decoration: none;
    white-space: nowrap;
    transition: all .2s;
}

.lsw-refresh:hover { background: #73281E; color: #fff; border-color: #73281E; }

/* -------------------------------- Rindas -------------------------------- */

/* stretch, nevis start: citādi katra karte aug pēc sava satura un rinda
   izskatās haotiska. Kartes iekšpusē avota rinda tiek piespiesta apakšai,
   tāpēc vienāds augstums izskatās kārtīgi, nevis tukši izstiepts. */
.lsw-row {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
    align-items: stretch;
}

.lsw-row-2 { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }
.lsw-row-3 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.lsw-row-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.lsw-row > .lsw-card, .lsw-row > .lsw-chart { margin-bottom: 0; }

/* Grafiki ārpus rindas — pilnā platumā, viens zem otra */
.lsw-chart { margin-bottom: 20px; }

.lsw-warn {
    padding: 10px 16px;
    margin: 0 0 20px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    color: #92400e;
    font-size: .9rem;
}

.lsw-empty { text-align: center; padding: 60px 20px; color: #64748b; }

/* ------------------------- NOAA paziņojumi ------------------------- */

.lsw-alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }

.lsw-alert {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 9px 14px;
    border-radius: 8px;
    border-left: 4px solid #cbd5e1;
    background: #f8fafc;
    font-size: .88rem;
    flex-wrap: wrap;
}

.lsw-alert-kind {
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.lsw-alert-txt { flex: 1 1 240px; color: #334155; }
.lsw-alert-time { font-size: .75rem; color: #94a3b8; white-space: nowrap; }

.lsw-alert-now   { border-left-color: #dc2626; background: #fef2f2; }
.lsw-alert-soon  { border-left-color: #ea580c; background: #fff7ed; }
.lsw-alert-watch { border-left-color: #eab308; background: #fefce8; }
.lsw-alert-past  { border-left-color: #cbd5e1; }

.lsw-alert-now   .lsw-alert-kind { color: #b91c1c; }
.lsw-alert-soon  .lsw-alert-kind { color: #c2410c; }
.lsw-alert-watch .lsw-alert-kind { color: #a16207; }
.lsw-alert-past  .lsw-alert-kind { color: #94a3b8; }

/* --------------------------- Rādītāju flīzes --------------------------- */

.lsw-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 26px;
}

.lsw-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 14px 12px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    text-align: center;
}

.lsw-tile-head { display: flex; align-items: center; gap: 7px; }
.lsw-tile-ico { display: inline-flex; opacity: .85; }
.lsw-tile-num { font-size: 2.1rem; font-weight: 800; color: #73281E; line-height: 1.05; }
.lsw-tile-lbl { font-size: .78rem; color: #475569; font-weight: 600; }

.lsw-tile-delta { font-size: .78rem; font-weight: 700; }
.lsw-tile-delta em { font-style: normal; font-weight: 400; color: #94a3b8; }
.lsw-tile-delta.up   { color: #b45309; }
.lsw-tile-delta.down { color: #15803d; }
.lsw-tile-delta.flat { color: #94a3b8; }

.lsw-tile-src,
.lsw-card-src {
    font-size: .7rem;
    color: #94a3b8;
    margin: 0;
}

.lsw-tile-src { margin-top: 2px; }
.lsw-card-src { margin-top: 12px; padding-top: 10px; border-top: 1px solid #f1f5f9; }

/* ------------------------------- Kartes ------------------------------- */

.lsw-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
}

/* Galvenais saturs aizņem atlikušo augstumu, avota rinda paliek apakšā */
.lsw-card > .lsw-scales,
.lsw-card > .lsw-dl,
.lsw-card > .lsw-table,
.lsw-card > .lsw-vhf-grid,
.lsw-card > .lsw-chart-scroll { flex: 1 0 auto; }

.lsw-card > .lsw-card-src { margin-top: auto; }

.lsw-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #73281E;
    margin: 0 0 14px;
}

/* ---------------------------- VHF izplatīšanās ---------------------------- */

.lsw-vhf { border-color: #d9c2bd; }

.lsw-vhf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.lsw-vhf-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.lsw-vhf-item.is-open { background: #f0fdf4; border-color: #bbf7d0; }

.lsw-vhf-name { font-size: .88rem; color: #334155; }
.lsw-vhf-val { font-size: .85rem; font-weight: 700; color: #64748b; white-space: nowrap; }
.lsw-vhf-item.is-open .lsw-vhf-val { color: #15803d; }

/* ---------------------------- HF joslu tabula ---------------------------- */

.lsw-table { width: 100%; border-collapse: collapse; font-size: .9rem; }

.lsw-table thead th {
    text-align: left;
    padding: 6px 8px;
    font-size: .72rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid #e2e8f0;
}

.lsw-table td { padding: 8px; border-bottom: 1px solid #f1f5f9; }
.lsw-table tbody tr:last-child td { border-bottom: none; }
.lsw-band { font-weight: 700; color: #73281E; white-space: nowrap; }

.lsw-cond {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
}

.lsw-cond-good { background: #dcfce7; color: #15803d; }
.lsw-cond-fair { background: #fef9c3; color: #a16207; }
.lsw-cond-poor { background: #fee2e2; color: #b91c1c; }
.lsw-cond-na   { background: #f1f5f9; color: #94a3b8; }

/* Joslu saraksts ar krāsu punktiem */
.lsw-bands td { white-space: nowrap; }
.lsw-bands .lsw-band { font-size: .92rem; }

.lsw-dot {
    display: inline-block;
    width: 11px; height: 11px;
    border-radius: 50%;
    vertical-align: -1px;
    margin-right: 7px;
}

.lsw-dot-good { background: #22c55e; }
.lsw-dot-fair { background: #eab308; }
.lsw-dot-poor { background: #ef4444; }
.lsw-dot-na   { background: #cbd5e1; }

.lsw-dot-lbl { font-size: .82rem; color: #64748b; }

/* ------------------------------ NOAA skalas ------------------------------ */

/* Trīs kolonnas fiksēti — ar flex-wrap trešais gredzens nolēca zem pārējiem */
.lsw-scales {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    align-items: start;
    justify-items: center;
}

.lsw-scale { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }

.lsw-scale-ring {
    width: 66px; height: 66px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 4px solid #22c55e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.lsw-scale-k { font-size: .72rem; font-weight: 700; color: #64748b; }
.lsw-scale-v { font-size: 1.5rem; font-weight: 800; color: #334155; }
.lsw-scale-lbl { font-size: .74rem; color: #64748b; max-width: 110px; }

/* Līmeņa krāsa: 0 mierīgs → 5 ekstremāls */
.lsw-lvl-0 { border-color: #22c55e; }
.lsw-lvl-1 { border-color: #eab308; }
.lsw-lvl-2 { border-color: #f59e0b; }
.lsw-lvl-3 { border-color: #ea580c; }
.lsw-lvl-4 { border-color: #dc2626; }
.lsw-lvl-5 { border-color: #7f1d1d; }

/* ------------------------------ Saules vējš ------------------------------ */

.lsw-dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.lsw-dl dt { font-size: .85rem; color: #64748b; }
.lsw-dl dd { margin: 0; font-size: .95rem; font-weight: 700; color: #334155; text-align: right; }
.lsw-bz-neg { color: #b91c1c; }

.lsw-grey-win { color: #73281E; white-space: nowrap; }

/* -------------------------------- Attēli -------------------------------- */

.lsw-img-card { margin-bottom: 0; }

/* Attēli aug ļoti dažādās proporcijās (kvadrātveida saule pret platu MUF
   karti), tāpēc augstumu ierobežo un mērogo, saglabājot proporcijas. */
.lsw-img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8fafc;
    display: block;
    flex: 1 0 auto;
}

/* Pogas zem attēla; justify-content, lai tās nesalīp pie kreisās malas */
.lsw-img-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}

/* !important, jo tēmas globālais button stils citādi pārraksta fonu un
   aktīvo cilni nevar atšķirt — tā pati kļūme jau bija sacensību filtriem. */
.lsw-img-tab {
    padding: 4px 10px;
    background: #fff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    color: #73281E !important;
    cursor: pointer;
    transition: all .2s;
    text-shadow: none;
}

.lsw-img-tab:hover { border-color: #73281E !important; }
.lsw-img-tab.active {
    background: #73281E !important;
    color: #fff !important;
    border-color: #73281E !important;
}

.lsw-img-src { margin: 8px 0 0; font-size: .74rem; color: #94a3b8; text-align: right; }
.lsw-img-src a { color: #94a3b8; }

/* -------------------------------- Grafiks -------------------------------- */

.lsw-chart {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    margin: 20px 0;
}

.lsw-svg { width: 100%; height: auto; display: block; }

.lsw-wind-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 10px;
    font-size: .8rem;
    color: #64748b;
}

.lsw-wind-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lsw-wind-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ------------------- Dienas panelis (sacensību lapā) ------------------- */

.lsw-day {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    margin: 28px 0;
}

.lsw-day-title { font-size: 1.05rem; font-weight: 700; color: #73281E; margin: 0 0 12px; }

.lsw-day-verdict {
    display: inline-block;
    margin: 0 0 14px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 700;
}

.lsw-verdict-quiet     { background: #dcfce7; color: #15803d; }
.lsw-verdict-unsettled { background: #fef9c3; color: #a16207; }
.lsw-verdict-storm     { background: #ffedd5; color: #c2410c; }
.lsw-verdict-severe    { background: #fee2e2; color: #b91c1c; }

.lsw-day-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.lsw-day-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    text-align: center;
}

.lsw-day-num { font-size: 1.4rem; font-weight: 800; color: #73281E; line-height: 1.1; }
.lsw-day-lbl { font-size: .72rem; color: #64748b; }

.lsw-day-chart { max-width: 480px; }
.lsw-day-svg { width: 100%; height: auto; display: block; }
.lsw-day-chart-lbl { display: block; font-size: .72rem; color: #94a3b8; margin-top: 2px; }

.lsw-meta { text-align: center; color: #94a3b8; font-size: .82rem; margin: 18px 0 0; }
.lsw-meta a { color: #73281E; }

@media (max-width: 700px) {
    .lsw-tile-num { font-size: 1.6rem; }
    /* Grafiks saspiests kļūst nesalasāms — ļauj ritināt, teksts paliek normāls */
    .lsw-chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .lsw-chart-scroll .lsw-svg { min-width: 560px; }
}

/* Auroras novērtējums Latvijai */
.lsw-aurora-lv {
    margin: 10px 0 0;
    padding: 6px 12px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    font-size: .82rem;
    font-weight: 600;
    text-align: center;
}

.lsw-aurora-lv.is-possible { background: #dcfce7; color: #15803d; }
