/* ============================================
   Détails OF dans of-selection-container
   Design élégant et informatif
   ============================================ */

/* Container de la section OF */
.of-selection-container {
    position: relative;
}

/* Détails OF dans of-selection-container */
.of-selection-container .of-details {
    margin-top: 20px;
    padding: 0;
    background: transparent;
    border: none;
    display: block !important;
}

/* Message par défaut (aucun OF sélectionné) */
.of-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #E1F5FE 0%, #F0F9FF 100%);
    border: 1px solid #40A6FF;
    border-left: 3px solid #0078D4;
    border-radius: 6px;
    color: #323130;
    font-size: 12px;
    font-weight: 500;
    margin-top: 12px;
}

.of-info::before {
    content: '\f05a'; /* FontAwesome info-circle */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 16px;
    color: #0078D4;
}

/* Section des détails OF - Design carte COMPACT */
.of-details-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFB 100%);
    border: 1px solid #E1E4E8;
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.of-details-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0078D4 0%, #40A6FF 50%, #0078D4 100%);
}

.of-details-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* En-tête de la carte OF */
.of-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #F3F2F1;
}

.of-card-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #323130;
}

.of-card-title i {
    font-size: 16px;
    color: #0078D4;
    background: linear-gradient(135deg, #E1F5FE 0%, #FFFFFF 100%);
    padding: 5px;
    border-radius: 6px;
}

.of-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: linear-gradient(135deg, #0078D4 0%, #005A9E 100%);
    color: #FFFFFF;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 120, 212, 0.3);
}

.of-card-badge i {
    font-size: 11px;
}

/* Grille des détails OF - Format horizontal compact */
.of-details-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

.of-detail-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: linear-gradient(135deg, #FAF9F8 0%, #FFFFFF 100%);
    border: 1px solid #E1E4E8;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    font-size: 11px;
}

.of-detail-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #0078D4 0%, #40A6FF 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.of-detail-item:hover {
    background: linear-gradient(135deg, #F0F6FF 0%, #FFFFFF 100%);
    border-color: #0078D4;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 120, 212, 0.15);
}

.of-detail-item:hover::before {
    opacity: 1;
}

.detail-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    color: #605E5C;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
}

.detail-label i {
    font-size: 11px;
    color: #0078D4;
    width: 12px;
    text-align: center;
}

.detail-value {
    font-size: 11px;
    font-weight: 600;
    color: #323130;
    word-break: break-word;
    padding-left: 0;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Détails importants (highlight) */
.of-detail-item.highlight {
    background: linear-gradient(135deg, #E1F5FE 0%, #F0F9FF 100%);
    border-color: #0078D4;
    border-width: 1.5px;
}

.of-detail-item.highlight .detail-label {
    color: #0078D4;
}

.of-detail-item.highlight .detail-value {
    color: #005A9E;
    font-size: 13px;
}

/* Actions de la carte OF - Masquées par défaut pour économiser l'espace */
.of-card-actions {
    display: none;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #E1E4E8;
}

.of-card-action-btn {
    flex: 1;
    padding: 6px 12px;
    background-color: #FFFFFF;
    border: 1px solid #E1E4E8;
    border-radius: 5px;
    color: #323130;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.of-card-action-btn:hover {
    background-color: #F3F2F1;
    border-color: #0078D4;
    color: #0078D4;
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.of-card-action-btn i {
    font-size: 11px;
}

/* Variantes de couleur pour différents types de détails */
.of-detail-item[data-type="machine"] .detail-label i {
    color: #107C10;
}

.of-detail-item[data-type="date"] .detail-label i {
    color: #D97706;
}

.of-detail-item[data-type="article"] .detail-label i {
    color: #9333EA;
}

.of-detail-item[data-type="designation"] .detail-label i {
    color: #DC2626;
}

/* État de chargement */
.of-details-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.of-details-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #F3F2F1;
    border-top-color: #0078D4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Animation d'apparition */
.of-details-card {
    animation: fadeInUp 0.4s ease-out;
}

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

/* Bouton de fermeture/réduction */
.of-card-toggle {
    background: transparent;
    border: none;
    color: #605E5C;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.of-card-toggle:hover {
    background-color: #F3F2F1;
    color: #323130;
}

/* Version compacte (réduite) - Par défaut maintenant */
.of-details-card.compact .of-details-grid {
    display: none;
}

.of-details-card.compact .of-card-actions {
    display: none;
}

.of-details-card.compact {
    padding: 6px 10px;
}

.of-details-card.compact .of-card-header {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Réduction supplémentaire de l'espace */
.of-selection-container .of-details {
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 1024px) {
    .of-details-grid {
        flex-wrap: wrap;
    }
    
    .of-detail-item {
        font-size: 10px;
        padding: 3px 6px;
    }
}

@media (max-width: 768px) {
    .of-details-grid {
        flex-direction: column;
        align-items: stretch;
    }
    
    .of-detail-item {
        width: 100%;
        justify-content: flex-start;
    }
    
    .of-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .of-card-actions {
        flex-direction: column;
    }
    
    .of-card-action-btn {
        width: 100%;
    }
    
    .detail-value {
        font-size: 11px;
        max-width: none;
    }
}

/* Print styles */
@media print {
    .of-card-actions {
        display: none;
    }
    
    .of-card-toggle {
        display: none;
    }
    
    .of-details-card {
        box-shadow: none;
        page-break-inside: avoid;
    }
}

