/* ==========================================================================
   1. STRUCTURE GÉNÉRALE
   ========================================================================== */
.adx-section {
    max-width: 1100px;
    margin: 30px auto;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #333;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    box-sizing: border-box;
    position: relative;
    line-height: 1.5;
}
.adx-section * { box-sizing: border-box; }

/* ==========================================================================
   2. SÉLECTEUR DE MODE (ACCUEIL)
   ========================================================================== */
.adx-mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 40px;
}

.adx-mode-card {
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.adx-mode-card:hover {
    border-color: #cbd3da;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.adx-mode-card.active {
    border-color: #2e1f45;
    background-color: #fcfcfc;
    box-shadow: 0 0 0 1px #2e1f45 inset, 0 8px 20px rgba(46, 31, 69, 0.1);
}

.adx-mode-card .icon { font-size: 42px; margin-bottom: 15px; }
.adx-mode-card h3 { margin: 0 0 8px 0; color: #2e1f45; font-size: 18px; font-weight: 700; }
.adx-mode-card p { margin: 0; color: #666; font-size: 14px; }

/* ==========================================================================
   3. TIROIRS & RECHERCHE (IDs V2)
   ========================================================================== */
.adx-drawer {
    display: none;
    margin-bottom: 30px;
    animation: adxFadeIn 0.3s ease-out;
}
@keyframes adxFadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

.adx-search-box {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
}

/* Inputs de recherche */
input#adx-search-input,
input#adx-search-input-v2 {
    flex: 1;
    padding: 0 20px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    height: 50px; /* Hauteur confortable */
    min-width: 250px;
    transition: border-color 0.3s;
}
input#adx-search-input-v2:focus { border-color: #2e1f45; outline: none; }

/* Boutons Violets (Rechercher / Calculer) */
button#adx-api-search-btn,
button#adx-api-search-btn-v2,
button#adx-calculate-btn {
    background-color: #2e1f45 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 0 35px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.2s, transform 0.1s;
    height: 50px; /* Même hauteur que l'input */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
button#adx-api-search-btn-v2:hover,
button#adx-calculate-btn:hover {
    background-color: #4a3b69 !important;
}
button#adx-api-search-btn-v2:active { transform: scale(0.98); }

/* Box Saisie Manuelle */
.adx-manual-box {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
    background: #f4f4f4;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #eee;
}
.adx-manual-box > div { flex: 1; min-width: 200px; }
.adx-manual-box label { font-weight: 600; font-size: 13px; margin-bottom: 8px; display: block; color: #444; }
.adx-manual-box select, .adx-manual-box input { width: 100%; height: 45px; padding: 0 10px; border: 1px solid #ccc; border-radius: 4px; }

/* ==========================================================================
   4. LISTE DÉROULANTE (PORTAIL - BODY)
   ========================================================================== */
#adx-results-list {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 6px 6px;
    max-height: 350px;
    overflow-y: auto;
    /* Ombre portée forte pour détacher du fond */
    box-shadow: 0 10px 40px rgba(0,0,0,0.15); 
    display: none;
    z-index: 9999999 !important; /* Toujours au dessus */
    font-family: 'Segoe UI', sans-serif;
}

.adx-result-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.1s;
    background: #fff;
}
.adx-result-item:last-child { border-bottom: none; }
.adx-result-item:hover { background-color: #f7f7f9; border-left: 4px solid #2e1f45; padding-left: 16px; }

.adx-result-item div:first-child { font-weight: 600; color: #2e1f45; font-size: 15px; }
.adx-result-item div:last-child { font-size: 13px; color: #888; margin-top: 3px; }

.adx-no-result { padding: 20px; text-align: center; color: #888; font-style: italic; background:#fff; }

/* ==========================================================================
   5. HEADER DE RÉSULTAT (L'AVATAR MANQUANT)
   ========================================================================== */
.adx-diag-header {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 30px;
    padding: 25px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.adx-avatar-circle {
    width: 80px;
    height: 80px;
    min-width: 60px;
    background-color: #2e1f45;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    border: 4px solid #f2f0f5; /* Petit contour esthétique */
}

.adx-diag-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
    line-height: 1.2;
}

/* ==========================================================================
   6. RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    .adx-mode-selector { grid-template-columns: 1fr; }
    .adx-search-box { flex-direction: column; }
    
    button#adx-api-search-btn-v2, 
    button#adx-calculate-btn { width: 100%; margin-top: 10px; }
    
    .adx-diag-header { flex-direction: column; text-align: center; }
}