/* Zone de gestion technique */
.technical-container {
    background: linear-gradient(135deg, #1a1a1a 0%, #2c3e50 100%);
    padding: 30px;
    margin-top: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

/* Graphique des économies */
.savings-graph-card {
    margin-top: 25px;
    background: rgba(255, 255, 255, 0.07);
    padding: 30px;
}

.savings-indicators {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.indicator-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.indicator-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.indicator-icon {
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.indicator-content {
    flex: 1;
}

.indicator-label {
    color: #95a5a6;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.indicator-value {
    color: #ecf0f1;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.indicator-percent {
    color: #27ae60;
    font-size: 18px;
    font-weight: bold;
}

.indicator-cost {
    color: #f39c12;
    font-size: 14px;
    margin-top: 3px;
}

.indicator-equiv {
    color: #3498db;
    font-size: 12px;
    margin-top: 3px;
}

.eco-card {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.2), rgba(39, 174, 96, 0.1));
    border-color: rgba(39, 174, 96, 0.3);
}

#savings-chart {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.2);
}

.savings-explanation {
    margin-top: 20px;
    padding: 15px 20px;
    background: rgba(52, 152, 219, 0.1);
    border-left: 4px solid #3498db;
    border-radius: 5px;
}

.explanation-text {
    color: #ecf0f1;
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
}

.explanation-text strong {
    color: #3498db;
}

.highlight-green {
    color: #27ae60;
    font-weight: bold;
}

.highlight-yellow {
    color: #f39c12;
    font-weight: bold;
}

.technical-title {
    text-align: center;
    color: #ecf0f1;
    margin-bottom: 30px;
    font-size: 28px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.technical-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.tech-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

/* Carte spécifique pour l'historique */
.maintenance-card {
    min-height: 800px;
    display: flex;
    flex-direction: column;
    height: 800px;
}

.maintenance-card .maintenance-list {
    flex: 1;
}

.tech-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.tech-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #3498db;
    font-size: 20px;
}

/* Actions de maintenance */
.maintenance-list {
    max-height: 700px;
    overflow-y: auto;
    min-height: 600px;
    padding-right: 5px;
}

/* Personnalisation de la scrollbar */
.maintenance-list::-webkit-scrollbar {
    width: 8px;
}

.maintenance-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.maintenance-list::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.5);
    border-radius: 4px;
}

.maintenance-list::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.7);
}

.maintenance-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.maintenance-icon {
    font-size: 24px;
}

.maintenance-content {
    flex: 1;
}

.maintenance-title {
    font-weight: bold;
    color: #ecf0f1;
    margin-bottom: 5px;
}

.maintenance-desc {
    font-size: 13px;
    color: #bdc3c7;
    line-height: 1.4;
}

.maintenance-priority {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.priority-high {
    background: #e74c3c;
    color: white;
}

.priority-medium {
    background: #f39c12;
    color: white;
}

.priority-low {
    background: #27ae60;
    color: white;
}

/* Actions de démo dans l'historique */
.maintenance-item.demo-action {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.05), rgba(52, 152, 219, 0.05));
    border: 1px solid rgba(155, 89, 182, 0.1);
}

.maintenance-item.demo-action .maintenance-icon {
    animation: pulse 2s ease-in-out infinite;
}

.maintenance-item.demo-action .maintenance-desc {
    color: #9b59b6;
    font-style: italic;
}

