/* ============================================================
   Projet      : Réunion Météo — reunionmeteo.re
   Fichier     : assets/css/main.css
   Emplacement : /var/www/clients/client2/reunionmeteo.re/web/assets/css/main.css
   Rattaché à  : /var/www/clients/client2/reunionmeteo.re/web/index.php
                 (inclus via includes/header.php sur toutes les pages)

   Description : Feuille de style principale — thème sombre Ocean Indien
                 Dashboard météo temps réel, vigilances MF, cyclones,
                 cartes satellite, graphiques historiques.
                 Responsive : desktop / tablette (1100px) / mobile (768px / 480px)

   Auteur      : Thierry FRANCOIS <root@lakaz.re>
   Version     : 1.3
   Créé le     : 2025-10-01
   Modifié le  : 2026-03-08

   Changelog :
     1.0  — Création initiale, thème dark, layout dashboard
     1.1  — Bugfix bandeau vigilances : mapping couleurs, phénomènes, zones MF
     1.2  — Carte Leaflet interactive zones vigilances, layout 2 colonnes
            Responsive mobile : 3 breakpoints 1100 / 768 / 480px
     1.3  — Compactage tuiles dashboard (padding, font-size, gaps)
            Footer réduit à une seule ligne
            Bandeau vigilances compact sur mobile (icône + dot uniquement)
   ============================================================ */

:root {
    --bg:        #060d1a;
    --bg2:       #0b1628;
    --bg3:       #0f1e35;
    --card:      #0d1b2e;
    --card2:     #111f33;
    --border:    rgba(0,200,255,0.10);
    --border2:   rgba(0,200,255,0.22);
    --accent:    #00c8ff;
    --accent2:   #0084ff;
    --accent3:   #00ffb3;
    --warm:      #ff6b35;
    --gold:      #ffc940;
    --text:      #e8f4ff;
    --text2:     #7ba8cc;
    --text3:     #4a7a9b;
    --danger:    #ff3b5c;
    --warn:      #ffaa00;
    --ok:        #00e676;
    --shadow:    0 8px 32px rgba(0,0,0,0.5);
    --glow:      0 0 24px rgba(0,200,255,0.12);
    --radius:    16px;
    --radius-sm: 10px;
}

* { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Sora', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0,80,180,0.14) 0%, transparent 70%),
        radial-gradient(ellipse 40% 30% at 85% 15%, rgba(0,200,255,0.05) 0%, transparent 60%);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===== HEADER ===== */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(6,13,26,0.93);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border2);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 62px;
    padding: 0 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent2), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.logo-text strong {
    display: block;
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
    line-height: 1.2;
}
.logo-text span {
    font-size: 10px;
    color: var(--text3);
    font-weight: 400;
}

nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 12px;
}
nav a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--text2);
    transition: all 0.18s;
    white-space: nowrap;
}
nav a:hover { background: rgba(0,200,255,0.09); color: var(--accent); }
nav a.active { background: rgba(0,200,255,0.12); color: var(--accent); }

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.station-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 13px;
    font-size: 12px;
    color: var(--text2);
}
.station-badge.offline { border-color: rgba(255,59,92,0.3); }

.dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 6px var(--ok);
    flex-shrink: 0;
}
.dot-red {
    background: var(--danger);
    box-shadow: 0 0 6px var(--danger);
}

@keyframes pulse {
    0%,100% { opacity:1; transform:scale(1); }
    50%      { opacity:0.55; transform:scale(1.35); }
}
.dot { animation: pulse 2.2s infinite; }

.maj-time {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: var(--text3);
    white-space: nowrap;
}

/* ===== VIGILANCES BANNER ===== */
.vigilances-banner {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px;
    transition: background 0.3s;
}
.vigilances-banner.has-alert {
    background: rgba(255,100,0,0.08);
    border-bottom-color: rgba(255,100,0,0.3);
}

.vigilances-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.vigi-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    flex-shrink: 0;
    text-decoration: none;
    transition: color 0.2s;
}
.vigi-label:hover { color: var(--accent); }

