.dialog-options-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 colonnes égales */
    grid-auto-rows: auto;                  /* hauteur automatique */
    gap: 0.75rem;                          /* espacement horizontal et vertical */
    justify-items: center;                 /* centre chaque élément dans sa case */
    margin-top: 10px;
    padding: 0.5rem 0;
}
/* Style de base pour tous les boutons de dialogue */
.dialog-button { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    text-align: center; 
    padding: 0.85rem 0.75rem; /* Padding ajusté */
    border-radius: 10px; /* Plus arrondi */
    margin: 0;
    background: #fdfdff; /* Fond plus clair */
    color: #333;
    border: 1px solid #e0e6ed; /* Bordure plus douce */
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    box-sizing: border-box;
    flex-basis: calc(50% - 0.375rem); /* Base pour 2 par ligne */
    flex-grow: 1; /* Permet de grandir un peu si l'espace le permet */
    min-height: 130px; /* Hauteur minimale légèrement réduite */
}

/* Spécifique pour les cartes d'usage (avec image) */
.dialog-button.usage-card {
    /* Passer le bouton lui-même en mode flex pour aligner image et texte horizontalement */
    flex-direction: row; /* Aligne les enfants (img, text-content) sur une ligne */
    align-items: center; /* Centre verticalement l'image et le bloc de texte */
    justify-content: flex-start; /* Aligne le contenu (image+texte) à gauche du bouton */
    text-align: left; /* Aligner le texte à gauche */
    padding: 0.75rem; /* Ajuster le padding si nécessaire */
    min-height: 100px; /* Réduire un peu la hauteur min si on gagne en largeur */
    max-width: 100%; /* Permettre aux cartes de prendre la largeur de la cellule de la grille */
}

/* Style pour les boutons d'options (environnement, distance) - plus larges */
.dialog-button.option-choice {
    flex-basis: calc(50% - 0.375rem); /* Peut aussi être 2 par ligne */
    /* Ou pour pleine largeur si moins d'options : flex-basis: 100%; */
    max-width: none; /* Permet de s'étendre plus */
    min-height: auto; /* Hauteur s'adapte au contenu */
    padding: 0.8rem 1rem; /* Padding différent pour un look plus bouton */
    justify-content: center; /* Centre le contenu verticalement si moins de texte */
}
/* Cas où il y a 3 boutons d'options -> on les veut sur une seule ligne si possible, ou 2+1 */
.dialog-options-container.count-3 .dialog-button.option-choice {
     flex-basis: calc(33.333% - 0.5rem); /* 3 par ligne (0.75rem * 2 gaps / 3) */
     flex-grow: 1;
}
 /* Cas où il y a 2 boutons d'options -> 2 par ligne */
.dialog-options-container.count-2 .dialog-button.option-choice {
     flex-basis: calc(50% - 0.375rem);
     flex-grow: 1;
}


.dialog-button:hover:not(:disabled) {
  background: #f0f4f8; /* Fond au survol plus subtil */
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08); /* Ombre plus douce */
}
.dialog-button:disabled { background: #e9ecef; color: #6c757d; opacity:0.8; cursor:default; border-color: #ced4da;}

.dialog-button img { 
  width: auto; 
  max-width: 100px;
  max-height: 100px;
object-fit: contain;
  margin-bottom: 0.6rem; 
border-radius: 4px;
}

.dialog-button.usage-card img {
  max-width: 100px; /* Image encore un peu plus petite */
  max-height: 100px;
  margin-bottom: 0; /* Plus de marge en bas car à côté du texte */
  margin-right: 0.75rem; /* Marge à droite de l'image pour espacer du texte */
  flex-shrink: 0; /* Empêcher l'image de rétrécir */
}

.img-placeholder {
    display:inline-block;
    width:45px; 
    height:45px; 
    line-height:45px; 
    color:grey;
    font-size:0.65em;
    border:1px dashed #ccc;
    border-radius:4px;
    margin-bottom: 0.6rem;
    text-align: center;
}
.dialog-button .text-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* Aligner le texte en haut */
  flex-grow: 1; 
  width: 100%; 
}
.dialog-button .title {
  font-weight: 600; /* Un peu plus gras */
  font-size: 0.95rem; 
  color: #2c3e50; /* Couleur de titre plus foncée */
  margin-bottom: 0.25rem; 
}
.dialog-button .desc {
  font-size: 0.8rem; /* Description un peu plus petite */
  color: #566573; 
  line-height: 1.35;
  flex-grow: 1; 
}
/* Style pour les descriptions dans les boutons de distance */
.dialog-button.option-choice .desc {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-top: 0.2rem;
}


@media (max-width: 600px) {
  .dialog-options-container,
  .dialog-options-container.count-3, /* Assurer que sur mobile, ça s'empile bien */
  .dialog-options-container.count-2 {
    justify-content: center; 
  }
  .dialog-button,
  .dialog-button.usage-card,
  .dialog-button.option-choice,
  .dialog-options-container.count-3 .dialog-button.option-choice,
  .dialog-options-container.count-2 .dialog-button.option-choice {
    flex-basis: calc(100% - 0.75rem); /* Pleine largeur sur mobile */
    max-width: none;
    margin-bottom: 0.5rem;
  }
} 

