/* --------- Styles généraux --------- */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333333;
    text-align: center;
    display: flex;
    flex-direction: column;
}

/* Wrapper pour footer sticky */
.page-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Container central */
.container {
    max-width: 800px;           /* largeur standard */
    width: 90%;                  /* pour s’adapter aux petits écrans */
    margin: 40px auto;           /* espace autour */
    padding: 30px;               /* espace interne */
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

/* Titres */
h1, h2 {
    text-align: center;
    color: #333333;
}

/* --------- Formulaire --------- */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

form input[type="text"], 
form input[type="email"], 
form select {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    display: block;
    height: 45px;
    padding: 0 15px;
    font-size: 1em;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid #ccc;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

form input[type="text"]:focus, 
form input[type="email"]:focus, 
form select:focus {
    border-color: #004080;
    box-shadow: 0 0 6px rgba(0, 64, 128, 0.3);
    outline: none;
}

form input[type="text"]:hover, 
form input[type="email"]:hover, 
form select:hover {
    border-color: #888;
}

form textarea {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    display: block;
    height: 200px;
    padding: 10px 15px;
    font-size: 1em;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid #ccc;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    resize: vertical;
}

form textarea:focus {
    border-color: #004080;
    box-shadow: 0 0 6px rgba(0, 64, 128, 0.3);
    outline: none;
}

form textarea:hover {
    border-color: #888;
}

form input[type="file"] {
    max-width: 300px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    height: 45px;
    font-size: 1em;
    box-sizing: border-box;
    border: none;
    background: none;
    padding: 0;
}

form input[type="file"]::-webkit-file-upload-button {
    height: 100%;
    padding: 0 15px;
    background-color: #004080;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

form input[type="file"]::-webkit-file-upload-button:hover {
    background-color: #00264d;
}

/* Checkbox styling */
form input[type="checkbox"] {
    width: auto;
    margin: 0 10px 0 0;
    accent-color: #004080;
}

form label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
    cursor: pointer;
    margin: 10px 0;
}

form button {
    max-width: 300px;
    width: 100%;
    margin: 0 auto;
    display: block;
    height: 45px;
    padding: 0 15px;
    font-size: 1em;
    box-sizing: border-box;
    background-color: #004080;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

form button:hover {
    background-color: #00264d;
    box-shadow: 0 4px 8px rgba(0, 64, 128, 0.2);
}

/* --------- Table styles --------- */
table {
    width: 100%;
    max-width: 800px;
    border-collapse: collapse;
    margin: 20px auto;
    font-size: 0.9em;
    background-color: #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

table th, table td {
    border: 1px solid #dddddd;
    text-align: center;
    padding: 10px;
    word-wrap: break-word;
}

table th {
    background-color: #004080;
    color: white;
    text-transform: uppercase;
}

table.waypoints-table th:nth-child(1),
table.waypoints-table td:nth-child(1) {
    width: 40%;
}

table.waypoints-table th:nth-child(2),
table.waypoints-table td:nth-child(2),
table.waypoints-table th:nth-child(3),
table.waypoints-table td:nth-child(3) {
    width: 30%;
}

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tr:hover {
    background-color: #e6f0ff;
}

/* --------- Footer --------- */
footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9em;
    background-color: #f8f9fa;
    padding: 4px 0;
    border-top: 1px solid #ddd;
    line-height: 1.8;
}

footer .contact-link {
    display: inline-block;
    margin-top: 10px;
    color: #004080;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

footer .contact-link:hover {
    color: #00264d;
}

/* --------- Responsive --------- */
@media screen and (max-width: 600px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }
    thead tr {
        display: none;
    }
    td {
        position: relative;
        padding-left: 50%;
        text-align: left;
    }
    td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        font-weight: bold;
        text-transform: uppercase;
    }
}

/* --------- Leaflet map --------- */
#map {
    height: 500px;
    width: 100%;
    max-width: 100%;
    margin: 30px auto;
    border-radius: 8px;
    box-sizing: border-box;
    overflow: hidden;
}

.leaflet-marker-icon {
    background-color: #004080;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    border: none;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* --------- Switch button --------- */
.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
    margin-left: 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #004080;
}

input:checked + .slider:before {
    transform: translateX(14px);
}

/* --------- Aide --------- */
.help-content {
    border: none;
    text-align: left;
}

.help-content h1, .help-content h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.help-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.help-content li {
    margin-bottom: 0.8rem;
}

.help-content img {
    margin: 1rem auto;
    border: 1px solid #ccc;
    border-radius: 5px;
    display: block;
    max-width: 100%;
    height: auto;
}

.help-content p {
    margin: 1rem 0;
}

.help-content a.button {
    display: inline-block;
    margin-top: 2rem;
    background-color: #004080;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s;
    text-align: center;
}

.help-content a.button:hover {
    background-color: #00264d;
}

/* --------- Bouton Help --------- */
.help-button {
    background-color: #e0e7ff;
    color: #004080;
    padding: 8px 16px;
    border: 2px solid #004080;
    border-radius: 5px;
    display: inline-block;
    margin-top: 20px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
    font-size: 0.95em;
}

.help-button:hover {
    background-color: #c0cfff;
    color: #00264d;
}

.help-button i {
    margin-right: 6px;
}

.flash-messages {
    max-width: 600px;
    margin: 20px auto;
    padding: 0;
    list-style: none;
}

/* Message de succès */
.flash.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-size: 0.95em;
    text-align: center;
}