/* Gestion CVC */
.cvc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.cvc-zone {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.cvc-zone-name {
    font-weight: bold;
    color: #3498db;
    margin-bottom: 10px;
    font-size: 14px;
}

.cvc-params {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cvc-param {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.cvc-param-name {
    color: #bdc3c7;
}

.cvc-param-value {
    font-weight: bold;
    color: #ecf0f1;
}

.cvc-gauge {
    margin-top: 10px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.cvc-gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    transition: width 0.5s ease;
    position: relative;
}

.cvc-gauge-fill.optimal {
    background: linear-gradient(90deg, #27ae60, #229954);
}

.cvc-gauge-fill.warning {
    background: linear-gradient(90deg, #f39c12, #d68910);
}

.cvc-gauge-fill.critical {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

/* Consommation énergétique */
.energy-display {
    text-align: center;
}

.energy-total {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.energy-label {
    display: block;
    color: #bdc3c7;
    font-size: 14px;
    margin-bottom: 10px;
}

.energy-value {
    font-size: 36px;
    font-weight: bold;
    color: #f39c12;
    text-shadow: 0 0 20px rgba(243, 156, 18, 0.5);
    animation: energyPulse 2s ease-in-out infinite;
}

@keyframes energyPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.energy-zones {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.energy-zone-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    font-size: 12px;
}

.energy-zone-name {
    color: #95a5a6;
    margin-bottom: 5px;
}

.energy-zone-value {
    font-weight: bold;
    color: #f39c12;
}

.energy-savings {
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid rgba(39, 174, 96, 0.3);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.savings-icon {
    font-size: 24px;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.savings-text {
    color: #27ae60;
    font-weight: bold;
}

/* Graphique */
.graph-card {
    grid-column: 1 / -1;
    position: relative;
}

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

.graph-header h3 {
    margin: 0;
}

/* Bouton plein écran */
.fullscreen-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ecf0f1;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.fullscreen-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.fullscreen-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.fullscreen-button:hover .fullscreen-icon {
    transform: scale(1.2);
}

/* Mode plein écran */
.graph-card.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: linear-gradient(135deg, #1a1a1a 0%, #2c3e50 100%);
    padding: 40px;
    margin: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

.graph-card.fullscreen .graph-header {
    margin-bottom: 30px;
}

.graph-card.fullscreen h3 {
    font-size: 32px;
}

.graph-card.fullscreen #consumption-chart {
    flex: 1;
    width: 100%;
    height: calc(100vh - 120px);
    max-width: none;
}

.graph-card.fullscreen .fullscreen-button {
    position: absolute;
    top: 40px;
    right: 40px;
    background: rgba(231, 76, 60, 0.2);
    border-color: rgba(231, 76, 60, 0.3);
}

.graph-card.fullscreen .fullscreen-button:hover {
    background: rgba(231, 76, 60, 0.3);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

/* Animation de transition */
.graph-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tooltip pour le bouton */
.fullscreen-button::after {
    content: 'Plein écran (Échap pour quitter)';
    position: absolute;
    bottom: -35px;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.fullscreen-button:hover::after {
    opacity: 1;
}

.graph-card.fullscreen .fullscreen-button::after {
    content: 'Échap ou cliquez pour quitter';
}

#consumption-chart {
    max-width: 100%;
    height: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 10px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(52, 152, 219, 0.2);
}

/* Scrollbar personnalisée */
.maintenance-list::-webkit-scrollbar {
    width: 6px;
}

.maintenance-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.maintenance-list::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.5);
    border-radius: 3px;
}

.maintenance-list::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.7);
}

/* Carte détails eau */
.water-details-card {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(25, 118, 210, 0.1));
}

.water-zones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.water-zone-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.water-zone-name {
    font-weight: bold;
    color: #3498db;
    margin-bottom: 8px;
}

.water-zone-stat {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    font-size: 13px;
}

.water-zone-stat .label {
    color: #95a5a6;
}

.water-zone-stat .value {
    color: #ecf0f1;
    font-weight: 500;
}

.water-zone-stat .value.high {
    color: #e74c3c;
}

.water-zone-stat .value.low {
    color: #27ae60;
}

.water-compliance-summary {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.water-compliance-summary h4 {
    margin: 0 0 15px 0;
    color: #3498db;
}

#water-compliance-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.compliance-item, .projection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

.compliance-label, .projection-label {
    color: #95a5a6;
    font-size: 14px;
}

.compliance-status {
    font-weight: bold;
    color: #27ae60;
}

.compliance-status.warning {
    color: #f39c12;
}

.compliance-status.critical {
    color: #e74c3c;
}

.projection-value {
    font-weight: bold;
    color: #3498db;
}

.water-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.eco-button, .report-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ecf0f1;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.eco-button:hover, .report-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.eco-button.active {
    background: rgba(46, 204, 113, 0.2);
    border-color: #2ecc71;
}

.eco-button.inactive {
    background: rgba(231, 76, 60, 0.2);
    border-color: #e74c3c;
}

.eco-icon, .report-icon {
    font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .technical-grid {
        grid-template-columns: 1fr;
    }
    
    .cvc-grid {
        grid-template-columns: 1fr;
    }
    
    .water-details-card {
        grid-column: span 1;
    }
}