/* -------------------- RESET DE BASE -------------------- */

body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    overflow-x: hidden;
    color: #112142;
    text-align: center;
}

/* -------------------- HEADER + NAV -------------------- */

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background: url('ressources/boat_id.webp') no-repeat center center/cover;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 20px 0;
    position: absolute;
    top: 0;
    z-index: 3;
}

.header .logo-container .logo {
    color: white !important;
}

.header .logo-container {
    display: flex;
    align-items: center;
    margin-left: 25px;
    color: white;
}

.header .logo-container img {
    height: 50px;
    margin-right: 10px;
}

.header .logo {
    font-size: 17px;
    font-weight: bold;
}

.nav {
    display: flex;
    gap: 80px !important;
    margin-right: 25px !important;
}

.nav a {
    text-decoration: none;
    color: white;
    font-weight: bold;
    font-size: 15px !important;
}

.nav a.active {
    color: #ff7700 !important;
}

.nav a:hover {
    color: #ff7700;
}

.hamburger {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
    z-index: 5;
    margin-right: 25px;
}

/* -------------------- CONTENU + FOOTER -------------------- */

.content {
    flex-grow: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    text-align: left;
    position: relative;
    z-index: 2;
    width: 90%;
}

.content h1 {
    font-size: 65px;
    font-weight: bold;
    line-height: 1.2;
}

.footer {
    background-color: #112142;
    width: 100%;
    padding: 40px 0;
    color: white;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 90%;
    margin: 0 auto;
    text-align: left;
}

.footer .footer-block {
    text-decoration: none;
}

.footer-block.large {
    flex: 2;
    min-width: 250px;
}

.footer-block.small {
    flex: 1;
    min-width: 180px;
}

.footer-title {
    font-weight: 500;
    font-size: 18px;
    margin-bottom: 30px;
}

.footer-content a {
    color: #AAAAAA;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
}

.footer-content a:hover {
    color: #AAAAAA;
}

.footer-block p {
    margin-bottom: 35px;
    color: #AAAAAA;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
}

.footer-input {
    width: 120%;
    padding: 8px;
    border-radius: 6px;
    border: none;
    background: #1E3763;
    color: white;
    font-style: italic;
}

.footer .top {
    text-align: center;
    opacity: 0.3;
    font-size: 35px;
    font-weight: bold;
    letter-spacing: 3px;
}

.footer .subtitle {
    font-size: 17px;
    margin-top: 15px;
    letter-spacing: 6px;
    font-weight: 500;
    opacity: 1;
}

.footer .separator {
    width: 90%;
    height: 1px;
    background: white;
    margin: 40px auto;
}

.footer .bottom-text {
    font-size: 12px;
    color: #909090;
}

.footer .bottom-bar {
    display: flex;
    justify-content: space-between;
    width: 90%;
    margin: 10px auto;
    font-size: 12px;
    color: #909090;
}

.footer-block i {
    color: white;
    font-size: 15px;
    margin-right: 10px;
}

.footer .bottom-bar a {
    text-decoration: none;
    color: #909090;
}

/* -------------------- LEAFLET -------------------- */

.leaflet-control-attribution {
    background-color: rgba(35, 3, 95, 0) !important;
    color: #ffffff !important;
    font-size: 8px !important;
    padding: 5px 10px;
}

.leaflet-control-attribution a {
    color: #ffffff !important;
    text-decoration: none;
}

.leaflet-control-attribution a:hover {
    text-decoration: underline;
}

/* -------------------- LAYOUT PRINCIPAL -------------------- */

.page-wrapper {
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    background-color: #112142;
}

header {
    background-color: #112142;
    min-height: 70px;
}

.main-container {
    position: relative;
    height: calc(100vh - 7vh);
    overflow: hidden;
    margin: 20px;
}

#map {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 20px;
}

/* -------------------- PANEL TOP LEFT (vitre + 2 blocs) -------------------- */