/* Modal de sélection de mode */
.mode-selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.mode-selection-modal {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: slideUp 0.4s ease;
    transform-origin: center;
}

.mode-selection-modal h2 {
    color: #1b2445;
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.mode-selection-modal p {
    color: #666;
    margin: 0 0 2rem 0;
    font-size: 1rem;
    line-height: 1.5;
}

.mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mode-button {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border: 2px solid #e3e7ee;
    border-radius: 12px;
    background: #f8fafd;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.mode-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}

.mode-button:hover::before {
    left: 100%;
}

.mode-button:hover {
    border-color: #0066ff;
    background: #e8f2ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 102, 255, 0.15);
}

.mode-button.technical:hover {
    border-color: #ff6b35;
    background: #fff4f1;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.15);
}

.mode-button.commercial:hover {
    border-color: #28a745;
    background: #f1f9f3;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.15);
}

.mode-button.guidance:hover {
    border-color: #6f42c1;
    background: #f8f4ff;
    box-shadow: 0 8px 25px rgba(111, 66, 193, 0.15);
}

.mode-icon {
    font-size: 2.5rem;
    min-width: 60px;
    position: relative;
    z-index: 1;
}

.mode-text {
    flex: 1;
    position: relative;
    z-index: 1;
}

.mode-text h3 {
    margin: 0 0 0.5rem 0;
    color: #1b2445;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

.mode-text p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    text-align: left;
    line-height: 1.4;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .mode-selection-modal {
        padding: 1.5rem;
        margin: 1rem;
        max-width: none;
    }
    
    .mode-button {
        padding: 1.25rem;
        gap: 0.75rem;
    }
    
    .mode-icon {
        font-size: 2rem;
        min-width: 50px;
    }
    
    .mode-text h3 {
        font-size: 1rem;
    }
    
    .mode-text p {
        font-size: 0.85rem;
    }
} 

/* Bouton de basculement de mode */
.mode-switch-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 30%;
    margin-left: 20px;
    padding: 12px 16px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f0ff 100%);
    border: 2px solid #e0e8f0;
    border-radius: 12px;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mode-switch-button:hover {
    background: linear-gradient(135deg, #e8f0ff 0%, #d0e0ff 100%);
    border-color: #3498db;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.15);
}

.mode-switch-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.1);
}

.mode-switch-icon {
    font-size: 16px;
    margin-right: 8px;
}

.mode-switch-text {
    flex-grow: 1;
    text-align: left;
}

.mode-switch-arrow {
    font-size: 14px;
    color: #3498db;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.mode-switch-button:hover .mode-switch-arrow {
    transform: translateX(3px);
}

/* Modal de confirmation pour le changement de mode */
.mode-switch-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.mode-switch-confirm-modal {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    animation: slideInUp 0.3s ease;
    text-align: center;
}

.mode-switch-confirm-modal h3 {
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    margin-top: 0;
}

.mode-switch-confirm-modal p {
    color: #5a6c7d;
    line-height: 1.6;
    margin-bottom: 16px;
    font-size: 14px;
}

.mode-switch-confirm-modal p:last-of-type {
    color: #e67e22;
    font-size: 13px;
    margin-bottom: 24px;
}

