/* ===================================
   STYLES GÉNÉRAUX
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Fond avec dégradé rouge et blanc suisse */
body {
    font-family: Arial, sans-serif;
    padding: 20px;
    background: linear-gradient(135deg, #FF0000 0%, #FF6666 50%, #FFFFFF 100%);
    min-height: 100vh;
}

/* Titre principal */
h1 {
    text-align: center;
    margin-bottom: 15px;
    color: white;
}

/* Boîte d'instructions */
.instructions {
    text-align: center;
    background: white;
    padding: 15px;
    margin-bottom: 30px;
    border-radius: 4px;
    color: #333;
    font-size: 0.95em;
    line-height: 1.5;
    border: 2px solid white;
}

.content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Section de gauche: cantons à classer */
.items {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.items h2 {
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #333;
}

/* Grille des cantons à classer : 4 colonnes (12 cantons = 3 lignes) */
.items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.items-grid .item {
    width: 100%;
    display: block;
    margin: 0;
}

.item {
    background: white;
    color: #FF0000;
    padding: 10px 12px;
    margin: 5px 3px;
    border-radius: 4px;
    cursor: grab;
    user-select: none;
    display: inline-block;
    width: calc(25% - 6px);
    text-align: center;
    transition: background-color 0.3s ease;
    border: 2px solid #FF0000;
    font-weight: bold;
}

/* Effet au survol d'un canton */
.item:hover {
    background: #F0F0F0;
}

.item.placed {
    background: #27ae60;
    cursor: default;
    display: block;
    margin: 5px 0;
}

/* Canton avec bonne réponse */
.item.correct {
    background: #27ae60;
    color: #00ff00;
}

/* Canton avec mauvaise réponse */
.item.incorrect {
    background: #e74c3c;
}

.item.error {
    animation: shake 0.3s ease;
}

/* ===================================
   ZONES DE DÉPÔT (drop-areas)
   =================================== */

/* Section de droite: zones de réception */
.zones {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
}

/* Conteneur pour une période historique */
.zone {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex: 0 0 calc(33.33% - 14px);
}

.zone h3 {
    margin-bottom: 10px;
    font-size: 1em;
    color: #333;
}

/* Zone de réception des cantons (glissez-déposez) */
.drop-area {
    background: #FFE6E6;
    border: 2px dashed #FF0000;
    min-height: 120px;
    border-radius: 4px;
    padding: 5px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 5px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    justify-content: flex-start;
    align-content: flex-start;
}

/* Effet au survol d'une zone de dépôt */
.drop-area:hover {
    background: #FFD0D0;
    border-color: #FF0000;
}

.drop-area .item {
    width: calc(33.33% - 4px);
    display: inline-block;
    margin: 0;
    padding: 8px 6px;
    font-size: 0.9em;
}

/* Petite icône “Indice” sous chaque zone */
.hint-row {
    margin-top: 10px;
    text-align: left;
}

/* Bouton “Indice” */
.hint-btn {
    padding: 6px 10px;
    font-size: 0.85em;
    font-weight: bold;
    background: #ffffff;
    color: #FF0000;
    border: 2px solid #FF0000;
    border-radius: 6px;
    cursor: pointer;
}

.hint-btn:hover {
    background: #F0F0F0;
}

.hint-btn.active {
    background: #FF0000;
    color: #ffffff;
}

/* Bulle d'indice (popover) */
.hint-popover {
    max-width: 320px;
    background: #ffffff;
    border: 2px solid #FF0000;
    color: #333;
    padding: 10px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    font-size: 0.9em;
    z-index: 1000;
}

/* État de la zone pendant un drag */
.drop-area.dragging {
    background: #e8f8f5;
    border-color: #16a085;
    min-height: 120px;
}

/* Classe appliquée quand on survole une zone droppable */
.drop-area.hover {
    background: #d5f4e6;
    border-color: #27ae60;
}

/* État d'erreur d'une zone */
.drop-area.error {
    background: #fadbd8;
    border-color: #e74c3c;
    animation: shake 0.3s ease;
}.drop-area.dragging {
    background: #e8f8f5;
    border-color: #16a085;
    min-height: 120px;
}

.drop-area.error {
    background: #fadbd8;
    border-color: #e74c3c;
    animation: shake 0.3s ease;
}

/* Animation de tremblement */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ===================================
   BOUTONS ET MESSAGES
   =================================== */

/* Conteneur pour les boutons */
.buttons {
    text-align: center;
    margin-top: 30px;
}

/* Boutons de contrôle */
button {
    padding: 8px 16px;
    font-size: 0.9em;
    background: #FF0000;
    color: white;
    border: 2px solid white;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

/* Effet au survol des boutons */
button:hover {
    background: #CC0000;
}

/* Zone pour afficher le score */
#score {
    text-align: center;
    margin-top: 12px;
    font-weight: bold;
    color: #27ae60;
}

/* Message affiché quand toutes les réponses sont correctes */
.success-message {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background: #d5f4e6;
    border: 2px solid #27ae60;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    color: #27ae60;
    animation: slideIn 0.4s ease;
}

.success-message p {
    margin: 0;
}

/* Message affiché si tous les cantons ne sont pas placés */
.warning-message {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: #fadbd8;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    color: #e74c3c;
}

.warning-message p {
    margin: 0;
}

/* Animation d'apparition du message de succès */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   LIEN WIKIPEDIA (PIED DE PAGE)
   =================================== */

/* Boîte contenant le lien Wikipedia */
.footer-link {
    text-align: center;
    margin-top: 40px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    font-size: 0.95em;
    color: #333;
}

/* Lien Wikipedia */
.footer-link a {
    color: #FF0000;
    text-decoration: none;
    font-weight: bold;
}

/* Effet au survol du lien */
.footer-link a:hover {
    text-decoration: underline;
    color: #CC0000;
}