.panel-top-left {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 20;
    pointer-events: none;          /* pour que la souris passe sur la map autour */
}

.glass-panel {
    background: rgba(217, 217, 217, 0.01);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 26px;
    padding: 18px 20px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: max-content;            /* largeur auto selon le contenu */
    pointer-events: auto;          /* mais clics autorisés dans la vitre */
}



/* Blocs bleus internes */
.panel-block {
    background: rgba(30, 55, 99, 0.80); /* #1E3763 à 80% */
    border-radius: 18px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

/* Header "Position" + select DMD/DMS/DD */
.panel-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.panel-block-title {
    font-size: 12px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.3px;
    text-align: left;
}

.format-select {
    font-size: 11px;
    font-weight: 700;              /* DMD / DMS / DD en bold */
    color: #FFFFFF;
    background: #132142;
    border-radius: 8px;
    border: none;
    padding: 10px 12px;
    outline: none;
    cursor: pointer;
    appearance: none;
}

/* Rangées de saisie de position */
.pos-row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    width: max-content;
}

.pos-row input,
.pos-row select {
    font-size: 11px;
    font-weight: 400;
    color: #FFFFFF;
    background: #132142;
    border-radius: 8px;
    border: none;
    padding: 10px 8px;
    text-align: center;
    min-width: 68px;
    box-sizing: border-box;
}

.pos-row select {
    min-width: 50px;
}

/* Bouton Go */
.go-btn {
    margin-top: 8px;
    align-self: flex-start;
    background: #0373FF;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    padding: 10px 26px;
    cursor: pointer;
}

.go-btn:hover {
    background: #005ed1;
}

/* -------------------- BLOC SEARCH DANS LA VITRE -------------------- */

.panel-block-search .panel-block-title {
    margin-bottom: 6px;
}

.ui-search-input,
.search-input {
    width: 100%;
    height: 38px;
    border-radius: 8px;
    border: none;
    background: #132142;
    color: #FFFFFF;
    font-size: 11px;
    padding: 10px 10px;
    box-sizing: border-box;
}

.ui-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

/* Liste des résultats */
.result-list {
    position: absolute;
    margin-top: 90px;
    padding: 0;
    list-style: none;
    background: #FFFFFF;
    color: #011355;
    border-radius: 10px;
    max-height: 180px;
    overflow-y: auto;
    width: calc(100% - 32px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 999;
    left: 16px;
}

.result-list li {
    padding: 8px 10px;
    cursor: pointer;
    font-size: 11px;
}

.result-list li:hover {
    background: #FF751A;
    color: #FFFFFF;
}

.result-list::-webkit-scrollbar {
    width: 7px;
}

.result-list::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background-color: rgba(0, 0, 0, .5);
}

.result-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, .5) transparent;
}

/* -------------------- LÉGENDE BAS GAUCHE -------------------- */

.panel-legend {
    position: absolute;
    bottom: 105px;
    left: 15px;
    background: rgba(30, 55, 99, 0.80);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 12px 14px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: max-content;
    z-index: 15;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 500;
    color: #FFFFFF;
}

/* Pastilles légende + pins map */
.pin {
    width: 16px;
    height: 16px;
    margin-right: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.8);
    display: inline-block;
}

