/* ========================================
   COMPOSANTS CARTES - TLB Transport
   ======================================== */

/* ========================================
   STYLES COMMUNS POUR TOUTES LES CARTES
   ======================================== */

/* Éléments label/value communs à toutes les pages */
.info-item,
.preview-item,
.stat-item,
.alert-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
    min-height: 32px;
    flex-direction: row;
    justify-content: space-between;
    overflow: hidden;
    width: 100%;
}

.info-item:last-child,
.preview-item:last-child,
.stat-item:last-child,
.alert-item:last-child {
    border-bottom: none;
}

.info-label,
.preview-label,
.stat-label,
.alert-label {
    font-weight: 500;
    color: #7f8c8d;
    min-width: 150px;
    flex-shrink: 0;
    text-align: left;
}

.info-value,
.preview-value,
.stat-value,
.alert-value {
    font-weight: 600;
    color: #2c3e50;
    text-align: right;
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 200px;
    min-width: 0;
}

/* Cartes de base - Style unifié */
.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px 16px rgba(0,0,0,0.1);
    border-left: 4px solid #3498db;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 1.5rem;
    overflow: hidden;
    word-wrap: break-word;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* Standardisation des éléments de carte */
.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Alignement uniforme des titres */
.card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    min-height: 32px;
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 15px 0;
    gap: 10px;
    line-height: 1.2;
}

.card-title-text {
    flex: 1;
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.card-title-icon {
    font-size: 1.5rem;
    margin-left: 10px;
}

.card-icon {
    font-size: 1.5rem;
}

/* Cartes cliquables */
.clickable-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.clickable-card:hover .card-title,
.clickable-card:hover .card-action,
.clickable-card:hover .card-footer {
    position: relative;
    z-index: 2;
}

.card-action {
    font-size: 0.8rem;
    color: #e67e22;
    font-weight: 600;
    margin-left: auto;
}

.card-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}

/* Alias pour compatibilité avec info-card */
.info-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px 16px rgba(0,0,0,0.1);
    border-left: 4px solid #3498db;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 1.5rem;
    overflow: hidden;
    word-wrap: break-word;
}

/* Variantes de couleurs d'accent pour les cartes */
.card.technical,
.info-card.technical {
    border-left-color: #e74c3c;
}

.card.calibration,
.info-card.calibration {
    border-left-color: #f39c12;
}

.card.dtc,
.info-card.dtc {
    border-left-color: #e67e22;
}

.card.overspeed,
.info-card.overspeed {
    border-left-color: #9b59b6;
}

.card.download,
.info-card.download {
    border-left-color: #27ae60;
}

