/* Torodeo — motyw publicznych podstron sygnałów (dawniej inline w SignalsTheme.razor).
   Globalny arkusz RCL: ładowany raz w <head> hosta (App.razor) jako
   _content/Torodeo.Server.Website/css/signals.css. Obejmuje klasy współdzielone przez
   wszystkie strony (History/List/Details/NotFound) oraz nawigację i stopkę.
   Reguły to same klasy (.tdo-*/.f-*/.lang-*/…) — nie wyciekają na inne strony hosta.
   Fonty motywu ładujemy tu przez @import (Archivo / IBM Plex Sans / IBM Plex Mono). */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800;900&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ── Tło spójne ze stroną główną (animowany gradient + złote cząsteczki) ─────────────── */
.tdo-bg {
    /* Solidny kolor jako baza (maluje się zawsze — tak jak tło nagłówka/stopki); gradient jako
       wzbogacenie na wierzchu. Rozdzielone na background-color + background-image CELOWO: w hoście
       Tailwind Play CDN potrafił „zjeść" gradient (background-image), ale kolor zostaje. */
    background-color: #0a0e1a !important;
    background-image: linear-gradient(135deg, #0a0e1a 0%, #111827 25%, #0a0e1a 50%, #1a1510 75%, #0a0e1a 100%) !important;
    background-size: 400% 400%;
    animation: tdo-gradient 12s ease infinite;
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Treść (main/footer) nad warstwą cząsteczek (z-index:1). NAGŁÓWKA tu NIE ma — ma własny
   z-index:30 (.tdo-header), inaczej ta reguła (wyższa specyficzność) zbiłaby go do 2 i rozwijane
   menu języka wpadłoby POD treść strony. */
.tdo-bg > main,
.tdo-bg > footer {
    position: relative;
    z-index: 2;
}

.tdo-bg > main {
    flex: 1 0 auto;
}

@keyframes tdo-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.particles { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.particle { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: rgba(201,169,78,0.5); box-shadow: 0 0 4px rgba(201,169,78,0.5); }
@keyframes particle-float-1 { 0% { transform: translateY(100vh) translateX(0); opacity: 0; } 10% { opacity: 1; } 80% { opacity: 1; } 95% { opacity: 0; } 100% { transform: translateY(-100vh) translateX(50px); opacity: 0; } }
@keyframes particle-float-2 { 0% { transform: translateY(100vh) translateX(0); opacity: 0; } 15% { opacity: 1; } 75% { opacity: 1; } 92% { opacity: 0; } 100% { transform: translateY(-100vh) translateX(-30px); opacity: 0; } }
@keyframes particle-float-3 { 0% { transform: translateY(100vh) translateX(0); opacity: 0; } 12% { opacity: 1; } 78% { opacity: 1; } 93% { opacity: 0; } 100% { transform: translateY(-100vh) translateX(80px); opacity: 0; } }

/* ── Fonty (klasy f-*) ─────────────────────────────────────────────────────────────── */
.f-display { font-family: 'Archivo', system-ui, sans-serif; }
.f-sans { font-family: 'IBM Plex Sans', system-ui, sans-serif; }
.f-mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.tnum { font-variant-numeric: tabular-nums slashed-zero; }

.tdo-bg ::selection { background: rgba(70,214,163,0.28); }

/* ── Akordeon sekcji szczegółu — płynna animacja wysokości bez mierzenia w JS ────────── */
.acc { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .36s cubic-bezier(.4,0,.2,1); }
.acc.open { grid-template-rows: 1fr; }
.acc > .acc-inner { overflow: hidden; min-height: 0; }
.chev { transition: transform .2s ease; }
.chev.open { transform: rotate(180deg); }

/* ── Akordeon archiwum miesięcy (History) — single-open; animacja PRAWDZIWEJ wysokości ──
   minmax(0,0fr) wymusza TWARDE 0 przy zwinięciu. Klasę .open steruje signals.js. */
.macc { display: grid; grid-template-rows: minmax(0, 0fr); overflow: hidden; transition: grid-template-rows .4s cubic-bezier(.4,0,.2,1); }
.macc.open { grid-template-rows: minmax(0, 1fr); }
.macc > .macc-inner { overflow: hidden; min-height: 0; }
.month-block .month-dot { background: rgba(255,255,255,0.2); transition: background .2s ease; }
.month-block.open { border-color: rgba(255,255,255,0.16) !important; background: rgba(255,255,255,0.012); }
.month-block.open .month-dot { background: #d4ad5a; }

@keyframes tdo-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tdo-reveal { animation: tdo-rise .4s ease-out both; }

/* ── Zegar „siła sygnału" — delikatny sweep łuku 0 → wynik (czysty CSS, gra też po enhanced-nav) ── */
.tdo-gauge-fill { animation: tdo-gauge-fill .9s cubic-bezier(.4, 0, .2, 1) both; }
@keyframes tdo-gauge-fill { from { stroke-dasharray: 0 100; } }
.tdo-gauge-knob { animation: tdo-gauge-knob .4s ease .55s both; }
@keyframes tdo-gauge-knob { from { opacity: 0; } }

/* ── Nawigacja: pasek + selektor języka (natywny <details>, bez JS) ──────────────────── */
.tdo-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(7,10,17,0.82);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
/* Treść nawigacji wyrównana do tego samego kontenera co treść stron (max-w 1160, te same marginesy). */
.tdo-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    max-width: 1160px;
    margin-inline: auto;
    padding: 14px clamp(18px, 5vw, 52px);
}

.lang-menu { position: relative; }
.lang-menu > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.09);
    background: rgba(255,255,255,0.02);
    color: #c4ccd8;
    font-size: 11px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    transition: border-color .2s ease, background .2s ease, color .2s ease;
    -webkit-user-select: none;
    user-select: none;
}
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary:hover { border-color: rgba(255,255,255,0.2); color: #f3f6fb; }
.lang-menu[open] > summary { border-color: rgba(212,173,90,0.4); color: #f3f6fb; }
.lang-menu .lang-flag { display: inline-flex; width: 18px; height: 18px; border-radius: 3px; overflow: hidden; flex: none; }
.lang-menu .lang-flag svg { width: 100%; height: 100%; display: block; }
.lang-menu .lang-caret { transition: transform .2s ease; font-size: 9px; }
.lang-menu[open] .lang-caret { transform: rotate(180deg); }

.lang-menu > .lang-list {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    min-width: 210px;
    max-height: min(70vh, 420px);
    overflow-y: auto;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.09);
    background: rgba(13,17,26,0.97);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 48px rgba(0,0,0,0.55);
    z-index: 40;
    animation: tdo-rise .18s ease-out both;
}
.lang-menu .lang-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-radius: 9px;
    color: #c4ccd8;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.lang-menu .lang-item:hover { background: rgba(255,255,255,0.05); color: #f3f6fb; }
.lang-menu .lang-item.active { background: rgba(212,173,90,0.12); color: #e8c987; }
.lang-menu .lang-item .lang-name { font-size: 14px; font-weight: 500; }
.lang-menu .lang-item .lang-code { margin-inline-start: auto; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: #6f7889; }
.lang-menu .lang-item.active .lang-code { color: #d4ad5a; }

/* ── Stopka ──────────────────────────────────────────────────────────────────────────── */
.tdo-footer {
    margin-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(7,10,17,0.5);
}
.tdo-footer a.social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(201,169,78,0.14);
    background: rgba(201,169,78,0.05);
    color: rgba(201,169,78,0.65);
    transition: color .25s ease, border-color .25s ease, transform .25s ease;
}
.tdo-footer a.social:hover { color: #d4ad5a; border-color: rgba(201,169,78,0.35); transform: translateY(-2px); }

/* ── Redukcja ruchu ──────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .tdo-reveal { animation: none; }
    .acc { transition: none; }
    .tdo-bg { animation: none; }
    .particles { display: none; }
    .lang-menu > .lang-list { animation: none; }
    .tdo-gauge-fill, .tdo-gauge-knob { animation: none; }
    * { transition: none !important; }
}