.MRCC { background-color: #00E6FF; }
.MRSC { background-color: #0088b9; }
.JRCC { background-color: #FF0000; }
.JRSC { background-color: #E8A49C; }
.ARCC { background-color: #0cef0c; }
.ARSC { background-color: #efef15; }

/* -------------------- PANEL COORDONNÉES CURSEUR -------------------- */

.panel-coordinates {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(30, 55, 99, 0.80);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 10px 14px;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    color: #FFFFFF;
    font-size: 11px;
    z-index: 15;
    width: max-content;
    max-width: 340px;
    text-align: left;
}

.panel-coordinates #cursorInfo {
    margin: 0;
    line-height: 1.6;
}

/* -------------------- PANEL SPONSOR (bas droite) -------------------- */

.panel {
    font-family: 'Montserrat', sans-serif;
}

.panel-sponsor {
    position: absolute;
    bottom: 15px;
    right: 15px;
    padding: 12px 16px;
    border-radius: 18px;
    background: rgba(217, 217, 217, 0.01);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 26px;
    padding: 18px 20px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    z-index: 15;
}

.sponsor-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
}

.sponsor-label a {
    color: #ffffff;
    text-decoration: none;
}

.sponsor-label a:hover {
    text-decoration: underline;
}

.sponsor-logos {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sponsor-logos img {
    height: 40px;
}

/* -------------------- BOUTON POSITION GPS (si utilisé) -------------------- */

#position-gps {
    display: none;
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    padding: 10px;
    border-radius: 50%;
}

#position-gps img {
    width: 40px;
    height: 40px;
}

/* -------------------- POPUP DIVERS -------------------- */

.choose-text {
    color: white;
    font-size: 15px;
}

.my-popup-center-align {
    text-align: center;
}

.encart-close {
    position: absolute;
    top: 10px;
    right: 12px;
    cursor: pointer;
    font-size: 16px;
    color: white;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.encart-close:hover {
    transform: scale(1.2);
}

.encart-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 119, 0, 0.8);
    color: white;
    border-radius: 15px;
    padding: 20px 25px 20px 20px;
    max-width: 300px;
    z-index: 9999;
    box-shadow: 0 0 10px rgba(0,0,0,0.4);
    animation: slide-up 0.8s ease;
    overflow: hidden;
}

@keyframes slide-up {
    from { transform: translateY(50px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

@keyframes slide-down {
    from { transform: translateY(0); opacity: 1; }
    to   { transform: translateY(50px); opacity: 0; }
}

/* -------------------- RESPONSIVE -------------------- */

@media (max-width: 1024px) {
    .hamburger {
        display: block;
    }

    .nav {
        position: absolute;
        top: 70px;
        right: 0;
        background-color: rgba(17, 33, 66, 0.98);
        flex-direction: column;
        align-items: flex-end;
        padding: 20px;
        gap: 40px;
        display: none;
        width: auto;
        border-radius: 10px;
    }

    .nav.show {
        display: flex;
    }

    .header .logo {
        font-size: 13px;
        font-weight: bold;
    }

    .header .logo-container img {
        height: 35px;
        margin-right: 10px;
    }

    .content h1 {
        font-size: 55px;
        font-weight: bold;
        line-height: 1.2;
    }

    .footer .top {
        font-size: 25px;
    }

    .footer .subtitle {
        font-size: 10px;
    }

    .footer-content {
        display: flex;
        flex-direction: column;
        justify-content: center !important;
        gap: 30px;
        flex-wrap: wrap;
        width: 90%;
        margin: 0 auto;
        text-align: left;
    }
}

@media (max-width: 900px) {
    .panel-top-left {
        left: 15px;
        top: 15px;
    }

    .panel-legend {
        bottom: 105px;
        left: 15px;
    }

    .panel-coordinates {
        left: 16px;
        max-width: calc(100% - 32px);
    }

    .panel-sponsor {
        right: 15px;
        bottom: 15px;
    }
}

@media (max-width: 768px) {
    /* On masque le bloc Position + Search sur mobile */
    #panelPosition {
        display: none !important;
    }

    .panel-coordinates {
        display: none !important;
    }

    .panel-legend {
        display: none !important;
    }

    html, body {
        overflow: auto;
        height: 100vh;
    }
}

@media (max-width: 600px) {
    .panel-legend {
        left: 12px;
        bottom: 140px;
    }

    .panel-coordinates {
        left: 12px;
        bottom: 24px;
        max-width: calc(100% - 24px);
    }
}