/* ============================================================
   Flamec.Web — Feuille de styles principale
   Palette fidèle à l'application MAUI Flamec :
     Fond page :  #e5eff0  (bleu-gris clair)
     Cartes :     #437498  (bleu moyen)
     Labels :     white
     Valeurs :    greenyellow
   ============================================================ */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0; height: 100%;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #e5eff0;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

/* ---- Application container ---- */
.flamec-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #e5eff0;
}

/* ---- Toolbar fixe ---- */
.flamec-toolbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #437498;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    min-height: 52px;
}

.flamec-title {
    color: white;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.flamec-version {
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    margin-left: 8px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-gear {
    display: flex;
    align-items: center;
    text-decoration: none;
}

/* ---- Contenu principal ---- */
.flamec-content {
    flex: 1;
    padding: 4px 0 16px;
    background-color: #e5eff0;
}

/* ---- Cartes (fidèle FrameStyle MAUI) ---- */
.flamec-card {
    background-color: #437498;
    border-radius: 15px;
    margin: 10px;
    padding: 10px;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.4);
}

.flamec-card-clickable {
    cursor: pointer;
}
.flamec-card-clickable:active {
    opacity: 0.85;
    transform: scale(0.99);
}

/* ---- Typographie ---- */
.flamec-label {
    color: white;
    font-size: 22px;
    line-height: 1.3;
}

.flamec-value {
    color: greenyellow;
    font-size: 22px;
    font-weight: bold;
    line-height: 1.3;
}

.flamec-small {
    color: white;
    font-size: 16px;
}

.flamec-title-card {
    color: white;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 6px;
}

/* ---- Icônes de statut (28×28 px) ---- */
.status-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* ---- Images état appareils ---- */
.enrouleur-img { width: 120px; height: 120px; object-fit: contain; }
.group-img     { width:  92px; height:  92px; object-fit: contain; }
.battery-img   { width:  92px; height:  92px; object-fit: contain; }

/* ---- Grilles dans les cartes ---- */
.card-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.card-col-left  { flex: 0 0 auto; }
.card-col-right { flex: 1 1 auto; }

/* ---- Boutons switch image (Apple HIG ≥ 44×44) ---- */
.switch-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}
.switch-btn:active { transform: scale(0.9); }
.switch-btn img { width: 100px; height: 70px; object-fit: contain; }

/* ---- Boutons électrogène ---- */
.elec-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 44px;
    min-height: 44px;
    transition: transform 0.1s;
}
.elec-btn:active { transform: scale(0.88); }
.elec-btn img    { width: 120px; height: 80px; object-fit: contain; }
.elec-btn-label  { color: white; font-size: 18px; }

/* ---- Slider ---- */
.flamec-slider {
    width: 100%;
    height: 6px;
    accent-color: DeepSkyBlue;
    cursor: pointer;
    margin: 8px 0;
}

/* ---- Entrée numérique ---- */
.flamec-entry {
    background: transparent;
    border: none;
    border-bottom: 1px solid greenyellow;
    color: greenyellow;
    font-size: 20px;
    width: 80px;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
}
.flamec-entry::-webkit-inner-spin-button,
.flamec-entry::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ---- Séparateur ---- */
.flamec-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.25);
    margin: 8px 0;
}

/* ---- Page StartPage ---- */
.start-site-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-open {
    background-color: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 8px;
    color: white;
    font-size: 18px;
    padding: 8px 16px;
    cursor: pointer;
    min-width: 80px;
    min-height: 44px;
    transition: background-color 0.15s;
}
.btn-open:active { background-color: rgba(255,255,255,0.35); }

/* ---- Page Settings ---- */
.settings-body {
    background-color: #437498;
    min-height: calc(100vh - 52px);
    padding: 16px;
}

.settings-field {
    margin-bottom: 16px;
}

.settings-label {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    margin-bottom: 4px;
    display: block;
}

.settings-input {
    width: 100%;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 8px;
    color: white;
    font-size: 16px;
    padding: 10px 12px;
    outline: none;
    -webkit-appearance: none;
}
.settings-input::placeholder { color: rgba(255,255,255,0.45); }
.settings-input:focus { border-color: rgba(255,255,255,0.8); }

.settings-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-save-btn {
    width: 100%;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 10px;
    color: white;
    font-size: 18px;
    padding: 12px;
    cursor: pointer;
    margin-top: 20px;
    min-height: 48px;
    transition: background-color 0.15s;
}
.settings-save-btn:active { background-color: rgba(255,255,255,0.35); }

.settings-msg {
    text-align: center;
    margin-top: 10px;
    font-size: 15px;
    color: greenyellow;
}

/* ---- Animation MQTT pulse ---- */
@keyframes mqttPulse {
    0%   { opacity: 1;   transform: scale(1);    }
    50%  { opacity: 0.5; transform: scale(1.2);  }
    100% { opacity: 1;   transform: scale(1);    }
}
.mqtt-pulse { animation: mqttPulse 0.4s ease-in-out; }

/* ---- Jauge carburant SVG ---- */
.fuel-gauge-svg { display: block; overflow: visible; }

/* ---- Scrollbar fine ---- */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: #e5eff0; }
::-webkit-scrollbar-thumb { background: #437498; border-radius: 2px; }

/* ---- Responsive tablette/desktop : max 480px centré ---- */
@media (min-width: 600px) {
    .flamec-content { max-width: 520px; margin: 0 auto; }
}
