
/* =========================================================
   SMART CAR - GPS
   Mise en page fixe proportionnelle (même principe que Dashboard)
   HTML original conservé : .gps-page est la scène à redimensionner
   ========================================================= */


/* =========================================================
   1. RESET GENERAL
   ========================================================= */

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

html,
body {
    width: 100%;
    min-height: 100%;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    position: relative;
    background: #000;
    color: #fff;
    font-family: Arial, sans-serif;
    overflow-x: hidden;
}


/* =========================================================
   2. PAGE GPS
   Dimensions de référence : 1100px
   ========================================================= */

.gps-page {
    position: absolute;
    top: 0;
    left: 50%;

    width: 1100px;
    max-width: none;

    margin: 0;
    padding: 18px 0 24px;

    transform: translateX(-50%) scale(var(--scene-scale, 1));
    transform-origin: top center;
}


/* =========================================================
   3. NAVIGATION SMART CAR
   ========================================================= */

.top-navigation {
    position: relative;

    width: 1100px;
    height: 70px;

    margin: 0 auto 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    z-index: 100;
}

.brand {
    width: 55%;
    height: 70px;

    display: flex;
    align-items: center;
}

/* LOGO */

#logo-smart,
.logo-smart-car {
    display: block;

    width: 1120px;
    max-width: none;

    height: auto;

    object-fit: contain;

    transform: translate(-12px, 3px);
}


/* =========================================================
   4. BOUTONS DE NAVIGATION
   ========================================================= */

.navigation-buttons {
    position: absolute;

    top: 10px;
    right: 0;

    display: flex;
    align-items: center;

    gap: 12px;
}

.navigation-buttons a {
    display: block;

    height: 58px;

    text-decoration: none;
}

.navigation-buttons img {
    display: block;

    width: auto;
    height: 100%;

    object-fit: contain;

    transition: transform 0.2s ease;
}

.navigation-buttons img:hover {
    transform: scale(1.05);
}


/* =========================================================
   5. CONTENU PRINCIPAL
   ========================================================= */

.gps-content {
    display: grid;

    grid-template-columns:
        minmax(0, 2.1fr)
        minmax(0, 0.9fr);

    column-gap: 22px;
    row-gap: 18px;

    align-items: start;

    width: 1100px;
}


/* =========================================================
   6. CARTE GPS
   ========================================================= */

.gps-map-section {
    width: 100%;
    min-width: 0;

    transform: translateY(10px);
}

/* CADRE GPS */

.gps-map-container {
    position: relative;

    width: 100%;

    aspect-ratio: 1648 / 928;

    overflow: hidden;

    background-image: url("../images/gps_zone_carte.png");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;

    isolation: isolate;
}

/* CARTE LEAFLET */

#map {
    position: absolute;

    left: 4.2%;
    top: 19.4%;

    width: 91.5%;
    height: 73%;

    display: block;
    visibility: visible;
    opacity: 1;

    z-index: 10;

    background: #07152b;
}

/* CONTROLES LEAFLET */

#map .leaflet-control-container {
    z-index: 20;
}

#map .leaflet-control {
    z-index: 5;
}

/* CADRE HTML CONSERVE */

.gps-map-frame {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: fill;

    pointer-events: none;

    z-index: 3;
}


/* =========================================================
   7. INFORMATIONS GPS
   ========================================================= */

.gps-info-section {
    width: 100%;
    min-width: 0;

    transform: translateY(22px);
}

.gps-info-container {
    position: relative;

    width: 100%;

    aspect-ratio: 470 / 530;
}

/* IMAGE DE FOND */

.gps-info-image {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: contain;

    z-index: 1;

    pointer-events: none;
}

/* ETAT GPS */

.gps-status-position {
    position: absolute;

    left: 37%;
    top: 12%;

    width: 58%;
    height: 17%;

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 2;
}

#gps-status-image {
    width: 100%;
    height: 100%;

    object-fit: contain;
}

/* LATITUDE, LONGITUDE ET SATELLITES */

.gps-latitude-position,
.gps-longitude-position,
.gps-satellites-position {
    position: absolute;

    left: 37%;

    width: 58%;

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 2;
}

/* LATITUDE */

.gps-latitude-position {
    top: 35%;
    height: 13%;
}

#latitude-value {
    color: #00eaff;

    font-size: 15px;
    font-weight: bold;

    text-align: center;
    white-space: nowrap;
}

/* LONGITUDE */

.gps-longitude-position {
    top: 57%;
    height: 13%;
}

#longitude-value {
    color: #00eaff;

    font-size: 15px;
    font-weight: bold;

    text-align: center;
    white-space: nowrap;
}

/* SATELLITES */

.gps-satellites-position {
    top: 80%;
    height: 12%;
}

#satellites-value {
    color: #00ff88;

    font-size: 16px;
    font-weight: bold;

    text-align: center;
}


/* =========================================================
   8. BOUTONS D'ACTION GPS
   ========================================================= */

.gps-actions {
    grid-column: 1 / -1;

    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 16px;

    width: 100%;

    margin-top: 0;

    align-items: center;
}

.gps-action-button {
    width: 100%;

    padding: 0;

    border: none;
    background: transparent;
    box-shadow: none;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: transform 0.2s ease;
}

.gps-action-button img {
    display: block;

    width: 100%;
    height: auto;

    object-fit: contain;
}

.gps-action-button:hover {
    transform: scale(1.03);
}


/* =========================================================
   9. POPUP GPS
   ========================================================= */

.gps-popup {
    position: fixed;

    inset: 0;

    width: 100%;
    height: 100%;

    background: rgba(0, 0, 0, 0.80);

    display: none;
    justify-content: center;
    align-items: center;

    z-index: 9999;
}

.gps-popup.show {
    display: flex;
}

.gps-popup-content {
    width: 500px;

    max-width: calc(100% - 30px);
    max-height: 85vh;

    overflow-y: auto;

    background: #0d0d0d;

    border: 2px solid #00d9ff;
    border-radius: 12px;

    color: white;

    box-shadow: 0 0 20px #00d9ff;

    animation: gps-pop 0.2s ease;
}

@keyframes gps-pop {
    from {
        transform: scale(0.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* EN-TETE POPUP */

.gps-popup-header {
    display: flex;

    justify-content: space-between;
    align-items: center;

    padding: 12px 16px;

    background: #00151a;
    color: #00eaff;

    border-bottom: 1px solid #00d9ff;
}

.gps-popup-header h2 {
    font-size: 16px;
    letter-spacing: 1px;
}

/* BOUTON FERMER */

.gps-popup-close {
    cursor: pointer;

    color: #aaa;
    font-size: 18px;

    background: transparent;
    border: none;

    padding: 3px 6px;
}

.gps-popup-close:hover {
    color: white;
}

/* CONTENU POPUP */

#gps-popup-body {
    padding: 16px;

    font-size: 14px;
    line-height: 1.8;
}

#gps-popup-body table {
    color: white;

    width: 100%;
    border-collapse: collapse;
}

#gps-popup-body th,
#gps-popup-body td {
    padding: 7px 5px;

    border-bottom: 1px solid #16404a;

    text-align: center;
}


/* =========================================================
   10. RESPONSIVE
   On ne réorganise pas les éléments.
   La scène entière est réduite par gps.js.
   ========================================================= */

@media screen and (max-width: 600px) {

    .gps-popup-content {
        max-width: calc(100vw - 24px);
    }

}
