/**
 * Styles Front Office - Module Références Constructeurs
 * @author Pascal - autoparts-europe.eu
 */

/* Container principal */
.rfur-constructor-refs {
    padding: 15px 0;
    font-family: inherit;
}

/* Introduction */
.rfur-refs-intro {
    margin-bottom: 20px;
    color: #333;
    font-size: 14px;
}

/* Groupe de références */
.rfur-ref-group {
    margin-bottom: 20px;
}

/* Tableau des références */
.rfur-refs-table-wrapper {
    overflow-x: auto;
    margin-bottom: 10px;
}

.rfur-refs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

/* En-tête du tableau - style cliquable */
.rfur-refs-table thead th {
    background: #f5f5f5;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
}

.rfur-table-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.rfur-table-header:hover th {
    background: #ebebeb;
}

.rfur-table-header.rfur-header-collapsed th {
    border-bottom: 1px solid #ddd;
}

/* Contenu du header avec icône et titre */
.rfur-header-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rfur-type-icon {
    font-size: 18px;
    color: #2fb5d2;
}

.rfur-count {
    font-weight: normal;
    font-size: 13px;
    color: #666;
    margin-left: 4px;
}

/* Colonne toggle +/- */
.rfur-col-toggle {
    width: 50px;
    text-align: right !important;
    padding-right: 15px !important;
}

/* Bouton toggle +/- */
.rfur-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 2px solid #2fb5d2;
    border-radius: 4px;
    background: #fff;
    color: #2fb5d2;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rfur-toggle-btn:hover {
    background: #2fb5d2;
    color: #fff;
}

.rfur-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(47, 181, 210, 0.3);
}

.rfur-toggle-icon {
    display: inline;
}

/* Corps du tableau - collapsible */
.rfur-collapsible {
    transition: all 0.3s ease;
}

.rfur-collapsible tr {
    transition: opacity 0.2s ease;
}

.rfur-collapsible.rfur-collapsed {
    display: none;
}

/* Lignes du tableau */
.rfur-refs-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.15s ease;
}

.rfur-refs-table tbody tr:hover {
    background-color: #f9f9f9;
}

.rfur-refs-table td {
    padding: 10px 15px;
    vertical-align: middle;
}

/* Colonne fournisseur */
.rfur-col-supplier {
    width: 40%;
}

.rfur-supplier-name {
    font-weight: 500;
    color: #232323;
}

/* Colonne référence */
.rfur-col-xref {
    width: 50%;
}

.rfur-xref-code {
    display: inline-block;
    padding: 4px 10px;
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    color: #232323 !important;
    letter-spacing: 0.5px;
}

/* Disclaimer */
.rfur-refs-disclaimer {
    margin-top: 20px;
    padding: 12px 15px;
    background: #fff8e6;
    border-left: 3px solid #f0ad4e;
    border-radius: 0 4px 4px 0;
}

.rfur-refs-disclaimer small {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #8a6d3b;
    font-size: 12px;
    line-height: 1.5;
}

.rfur-refs-disclaimer .material-icons {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Message aucune référence */
.rfur-no-refs {
    padding: 20px;
    text-align: center;
    color: #666;
    background: #f9f9f9;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .rfur-refs-table thead th {
        padding: 10px 12px;
    }
    
    .rfur-header-content {
        font-size: 13px;
    }
    
    .rfur-toggle-btn {
        width: 24px;
        height: 24px;
        font-size: 16px;
    }
    
    .rfur-col-toggle {
        width: 40px;
        padding-right: 10px !important;
    }
    
    .rfur-refs-table tbody td {
        padding: 8px 12px;
    }
    
    .rfur-xref-code {
        font-size: 12px;
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    .rfur-refs-table thead .rfur-col-xref {
        display: none;
    }
    
    .rfur-refs-table tbody tr {
        display: block;
        margin-bottom: 8px;
        padding: 10px;
        background: #f9f9f9;
        border: 1px solid #eee;
        border-radius: 4px;
    }
    
    .rfur-refs-table tbody td {
        display: block;
        padding: 4px 0;
        border: none;
    }
    
    .rfur-refs-table tbody td[colspan] {
        padding-top: 6px;
    }
    
    .rfur-supplier-name::before {
        content: '';
    }
}

/* Animation au chargement */
.rfur-ref-group {
    animation: rfurFadeIn 0.3s ease-out;
}

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

/* ============================================
   Styles pour l'onglet Code Moteur
   ============================================ */

.rfur-engine-codes {
    padding: 15px 0;
    font-family: inherit;
}

.rfur-engine-codes .rfur-refs-intro {
    margin-bottom: 20px;
    color: #333;
    font-size: 14px;
}

/* Colonne Application */
.rfur-col-app {
    width: 60%;
}

/* Colonne Années */
.rfur-col-years {
    width: 30%;
    text-align: center;
}

/* Détails de l'application */
.rfur-app-details {
    padding: 12px 15px !important;
}

.rfur-criteria-item {
    margin-bottom: 4px;
    line-height: 1.4;
}

.rfur-criteria-item:last-child {
    margin-bottom: 0;
}

.rfur-criteria-label {
    font-weight: 600;
    color: #555;
    margin-right: 5px;
}

.rfur-criteria-value {
    color: #232323;
}

/* Code année */
.rfur-years {
    text-align: center;
    vertical-align: middle !important;
}

.rfur-year-code,
.rfur-year-display {
    display: inline-block;
    padding: 4px 10px;
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    color: #232323 !important;
}

.rfur-no-years {
    color: #999;
}