/* Message d'avertissement */
.flash.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-size: 0.95em;
    text-align: center;
}

/* Message d'erreur */
.flash.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-size: 0.95em;
    text-align: center;
}

/* Animation pour les messages */
.flash {
    animation: fadeIn 0.5s ease, fadeOut 0.5s ease 4.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}
/* Styles pour les boutons primaire et secondaire */
form button.primary {
    background-color: #004080;
    color: white;
    border: 2px solid #004080;
}

form button.primary:hover {
    background-color: #00264d;
    border-color: #00264d;
}

form button.secondary {
    background-color: #e0e7ff;
    color: #004080;
    border: 2px solid #004080;
}

form button.secondary:hover {
    background-color: #c0cfff;
    color: #00264d;
    border-color: #00264d;
}
/* --------- Split Button --------- */
.split-button-container {
    display: flex;
    justify-content: center; /* Center the button group */
    margin-top: 20px;
}

.split-button-group { /* Add a wrapper for the actual button parts */
    display: inline-flex;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px; /* Keep this for the shadow, but children will define the shape */
    width: 100%;
    max-width: 300px; /* Match other form buttons */
    /* overflow: hidden; <-- This was hiding the dropdown menu */
}

/* Reset general button styles ONLY for main and arrow buttons */
.split-button-main,
.split-button-arrow {
    margin: 0 !important;
    width: auto;
    max-width: none;
    border-radius: 0;
    box-shadow: none;
}
.split-button-main:hover,
.split-button-arrow:hover {
    box-shadow: none;
}

.split-button-main {
    flex-grow: 1; /* Allow the main button to take up available space */
    text-align: center;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.split-button-dropdown {
    position: relative;
    display: flex;
}

.split-button-arrow {
    background-color: #004080;
    color: white;
    border: none;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    padding: 0 12px;
    cursor: pointer;
    transition: background-color 0.3s;
    border-left: 1px solid #0059b3;
    height: 45px;
    font-size: 0.8em;
}

.split-button-arrow:hover {
    background-color: #00264d;
}

.split-button-menu {
    display: none;
    position: absolute;
    top: calc(100% + 5px); /* Position below the button with a small gap */
    right: 0;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 5px;
    min-width: 150px;
}

.split-button-menu.open {
    display: block;
}

.split-button-menu button {
    display: block;
    width: 100%;
    text-align: left;
    background: none !important; /* Ensure no background from other rules */
    border: none !important;
    padding: 10px 15px;
    color: #333 !important;
    cursor: pointer;
    border-radius: 5px;
    font-weight: normal;
}

.split-button-menu button:hover {
    background-color: #f0f0f0 !important;
}