.vigi-items {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.vigi-item {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text2);
    text-decoration: none;
    transition: all 0.18s;
}
.vigi-item:hover { border-color: var(--border2); color: var(--text); }

.vigi-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
@keyframes vigiPulse {
    0%,100% { opacity:1; transform:scale(1); }
    50%      { opacity:0.6; transform:scale(1.4); }
}
.vigi-pulse { animation: vigiPulse 1.4s infinite; }

.vigi-texte {
    font-size: 11px;
    font-weight: 600;
    margin-left: 2px;
}

/* ===== MAIN LAYOUT ===== */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px 20px;
}

/* ===== SECTION TITLE ===== */
.section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 16px 0 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ===== HERO SECTION ===== */
.hero-section {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.hero-temp-card {
    background: var(--card);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-width: 190px;
}
.hero-temp-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(0,200,255,0.07) 0%, transparent 65%);
    pointer-events: none;
}

.hero-temp-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}
.hero-temp-value {
    font-family: 'Space Mono', monospace;
    font-size: 54px;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-temp-unit { font-size: 22px; font-weight: 400; opacity: 0.6; }

.hero-temp-sub {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}
.hero-temp-sub span { font-size: 11px; color: var(--text3); }
.hero-temp-sub .val {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    color: var(--text2);
}
.tmin { color: var(--accent) !important; }
.tmax { color: var(--warm) !important; }

/* ===== TILES GRID ===== */
.grid-main {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    align-content: start;
}

.tile {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.tile:hover {
    transform: translateY(-2px);
    border-color: var(--border2);
    box-shadow: var(--glow);
}
.tile::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 0 0 var(--radius) var(--radius);
    opacity: 0.7;
}
.tile-blue::after   { background: linear-gradient(90deg, var(--accent2), var(--accent)); }
.tile-green::after  { background: linear-gradient(90deg, #00b894, var(--accent3)); }
.tile-orange::after { background: linear-gradient(90deg, var(--warm), var(--gold)); }
.tile-purple::after { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.tile-red::after    { background: linear-gradient(90deg, #e11d48, #fb7185); }
.tile-cyan::after   { background: linear-gradient(90deg, #06b6d4, #67e8f9); }
.tile-gold::after   { background: linear-gradient(90deg, var(--gold), #fde68a); }
.tile-teal::after   { background: linear-gradient(90deg, #0d9488, #5eead4); }

.tile-icon { font-size: 20px; margin-bottom: 6px; display: block; }
.tile-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 3px;
}
.tile-value {
    font-family: 'Space Mono', monospace;
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}
.tile-value .unit {
    font-size: 15px;
    font-weight: 400;
    color: var(--text3);
    margin-left: 2px;
}
.tile-sub {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text3);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.tile-sub .sub-val {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--text2);
}

/* Wind rose */
.wind-rose {
    position: absolute;
    top: 14px; right: 14px;
    width: 46px; height: 46px;
}

/* UV bar */
.uv-bar {
    margin-top: 9px;
    height: 5px;
    border-radius: 3px;
    background: linear-gradient(90deg, #00e676, #ffd600, #ff6d00, #d50000, #9c27b0);
    position: relative;
    overflow: visible;
}
.uv-indicator {
    position: absolute;
    top: -4px;
    width: 13px; height: 13px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--bg);
    transform: translateX(-50%);
    transition: left 0.6s ease;
    box-shadow: 0 0 6px rgba(255,255,255,0.5);
}

/* Pressure trend */
.trend-icon { font-size: 14px; }
.trend-up    { color: var(--warn); }
.trend-down  { color: var(--accent); }
.trend-stable{ color: var(--ok); }

/* ===== MAP CARDS ===== */
.map-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.map-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    transition: all 0.2s;
    display: block;
}
.map-card:hover {
    border-color: var(--border2);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.map-card-thumb {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    position: relative;
    overflow: hidden;
}
.map-thumb-sat    { background: linear-gradient(135deg, #0a1628, #1a3a5c); }
.map-thumb-radar  { background: linear-gradient(135deg, #0d1b0a, #1a3a1a); }
.map-thumb-storm  { background: linear-gradient(135deg, #1a0a28, #3a1a5c); }
.map-thumb-wind   { background: linear-gradient(135deg, #0a1a1a, #0a3a3a); }
.map-thumb-temp   { background: linear-gradient(135deg, #1a0a0a, #3a1a0a); }
.map-thumb-wave   { background: linear-gradient(135deg, #0a1428, #0a2a4a); }
.map-thumb-wlab   { background: linear-gradient(135deg, #0a2010, #1a4a2a); }
.map-thumb-cyclo  { background: linear-gradient(135deg, #1a0a28, #4a0a3c); }

.map-card-body { padding: 8px 12px; }
.map-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
}
.map-card-desc { font-size: 11px; color: var(--text3); }

/* ===== PAGE CARTES ===== */
.cartes-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    min-height: 600px;
}

.cartes-sidebar {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.carte-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.18s;
    cursor: pointer;
}
.carte-btn:hover, .carte-btn.active {
    background: var(--card2);
    border-color: var(--border2);
}
.carte-btn.active { border-color: var(--accent); }
.carte-btn-icon { font-size: 22px; flex-shrink: 0; }
.carte-btn-info {}
.carte-btn-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.carte-btn-desc { font-size: 11px; color: var(--text3); margin-top: 2px; }

.cartes-display {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

.carte-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}
.carte-header-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}
.carte-header-desc { font-size: 12px; color: var(--text3); margin-left: auto; }

.carte-iframe-wrap {
    flex: 1;
    position: relative;
}
.carte-iframe-wrap iframe {
    width: 100%;
    height: 100%;
    min-height: 560px;
    border: none;
    display: block;
}

/* ===== GRAPHIQUES ===== */
.graph-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.graph-tab {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text2);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s;
}
.graph-tab:hover, .graph-tab.active {
    background: var(--card2);
    border-color: var(--accent);
    color: var(--accent);
}

.graph-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

/* ===== FOOTER ===== */
footer {
    background: var(--bg2);
    border-top: 1px solid var(--border);
    padding: 12px 24px;
    margin-top: 20px;
}
.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text3);
    gap: 20px;
    flex-wrap: wrap;
}
.footer-disclaimer { font-size: 10px; font-style: italic; }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
    from { opacity:0; transform:translateY(14px); }
    to   { opacity:1; transform:translateY(0); }
}
.tile     { animation: fadeUp 0.4s ease both; }
.map-card { animation: fadeUp 0.4s ease both; }

.tile:nth-child(1) { animation-delay:.04s }
.tile:nth-child(2) { animation-delay:.08s }
.tile:nth-child(3) { animation-delay:.12s }
.tile:nth-child(4) { animation-delay:.16s }
.tile:nth-child(5) { animation-delay:.20s }
.tile:nth-child(6) { animation-delay:.24s }
.tile:nth-child(7) { animation-delay:.28s }
.tile:nth-child(8) { animation-delay:.32s }

.map-card:nth-child(1) { animation-delay:.06s }
.map-card:nth-child(2) { animation-delay:.10s }
.map-card:nth-child(3) { animation-delay:.14s }
.map-card:nth-child(4) { animation-delay:.18s }
.map-card:nth-child(5) { animation-delay:.22s }
.map-card:nth-child(6) { animation-delay:.26s }
.map-card:nth-child(7) { animation-delay:.30s }
.map-card:nth-child(8) { animation-delay:.34s }

/* ===== RESPONSIVE ===== */
/* ============================================================
   RESPONSIVE — Mobile first
   1100px : tablette paysage
    768px : tablette portrait / grand mobile
    480px : mobile
   ============================================================ */

/* ── 1100px ── */
@media (max-width: 1100px) {
    .grid-main        { grid-template-columns: repeat(3, 1fr); }
    .map-cards        { grid-template-columns: repeat(3, 1fr); }
    .footer-inner     { grid-template-columns: repeat(2, 1fr); }
    .cartes-layout    { grid-template-columns: 220px 1fr; }
    .vigi-layout      { grid-template-columns: 1fr 1fr; }
    .zones-grid       { grid-template-columns: repeat(2, 1fr); }
}

/* ── 768px ── */
@media (max-width: 768px) {

    /* Header */
    .header-inner     { padding: 0 14px; height: 54px; gap: 8px; }
    .logo-text span   { display: none; }
    nav               { margin-left: auto; }
    nav a             { padding: 6px 9px; font-size: 12px; gap: 3px; }
    nav a span        { display: none; }
    .station-badge    { display: none; }
    .maj-time         { font-size: 10px; }

    /* Bandeau vigilances */
    .vigilances-banner { padding: 4px 10px; }
    .vigilances-inner  { gap: 4px; justify-content: center; }
    .vigi-label        { display: none; }
    .vigi-items        { gap: 4px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0; }
    .vigi-item         { padding: 3px 8px; font-size: 10px; gap: 4px; flex-shrink: 0; border-radius: 6px; }
    .vigi-texte        { display: none; }
    .vigi-nom          { display: none; }

    /* Dashboard */
    .hero-section      { grid-template-columns: 1fr; }
    .hero-temp-value   { font-size: 52px; }
    .grid-main         { grid-template-columns: repeat(2, 1fr); }
    .map-cards         { grid-template-columns: repeat(2, 1fr); }

    /* Vigilances */
    .vigi-layout       { grid-template-columns: 1fr; }
    .vigi-hero         { grid-template-columns: 1fr; }
    #map-vigi974       { height: 320px !important; min-height: 320px !important; }
    .carte-ph-selector { gap: 4px; }
    .carte-ph-btn      { padding: 4px 8px; font-size: 10px; }
    .zones-grid        { grid-template-columns: 1fr 1fr; }

    /* Cartes */
    .cartes-layout     { grid-template-columns: 1fr; }
    .cartes-sidebar    { display: flex; overflow-x: auto; gap: 8px;
                         padding-bottom: 8px; flex-wrap: nowrap; }
    .carte-btn         { flex-shrink: 0; flex-direction: row;
                         padding: 8px 12px; min-width: 140px; }
    .carte-btn-desc    { display: none; }
    .carte-iframe-wrap { height: 400px; }

    /* Historique */
    .histo-filters     { flex-direction: column; gap: 8px; }
    .histo-filters select { width: 100%; }

    /* Footer */
    .footer-inner      { grid-template-columns: 1fr 1fr; }
    .footer-bottom     { flex-direction: column; gap: 4px; text-align: center; }
    .footer-disclaimer { font-size: 10px; }
}

/* ── 480px ── */
@media (max-width: 480px) {

    /* Header */
    .header-inner      { padding: 0 10px; height: 50px; }
    .logo-icon         { width: 30px; height: 30px; font-size: 15px; }
    .logo-text strong  { font-size: 13px; }
    nav a              { padding: 5px 7px; font-size: 11px; }
    .maj-time          { display: none; }

    /* Bandeau vigilances */
    .vigilances-banner { padding: 3px 8px; }
    .vigi-item         { padding: 2px 5px; font-size: 9px; }
    .vigi-dot          { width: 7px; height: 7px; }

    /* Dashboard */
    .grid-main         { grid-template-columns: 1fr 1fr; gap: 10px; }
    .map-cards         { grid-template-columns: 1fr 1fr; gap: 10px; }
    .hero-temp-value   { font-size: 44px; }
    .tile              { padding: 14px 12px; }
    .tile-value        { font-size: 22px; }

    /* Vigilances */
    .zones-grid        { grid-template-columns: 1fr; }
    .carte-vigi-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .carte-ph-selector { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
    .carte-ph-btn      { flex-shrink: 0; }
    #map-vigi974       { height: 260px !important; min-height: 260px !important; }

    /* Cartes */
    .carte-iframe-wrap { height: 340px; }
    .carte-header      { flex-wrap: wrap; gap: 8px; }
    .carte-header-desc { display: none; }

    /* Général */
    main               { padding: 14px 12px 40px; }
    .section-title     { font-size: 12px; }
    .footer-inner      { grid-template-columns: 1fr; }
}
