/* style globale / mode clair */

body {
    font-family: "Segoe UI", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    color: #000000;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* titre */
h2 {
    margin-top: 20px;
    text-align: center;
}

/* conteneur de boutons */
.button-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

/* boutons */
button {
    margin: 5px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border-radius: 8px;
    border: 1px solid #999;
    background-color: #f5f5f5;
    font-weight: 500;
}

button:hover {
    transform: scale(1.05);
    background-color: #e3e3e3;
}

button:active {
    transform: scale(0.97);
}

/* tableau */
table {
    border-collapse: collapse;
    margin: 0 auto;
    width: 95%;
    max-width: 900px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    overflow: hidden;
}

th, td {
    border: 1px solid #333;
    padding: 10px;
    text-align: center;
}

th {
    background-color: #cfe3ff; 
    font-weight: 600;
}

tbody tr:nth-child(odd) {
    background-color: #f9f9f9;
}

tfoot td {
    font-weight: bold;
    background-color: #ddd;
}

/* surbrillance */
.highlight {
    background-color: #8bc34a !important;
    color: #ffffff;
}

.best-total {
    background-color: #ffa500 !important;
    color: #ffffff;
    font-weight: bold;
}

/* fenêtre */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background-color: rgba(0,0,0,0.45);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #fff;
    color: #000;
    padding: 18px;
    border-radius: 10px;
    width: 92%;
    max-width: 420px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    text-align: center;
}

.modal-content input {
    width: 84%;
    padding: 10px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid #bbb;
    margin-bottom: 12px;
}

.popup-buttons {
    display:flex;
    justify-content:space-around;
}

.popup-buttons button {
    padding: 8px 14px;
    border-radius: 8px;
}

/* mode sombre */
body.dark-mode {
    background-color: #121212;
    color: #f0f0f0;
}

body.dark-mode table {
    border-color: #888;
    box-shadow: 0 0 10px rgba(255,255,255,0.1);
}

body.dark-mode th {
    background-color: #0a3965;
    color: #ffffff;
}

body.dark-mode td {
    background-color: #1e1e1e;
    color: #ffffff;
}

body.dark-mode tfoot td {
    background-color: #2c2c2c;
    color: #ffffff;
}

body.dark-mode button {
    background-color: #333;
    color: #f0f0f0;
    border: 1px solid #555;
}

body.dark-mode button:hover {
    background-color: #444;
}

body.dark-mode button:active {
    background-color: #222;
}

body.dark-mode .highlight {
    background-color: #1abc9c !important;
    color: #ffffff;
}

body.dark-mode .best-total {
    background-color: #e67e22 !important;
    color: #ffffff;
    font-weight: bold;
}

/* smartphones écran ≤480px */
@media only screen and (max-width: 480px) {
    body {
        padding: 10px;
    }

    h2 {
        font-size: 1.4rem;
    }

    table {
        width: 95%;
        font-size: 14px;
        margin: 0 auto;
    }

    th, td {
        padding: 8px;
    }

    .button-container button {
        flex: 1 1 45%;
        max-width: 160px;
        font-size: 14px;
        padding: 10px;
    }
}

/* tablettes écran entre 481px - 834px */
@media only screen and (min-width: 481px) and (max-width: 834px) {
    table {
        width: 85%;
        font-size: 15px;
        margin: 0 auto;
    }

    th, td {
        padding: 10px;
    }

    .button-container button {
        flex: 1 1 30%;
        max-width: 200px;
        font-size: 15px;
    }
}

/* pied de page */
footer {
    margin-top: 40px;
    font-size: 0.9rem;
    color: #555;
    text-align: center;
    opacity: 0.8;
}

body.dark-mode footer {
    color: #aaa;
}

/* notification */
.toast {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 12px 22px;
    border-radius: 8px;
    font-size: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    z-index: 2000;
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-6px);
}

/* couleurs selon le type */
.toast.success {
    background-color: #2ecc71; 
}
.toast.info {
    background-color: #3498db; 
}
.toast.error {
    background-color: #e74c3c;
}
