/* ============================================================
   Météo Saint-Connec — Plugin etoile.bzh
   Thème sombre, minimaliste
   ============================================================ */

#msc-dashboard {
    --bg:       #0f1117;
    --card:     #1a1d27;
    --border:   #2a2d3e;
    --text:     #e0e6f0;
    --muted:    #8b92a8;
    --accent:   #4fc3f7;
    --green:    #66bb6a;
    --yellow:   #ffca28;
    --orange:   #ffa726;
    --red:      #ef5350;
    --radius:   10px;
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: var(--text);
    background: var(--bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    max-width: 1100px;
    margin: 0 auto;
}

/* ─── En-tête ─────────────────────────────────────────────── */
.msc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.msc-title-block {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.msc-icon { font-size: 2rem; }

.msc-title-block h2 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--accent);
    font-weight: 700;
}

.msc-subtitle {
    margin: .2rem 0 0;
    font-size: .85rem;
    color: var(--muted);
}

.msc-header-right {
    text-align: right;
}

.msc-update-info,
.msc-next-refresh {
    margin: .25rem 0 0;
    font-size: .78rem;
    color: var(--muted);
}

/* ─── Badges ──────────────────────────────────────────────── */
.msc-badge {
    display: inline-block;
    padding: .3em .75em;
    border-radius: 1em;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .03em;
}
.msc-badge-green  { background: var(--green);  color: #000; }
.msc-badge-vert   { background: var(--green);  color: #000; }
.msc-badge-yellow { background: var(--yellow); color: #000; }
.msc-badge-jaune  { background: var(--yellow); color: #000; }
.msc-badge-orange { background: var(--orange); color: #000; }
.msc-badge-red    { background: var(--red);    color: #fff; }
.msc-badge-rouge  { background: var(--red);    color: #fff; }

/* ─── Alertes ─────────────────────────────────────────────── */
#msc-alerts {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: 1rem;
}

.msc-alert {
    padding: .65rem 1rem;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    border-left: 4px solid transparent;
}

.msc-alert-green  { background: #1b3a1e; border-color: var(--green);  color: #a5d6a7; }
.msc-alert-orange { background: #3a2a0d; border-color: var(--orange); color: #ffcc80; }
.msc-alert-red    { background: #3a0d0d; border-color: var(--red);    color: #ef9a9a; animation: msc-pulse 1.5s infinite; }

@keyframes msc-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .7; }
}

/* ─── Toolbar ─────────────────────────────────────────────── */
.msc-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.msc-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.1rem;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
}
.msc-btn:hover { opacity: .85; }
.msc-btn:active { transform: scale(.97); }
.msc-btn:disabled { opacity: .5; cursor: not-allowed; }

.msc-btn-icon { font-size: 1rem; }

.msc-loading { font-size: .85rem; color: var(--muted); }

.msc-refresh-status {
    font-size: .82rem;
    color: var(--muted);
}
.msc-refresh-status.ok  { color: var(--green); }
.msc-refresh-status.err { color: var(--red); }

/* ─── Sections ────────────────────────────────────────────── */
.msc-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.25rem 1rem;
    margin-bottom: 1.25rem;
}

.msc-section h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--accent);
    font-weight: 600;
}

.msc-meta {
    font-size: .8rem;
    color: var(--muted);
    margin-bottom: .75rem;
}
.msc-meta a { color: var(--accent); text-decoration: none; }

/* ─── Tableaux ────────────────────────────────────────────── */
.msc-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.msc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}

.msc-table th,
.msc-table td {
    padding: .45rem .65rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
    white-space: nowrap;
}

.msc-table th {
    background: #131622;
    color: var(--muted);
    font-weight: 600;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.msc-table tbody tr:hover { background: rgba(79,195,247,.05); }

.msc-th-src { border-top: 2px solid var(--border); }
.msc-th-consensus { color: #ce93d8; }

.msc-day-label { text-align: left; font-weight: 600; }

/* Coloration température */
.msc-td-green  { background: rgba(102,187,106,.15); color: #a5d6a7; }
.msc-td-yellow { background: rgba(255,202,40,.12);  color: #ffe082; }
.msc-td-red    { background: rgba(239,83,80,.15);   color: #ef9a9a; }

/* Écart */
.msc-ecart       { font-weight: 700; }
.msc-ecart-ok    { color: var(--green); }
.msc-ecart-warn  { color: var(--yellow); }
.msc-ecart-alert { color: var(--red); }

/* Légende */
.msc-legend {
    font-size: .78rem;
    color: var(--muted);
    margin-top: .6rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}
.msc-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
}
.msc-dot.msc-green  { background: var(--green); }
.msc-dot.msc-yellow { background: var(--yellow); }
.msc-dot.msc-red    { background: var(--red); }

/* Séparateur journalier dans le tableau horaire */
.msc-day-sep td {
    background: var(--border);
    height: 3px;
    padding: 0;
}

.msc-hourly-wrap {
    max-height: 420px;
    overflow-y: auto;
}

/* Couleurs horaires */
.msc-temp-vhot  { color: #ff5252; font-weight: 700; }
.msc-temp-hot   { color: #ff8a65; }
.msc-temp-warm  { color: #ffcc80; }
.msc-temp-cool  { color: #80cbc4; }
.msc-temp-cold  { color: #90caf9; }

/* ─── Graphique ───────────────────────────────────────────── */
.msc-chart-wrap {
    position: relative;
    height: 280px;
}

/* ─── Pied de page ────────────────────────────────────────── */
.msc-footer {
    font-size: .75rem;
    color: var(--muted);
    text-align: center;
    padding-top: .75rem;
    border-top: 1px solid var(--border);
    line-height: 1.8;
}
.msc-footer a {
    color: var(--accent);
    text-decoration: none;
}
.msc-footer a:hover { text-decoration: underline; }

/* ─── Erreur ──────────────────────────────────────────────── */
.msc-error {
    color: var(--red);
    background: #3a0d0d;
    padding: .75rem 1rem;
    border-radius: var(--radius);
    font-size: .9rem;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
    #msc-dashboard { padding: 1rem; }
    .msc-header { flex-direction: column; }
    .msc-header-right { text-align: left; }
    .msc-chart-wrap { height: 200px; }
}

.msc-muted { color: var(--muted); font-size: .8rem; }
