/* Styles supplémentaires pour les boîtiers OTB */

/* Mode Liste Amélioré */
.boitier-row-enhanced {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 24px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #f1f3f4;
}

.boitier-row-enhanced:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    border-color: #3498db;
}

.boitier-list-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.boitier-identity {
    display: flex;
    align-items: center;
    flex: 1;
}

.boitier-avatar-enhanced {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.boitier-avatar-enhanced i {
    font-size: 20px;
    margin-bottom: 4px;
}

.avatar-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.boitier-info-main {
    flex: 1;
}

.boitier-title-enhanced {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.boitier-location {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.zone-name {
    font-weight: 600;
    color: #34495e;
    margin-right: 8px;
}

.boitier-address {
    display: flex;
    align-items: center;
    color: #7f8c8d;
}

.boitier-actions-list {
    display: flex;
    gap: 8px;
}

.boitier-metrics-enhanced {
    padding: 24px;
    background: #fafbfc;
}

.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.metric-card {
    background: white;
    padding: 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #f1f3f4;
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 16px;
}

.ports-total .metric-icon {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.ports-occupied .metric-icon {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.ports-free .metric-icon {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}

.cost-info .metric-icon {
    background: rgba(241, 196, 15, 0.1);
    color: #f1c40f;
}

.metric-content {
    flex: 1;
}

.metric-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

.metric-label {
    font-size: 12px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.performance-section {
    background: white;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #f1f3f4;
}

.performance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.performance-label {
    font-size: 14px;
    font-weight: 600;
    color: #34495e;
}

.performance-value {
    font-size: 16px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
}

.performance-value.excellent {
    background: #d5f4e6;
    color: #2ecc71;
}

.performance-value.good {
    background: #fdeaa7;
    color: #f39c12;
}

.performance-value.poor {
    background: #fadbd8;
    color: #e74c3c;
}

.progress-enhanced {
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: #ecf0f1;
    display: flex;
}

.progress-enhanced .progress-bar {
    height: 100%;
    transition: width 0.6s ease;
}

/* Visualisation des ports en mode liste */
.ports-visualization-list {
    padding: 24px;
    background: white;
    border-top: 1px solid #f1f3f4;
}

.ports-header-list {
    margin-bottom: 16px;
}

.ports-header-list h6 {
    margin: 0;
    color: #34495e;
    font-weight: 600;
}

.ports-grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.port-item-list {
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.port-item-list:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.port-item-list.libre {
    border-color: #2ecc71;
    background: linear-gradient(135deg, #d5f4e6 0%, #ffffff 100%);
}

.port-item-list.occupe {
    border-color: #e74c3c;
    background: linear-gradient(135deg, #fadbd8 0%, #ffffff 100%);
}

.port-item-list.defectueux {
    border-color: #f39c12;
    background: linear-gradient(135deg, #fdeaa7 0%, #ffffff 100%);
}

.port-item-list.reserve {
    border-color: #9b59b6;
    background: linear-gradient(135deg, #e8daef 0%, #ffffff 100%);
}

.port-number {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #2c3e50;
    margin-right: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.port-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
}

.port-status-indicator.libre {
    background: #2ecc71;
    animation: pulse-green 2s infinite;
}

.port-status-indicator.occupe {
    background: #e74c3c;
}

.port-status-indicator.defectueux {
    background: #f39c12;
    animation: blink 1s infinite;
}

.port-status-indicator.reserve {
    background: #9b59b6;
}

.port-info {
    flex: 1;
}

.port-status-text {
    display: block;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 2px;
}

.port-client {
    display: block;
    color: #7f8c8d;
    font-style: italic;
}

/* Mode Liste Original (maintenir pour compatibilité) */
.list-mode .boitier-row {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.list-mode .boitier-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.boitier-list-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f1f3f4;
}

.boitier-list-item:last-child {
    border-bottom: none;
}

.boitier-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.boitier-details {
    flex: 1;
}

.boitier-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.boitier-subtitle {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 10px;
}

.boitier-metrics {
    display: flex;
    gap: 20px;
}

.metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    min-width: 80px;
}

.metric-value {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
}

.metric-label {
    font-size: 11px;
    color: #7f8c8d;
    text-transform: uppercase;
}

/* Mode Grille */
.grid-mode {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.grid-boitier-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.grid-boitier-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.grid-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.grid-card-code {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
}

.grid-card-zone {
    font-size: 14px;
    opacity: 0.9;
}

.grid-card-body {
    padding: 20px;
}

.ports-mini-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 15px 0;
}

.port-mini {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: white;
}

.port-mini.libre {
    background: #2ecc71;
}

.port-mini.occupe {
    background: #e74c3c;
}

.port-mini.defectueux {
    background: #f39c12;
}

.port-mini.reserve {
    background: #9b59b6;
}

/* Animations avancées pour la vue 3D */
@keyframes rotate3d {
    0% { transform: rotateX(-10deg) rotateY(15deg); }
    25% { transform: rotateX(-5deg) rotateY(25deg); }
    50% { transform: rotateX(-15deg) rotateY(5deg); }
    75% { transform: rotateX(-5deg) rotateY(25deg); }
    100% { transform: rotateX(-10deg) rotateY(15deg); }
}

.boitier-container.animated {
    animation: rotate3d 6s ease-in-out infinite;
}

/* Effets de particules pour les ports actifs */
.port.libre::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: rgba(46, 204, 113, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse-particle 2s ease-in-out infinite;
}

@keyframes pulse-particle {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0.5;
    }
}

/* Effets de survol améliorés */
.boitier-3d:hover .boitier-container {
    transform: rotateX(0deg) rotateY(25deg) scale(1.1);
    filter: brightness(1.1);
}

.boitier-3d:hover .port {
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

/* Légende des couleurs */
.legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legend-color.libre { background: #2ecc71; }
.legend-color.occupe { background: #e74c3c; }
.legend-color.defectueux { background: #f39c12; }
.legend-color.reserve { background: #9b59b6; }

/* Responsive design */
@media (max-width: 768px) {
    .boitier-3d {
        width: 250px;
        height: 150px;
    }
    
    .boitier-front {
        width: 230px;
        height: 130px;
    }
    
    .ports-grid {
        padding: 10px;
        gap: 4px;
    }
    
    .port {
        width: 40px;
        height: 40px;
        font-size: 10px;
    }
    
    .grid-mode {
        grid-template-columns: 1fr;
    }
    
    .boitier-list-item {
        flex-direction: column;
        text-align: center;
    }
    
    .boitier-avatar {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .boitier-metrics {
        justify-content: center;
    }
}

/* Indicateurs de performance */
.performance-indicator {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.performance-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    position: relative;
    overflow: hidden;
}

.performance-circle.excellent {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.performance-circle.good {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.performance-circle.poor {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.performance-text {
    font-size: 10px;
    margin-top: 5px;
    text-align: center;
    color: #7f8c8d;
}

/* Filtres avancés */
.advanced-filters {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-item {
    flex: 1;
    min-width: 200px;
}

.range-slider {
    width: 100%;
    margin: 10px 0;
}

/* Statistiques en temps réel */
.realtime-stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    display: block;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
}

.stat-change {
    font-size: 11px;
    margin-top: 5px;
}

.stat-change.positive { color: #2ecc71; }
.stat-change.negative { color: #e74c3c; }

/* Responsive pour le mode liste amélioré */
@media (max-width: 768px) {
    .boitier-list-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .boitier-identity {
        flex-direction: column;
        text-align: center;
    }
    
    .boitier-avatar-enhanced {
        margin-right: 0;
        margin-bottom: 16px;
    }
    
    .metrics-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ports-grid-list {
        grid-template-columns: 1fr;
    }
    
    .performance-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .performance-value {
        margin-left: 0;
    }
    
    .boitier-actions-list {
        flex-wrap: wrap;
        justify-content: center;
    }
}