.mode-switch-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.mode-switch-confirm-yes,
.mode-switch-confirm-no {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.mode-switch-confirm-yes {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.mode-switch-confirm-yes:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f618d 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.mode-switch-confirm-no {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.mode-switch-confirm-no:hover {
    background: #e9ecef;
    color: #495057;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Animations pour la modal de confirmation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   RESPONSIVE MOBILE - DIALOGUES
   ============================================ */

/* Tablettes */
@media (max-width: 1024px) {
    .dialog-options-container {
        gap: 0.6rem;
        padding: 0.4rem 0;
    }

    .dialog-button {
        padding: 0.75rem 0.65rem;
        min-height: 120px;
    }

    .dialog-button.usage-card {
        padding: 0.65rem;
        min-height: 90px;
    }

    .dialog-button img {
        max-width: 90px;
        max-height: 90px;
    }

    .dialog-button.usage-card img {
        max-width: 90px;
        max-height: 90px;
        margin-right: 0.65rem;
    }

    .dialog-button .title {
        font-size: 0.9rem;
    }

    .dialog-button .desc {
        font-size: 0.78rem;
    }
}

/* Smartphones */
@media (max-width: 768px) {
    /* Container en colonne unique */
    .dialog-options-container,
    .dialog-options-container.count-3,
    .dialog-options-container.count-2 {
        grid-template-columns: 1fr;
        gap: 0.65rem;
        padding: 0.5rem 0;
        justify-items: stretch;
    }

    /* Tous les boutons en pleine largeur */
    .dialog-button,
    .dialog-button.usage-card,
    .dialog-button.option-choice,
    .dialog-options-container.count-3 .dialog-button.option-choice,
    .dialog-options-container.count-2 .dialog-button.option-choice {
        flex-basis: 100%;
        width: 100%;
        max-width: none;
        min-height: 100px;
        padding: 0.85rem 0.75rem;
        margin: 0;
    }

    /* Cartes d'usage en mode colonne sur mobile */
    .dialog-button.usage-card {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
        padding: 0.75rem;
        min-height: 90px;
        gap: 12px;
    }

    .dialog-button.usage-card img {
        max-width: 80px;
        max-height: 80px;
        margin-right: 12px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .dialog-button img {
        max-width: 85px;
        max-height: 85px;
        margin-bottom: 0.5rem;
    }

    .dialog-button .text-content {
        width: 100%;
    }

    .dialog-button .title {
        font-size: 0.92rem;
        margin-bottom: 0.3rem;
    }

    .dialog-button .desc {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .dialog-button.option-choice {
        padding: 0.85rem 1rem;
        min-height: 60px;
        justify-content: center;
    }

    .dialog-button.option-choice .title {
        font-size: 0.95rem;
    }

    .dialog-button.option-choice .desc {
        font-size: 0.75rem;
        margin-top: 0.25rem;
    }

    /* Modal de sélection de mode */
    .mode-selection-modal {
        padding: 1.5rem;
        margin: 1rem;
        max-width: none;
        width: 90%;
    }

    .mode-selection-modal h2 {
        font-size: 1.3rem;
        margin-bottom: 0.4rem;
    }

    .mode-selection-modal p {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .mode-buttons {
        gap: 0.85rem;
    }

    .mode-button {
        padding: 1.25rem;
        gap: 0.85rem;
        border-radius: 10px;
    }

    .mode-icon {
        font-size: 2.2rem;
        min-width: 55px;
    }

    .mode-text h3 {
        font-size: 1.05rem;
        margin-bottom: 0.4rem;
    }

    .mode-text p {
        font-size: 0.88rem;
        line-height: 1.35;
    }

    /* Bouton de basculement de mode */
    .mode-switch-button {
        width: 100%;
        padding: 10px 14px;
        font-size: 13px;
        margin: 0 0 10px 0;
    }

    .mode-switch-icon {
        font-size: 14px;
    }

    /* Modal de confirmation */
    .mode-switch-confirm-modal {
        margin: 20px;
        padding: 20px;
        border-radius: 14px;
    }

    .mode-switch-confirm-modal h3 {
        font-size: 18px;
        margin-bottom: 14px;
    }

    .mode-switch-confirm-modal p {
        font-size: 13px;
        line-height: 1.5;
        margin-bottom: 14px;
    }

    .mode-switch-confirm-modal p:last-of-type {
        font-size: 12px;
        margin-bottom: 20px;
    }

    .mode-switch-confirm-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .mode-switch-confirm-yes,
    .mode-switch-confirm-no {
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 8px;
        min-height: 48px;
    }
}

/* Très petits smartphones */
@media (max-width: 375px) {
    .dialog-button,
    .dialog-button.usage-card {
        padding: 0.7rem;
        min-height: 85px;
    }

    .dialog-button.usage-card img {
        max-width: 70px;
        max-height: 70px;
        margin-right: 10px;
    }

    .dialog-button img {
        max-width: 75px;
        max-height: 75px;
    }

    .dialog-button .title {
        font-size: 0.88rem;
    }

    .dialog-button .desc {
        font-size: 0.75rem;
    }

    .mode-selection-modal {
        padding: 1.25rem;
        margin: 0.75rem;
    }

    .mode-selection-modal h2 {
        font-size: 1.2rem;
    }

    .mode-button {
        padding: 1rem;
        gap: 0.75rem;
    }

    .mode-icon {
        font-size: 2rem;
        min-width: 50px;
    }

    .mode-text h3 {
        font-size: 1rem;
    }

    .mode-text p {
        font-size: 0.85rem;
    }

    .mode-switch-confirm-modal {
        margin: 15px;
        padding: 18px;
    }

    .mode-switch-confirm-yes,
    .mode-switch-confirm-no {
        padding: 11px 18px;
        font-size: 13px;
        min-height: 44px;
    }
}

/* Tablettes en mode paysage */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .dialog-options-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .dialog-button.usage-card {
        min-height: 95px;
    }

    .mode-selection-modal {
        max-width: 500px;
    }
}

/* Optimisations tactiles pour les dialogues */
@media (hover: none) and (pointer: coarse) {
    /* Zone tactile suffisante */
    .dialog-button {
        min-height: 56px;
    }

    .mode-button,
    .mode-switch-button,
    .mode-switch-confirm-yes,
    .mode-switch-confirm-no {
        min-height: 48px;
    }

    /* Pas d'effet hover */
    .dialog-button:hover:not(:disabled),
    .mode-button:hover,
    .mode-switch-button:hover {
        transform: none;
        box-shadow: inherit;
    }

    /* Effet active à la place */
    .dialog-button:active:not(:disabled) {
        transform: scale(0.98);
        background: #e8f0f8;
    }

    .mode-button:active {
        transform: scale(0.98);
    }

    .mode-switch-button:active {
        transform: scale(0.98);
    }

    .mode-switch-confirm-yes:active,
    .mode-switch-confirm-no:active {
        transform: scale(0.98);
    }
} 