.card.light-vehicle,
.info-card.light-vehicle {
    border-left-color: #95a5a6;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.card.light-vehicle .card-title,
.info-card.light-vehicle .card-title {
    color: #6c757d;
}

.card.light-vehicle .no-data,
.info-card.light-vehicle .no-data {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    color: #1976d2;
    font-size: 0.9rem;
    line-height: 1.4;
}

.card.trailer-vehicle,
.info-card.trailer-vehicle {
    border-left-color: #9c27b0;
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
}

.card.trailer-vehicle .card-title,
.info-card.trailer-vehicle .card-title {
    color: #7b1fa2;
}

.card.trailer-vehicle .no-data,
.info-card.trailer-vehicle .no-data {
    background: #fce4ec;
    border: 1px solid #f8bbd9;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    color: #c2185b;
    font-size: 0.9rem;
    line-height: 1.4;
}

.card.company,
.info-card.company {
    border-left-color: #34495e;
}

.card.consumption,
.info-card.consumption {
    border-left-color: #e67e22;
}

.card.primary {
    border-left-color: #3498db;
}

.card.success {
    border-left-color: #27ae60;
}

.card.warning {
    border-left-color: #f39c12;
}

.card.danger {
    border-left-color: #e74c3c;
}

.card.info {
    border-left-color: #17a2b8;
}

.card.secondary {
    border-left-color: #6c757d;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.card-header {
    padding: 20px 25px 15px 25px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.card-title {
    color: #2c3e50;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.card-subtitle {
    color: #7f8c8d;
    margin: 5px 0 0 0;
    font-size: 0.9rem;
}

.card-body {
    padding: 25px;
}

.card-footer {
    padding: 15px 25px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}



.info-card h3 {
    color: #2c3e50;
    margin: 0 0 20px 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.info-label {
    font-weight: 600;
    color: #7f8c8d;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.info-value {
    color: #2c3e50;
    font-size: 1rem;
}

/* Cartes de statistiques */
.stat-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
}

.stat-trend {
    margin-top: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.stat-trend.up {
    color: #27ae60;
}

.stat-trend.down {
    color: #e74c3c;
}

.stat-trend.stable {
    color: #f39c12;
}

/* Cartes de mission */
.mission-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.mission-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.mission-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.mission-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.mission-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-planned { 
    background: #f39c12; 
    color: white; 
}

.status-active { 
    background: #27ae60; 
    color: white; 
}

.status-completed { 
    background: #3498db; 
    color: white; 
}

.status-cancelled { 
    background: #e74c3c; 
    color: white; 
}

.mission-details {
    margin-bottom: 15px;
}

.mission-detail {
    display: flex;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.mission-detail-label {
    font-weight: 600;
    color: #7f8c8d;
    min-width: 100px;
}

.mission-detail-value {
    color: #2c3e50;
}

.mission-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Cartes de véhicule */
.vehicle-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.vehicle-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}


.vehicle-plate {
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: monospace;
    margin: 0;
}

.vehicle-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.vehicle-status.active {
    background: #d4edda;
    color: #155724;
}

.vehicle-status.maintenance {
    background: #fff3cd;
    color: #856404;
}

.vehicle-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.vehicle-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}


.vehicle-detail-label {
    font-weight: 600;
    color: #7f8c8d;
    margin-bottom: 5px;
    font-size: 0.8rem;
}

.vehicle-detail-value {
    color: #2c3e50;
    font-size: 0.9rem;
}

.vehicle-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Cartes de profil */
.profile-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.profile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.profile-name {
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.profile-role {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.profile-role.driver {
    background: #d4edda;
    color: #155724;
}

.profile-role.admin {
    background: #cce5ff;
    color: #004085;
}

.profile-role.manager {
    background: #fff3cd;
    color: #856404;
}

.profile-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.profile-detail {
    display: flex;
    flex-direction: column;
}

.profile-detail-label {
    font-weight: 600;
    color: #7f8c8d;
    margin-bottom: 5px;
    font-size: 0.8rem;
}

.profile-detail-value {
    color: #2c3e50;
    font-size: 0.9rem;
}

.profile-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Cartes de DTC */
.dtc-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.dtc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.dtc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.dtc-code {
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: monospace;
    margin: 0;
}

.dtc-severity {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.dtc-severity.high {
    background: #f8d7da;
    color: #721c24;
}

.dtc-severity.medium {
    background: #fff3cd;
    color: #856404;
}

.dtc-severity.low {
    background: #d4edda;
    color: #155724;
}

.dtc-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.dtc-detail {
    display: flex;
    flex-direction: column;
}

.dtc-detail-label {
    font-weight: 600;
    color: #7f8c8d;
    margin-bottom: 5px;
    font-size: 0.8rem;
}

.dtc-detail-value {
    color: #2c3e50;
    font-size: 0.9rem;
}

.dtc-description {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
    font-style: italic;
    color: #6c757d;
    font-size: 0.9rem;
}

.dtc-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .card-body {
        padding: 20px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .mission-info,
    .vehicle-info,
    .profile-info,
    .dtc-info {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .mission-actions,
    .vehicle-actions,
    .profile-actions,
    .dtc-actions {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .card-body {
        padding: 15px;
    }
    
    .card-header {
        padding: 15px 20px 10px 20px;
    }
    
    .card-footer {
        padding: 10px 20px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}
