/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ========== CONTENEUR SCHÉMA ========== */
.schema-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.schema-image {
    display: block;
    width: 100%;
    height: auto;
}

/* ========== ZONES CLIQUABLES ========== */
.zone {
    position: absolute;
    cursor: pointer;
    background: transparent;
    border: none;
    transition: all 0.3s ease;
    z-index: 10;
}

/* Au survol : highlight subtil */
.zone:hover {
    background: rgba(255, 255, 0, 0.15);
    border: 2px solid rgba(255, 193, 7, 0.6);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
    transform: scale(1.05);
}

/* Zones circulaires */
.zone-circle {
    border-radius: 50%;
}

.zone-circle:hover {
    border-radius: 50%;
}

/* Au clic : effet de pression */
.zone:active {
    transform: scale(0.98);
}

/* ========== LISTE MOBILE ========== */
.mobile-list {
    display: none; /* Caché par défaut (desktop) */
    width: 100%;
    max-width: 600px;
    margin-top: 20px;
}

.mobile-hint {
    text-align: center;
    color: white;
    font-size: 14px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.category-section {
    margin-bottom: 15px;
}

.category-title {
    color: white;
    font-size: 16px;
    font-weight: 600;
    padding: 10px 15px;
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
}

.category-animation { background: #e91e63; }
.category-commercial { background: #ff9800; }
.category-leads { background: #2196f3; }
.category-commandes { background: #2196f3; }
.category-softskills { background: #9c27b0; }
.category-management { background: #4caf50; }

.formation-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: white;
    padding: 12px;
    border-radius: 0 0 10px 10px;
}

.formation-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 14px;
    flex: 1 1 calc(50% - 4px);
    min-width: 140px;
}

.formation-card:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.formation-card:active {
    transform: scale(0.98);
}

/* Surbrillance quand on clique sur le schéma en mobile */
.formation-card.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: pulse 0.5s ease-in-out 3;
}

.formation-card.highlight .card-name {
    color: white;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.card-icon {
    font-size: 20px;
}

.card-name {
    font-weight: 500;
    color: #333;
    text-align: left;
}

/* ========== MODAL POPUP ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
    /* Centrage vertical et horizontal (appliqué quand display: flex) */
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    background: white;
    padding: 40px;
    width: 90%;
    max-width: 600px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.4s ease;
    text-align: center;
}

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

.modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 36px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #333;
    transform: rotate(90deg);
    transition: all 0.3s ease;
}

.modal-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

#modal-title {
    font-size: 36px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 700;
}

.modal-category {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-description {
    font-size: 20px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 30px;
}

.modal-cta {
    display: inline-block;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 15px 40px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.modal-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.6);
}

/* ========== RESPONSIVE MOBILE ========== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    /* Schéma plus petit mais VISIBLE */
    .schema-container {
        border-radius: 15px;
        touch-action: pan-x pan-y pinch-zoom; /* Permet le zoom au pinch */
    }

    /* Zones cliquables sur mobile - gardées visibles pour navigation */
    .zone {
        display: block;
    }

    /* Afficher la liste mobile */
    .mobile-list {
        display: block;
    }

    /* Modal adapté mobile */
    .modal-content {
        padding: 30px 20px;
        width: 95%;
    }
    
    #modal-title {
        font-size: 24px;
    }
    
    .modal-description {
        font-size: 16px;
    }
    
    .modal-icon {
        font-size: 48px;
    }

    .modal-cta {
        padding: 12px 30px;
        font-size: 14px;
    }

    /* Cards en colonne sur très petit écran */
    .formation-card {
        flex: 1 1 100%;
    }
}

/* Tablette : garder le schéma cliquable */
@media (min-width: 769px) and (max-width: 1024px) {
    .schema-container {
        max-width: 100%;
    }
}
