* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #1a1a1a;
    color: #ecf0f1;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Contrôles de démo */
.demo-controls {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 100;
}

.demo-button {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.demo-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.demo-button.active {
    background: linear-gradient(135deg, #27ae60, #229954);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.demo-icon {
    font-size: 20px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.demo-status {
    display: flex;
    align-items: center;
    gap: 20px;
}

.demo-status.hidden {
    display: none;
}

.demo-timeline {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 5px;
    width: 300px;
    position: relative;
    overflow: hidden;
}

.demo-progress {
    height: 25px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 15px;
    width: 0%;
    transition: width 1s linear;
    position: relative;
}

.demo-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.demo-time {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.stop-demo-button {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.stop-demo-button:hover {
    background: rgba(231, 76, 60, 0.3);
    transform: scale(1.05);
}

/* Notifications de démo */
.demo-notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.demo-notification {
    background: rgba(0, 0, 0, 0.9);
    border-radius: 10px;
    padding: 15px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    border-left: 4px solid;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.demo-notification.show {
    transform: translateX(0);
}

.demo-notification.info {
    border-left-color: #3498db;
}

.demo-notification.phase {
    border-left-color: #9b59b6;
    background: rgba(155, 89, 182, 0.1);
}

.demo-notification.event {
    border-left-color: #f39c12;
}

.demo-notification.alert {
    border-left-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.demo-notification.success {
    border-left-color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
}

.demo-notification.eco {
    border-left-color: #1abc9c;
    background: rgba(26, 188, 156, 0.1);
}

.demo-notification.cvc-action {
    border-left-color: #9b59b6;
    background: rgba(155, 89, 182, 0.15);
    border: 1px solid rgba(155, 89, 182, 0.3);
    box-shadow: 0 6px 30px rgba(155, 89, 182, 0.2);
}

.notification-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.notification-time {
    font-size: 11px;
    color: #95a5a6;
    white-space: nowrap;
}

#app {
    display: flex;
    min-height: calc(100vh - 200px);
    overflow: visible;
    margin-bottom: 0;
}

/* Zone de visualisation principale */
#pool-container {
    flex: 1;
    position: relative;
    background-color: #2c3e50;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#pool-svg {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

#pool-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Panneau latéral */
#sidebar {
    width: 350px;
    background-color: #fff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    padding: 20px;
    overflow-y: auto;
}

#sidebar h2 {
    color: #00796b;
    margin-bottom: 20px;
}

#sidebar h3 {
    color: #004d40;
    font-size: 16px;
    margin-bottom: 10px;
}

/* Statut de connexion */
#connection-status {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

#connection-status.connected {
    background-color: #e8f5e9;
    color: #2e7d32;
}

#connection-status.connected .status-dot {
    background-color: #4caf50;
}

#connection-status.disconnected {
    background-color: #ffebee;
    color: #c62828;
}

#connection-status.disconnected .status-dot {
    background-color: #f44336;
}

/* Sections */
.section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.section:last-child {
    border-bottom: none;
}

/* Conteneurs de liste */
.list-container {
    background-color: #f9f9f9;
    border-radius: 5px;
    padding: 10px;
    min-height: 80px;
}

.loading {
    color: #666;
    text-align: center;
    font-style: italic;
}

.no-data {
    color: #999;
    text-align: center;
    font-style: italic;
}

/* Items de liste */
.list-item {
    background-color: #fff;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    border-left: 3px solid #00796b;
    transition: all 0.2s;
}

.list-item:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transform: translateX(2px);
}

.list-item.active {
    background-color: #e0f2f1;
    border-left-color: #004d40;
}

.list-item .name {
    font-weight: 500;
    color: #004d40;
}

.list-item .info {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Conteneur de télémétrie */
.telemetry-container {
    background-color: #f9f9f9;
    border-radius: 5px;
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.telemetry-item {
    background-color: #fff;
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 4px;
    font-size: 13px;
}

.telemetry-item .timestamp {
    color: #666;
    font-size: 11px;
}

.telemetry-item .device-name {
    font-weight: 500;
    color: #00796b;
}

.telemetry-item .location {
    color: #004d40;
    margin-top: 2px;
}

/* Responsive SVG */
@media (max-width: 1200px) {
    #pool-svg {
        max-width: 100%;
        height: auto;
    }
}

/* Marqueur enfant (rouge) - DALKIA_1 */
.marker.device.child-marker {
    background-color: #fff !important;
    border: 2px solid #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.4), 0 2px 10px rgba(0,0,0,0.4) !important;
    width: 14px !important;
    height: 14px !important;
}

.marker.device.child-marker::after {
    background-color: #e74c3c !important;
    width: 6px !important;
    height: 6px !important;
}

/* Override pour s'assurer que le rouge est appliqué */
#pool-overlay .marker.device.child-marker,
#pool-overlay .marker.device[data-is-child="true"],
#pool-overlay .marker.device[data-device-name="DALKIA_1"] {
    border-color: #e74c3c !important;
}

#pool-overlay .marker.device.child-marker::after,
#pool-overlay .marker.device[data-is-child="true"]::after,
#pool-overlay .marker.device[data-device-name="DALKIA_1"]::after {
    background-color: #e74c3c !important;
}

/* Statistiques de surveillance */
.monitoring-stats {
    background-color: #f9f9f9;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px;
    background-color: #fff;
    border-radius: 4px;
}

.stat-label {
    font-weight: 500;
    color: #666;
}

.stat-value {
    font-weight: 700;
    color: #00796b;
    font-size: 18px;
}

/* Bouton de simulation */
.btn-simulate {
    background-color: #ff9800;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
    width: 100%;
    margin-top: 10px;
}

.btn-simulate:hover {
    background-color: #f57c00;
}

/* Zone d'alertes */
.alerts-container {
    background-color: #f9f9f9;
    border-radius: 5px;
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.alert-item {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 5px;
    border-left: 4px solid;
    background-color: #fff;
    animation: slideIn 0.3s ease;
}

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

.alert-high {
    border-left-color: #e74c3c;
    background-color: #fff5f5;
}

.alert-medium {
    border-left-color: #f39c12;
    background-color: #fffbf0;
}

.alert-low {
    border-left-color: #3498db;
    background-color: #f0f8ff;
}

.alert-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.alert-icon {
    font-size: 20px;
    margin-right: 10px;
}

.alert-time {
    font-size: 11px;
    color: #999;
    margin-left: auto;
}

.alert-message {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}

/* Légende des marqueurs */
.legend {
    display: flex;
    gap: 20px;
    margin: 15px 0;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.marker-sample {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid;
    position: relative;
}

.marker-sample.adult {
    background-color: #fff;
    border-color: #27ae60;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.3);
}

.marker-sample.child {
    background-color: #fff;
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.3);
}

/* Popup d'alerte */
.alert-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.alert-popup-overlay.show {
    opacity: 1;
}

.alert-popup {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 3px solid #e74c3c;
}

.alert-popup-overlay.show .alert-popup {
    transform: scale(1);
}

.alert-popup-header {
    background-color: #e74c3c;
    color: white;
    padding: 20px;
    border-radius: 7px 7px 0 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.alert-popup-icon {
    font-size: 40px;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.alert-popup-title {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

.alert-popup-content {
    padding: 25px;
}

.alert-main-message {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.5;
}

.alert-popup-details {
    background-color: #f9f9f9;
    border-radius: 5px;
    padding: 15px;
}

.alert-detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 16px;
}

.detail-label {
    color: #666;
    font-weight: 500;
}

.detail-value {
    font-weight: bold;
    color: #333;
}

.danger-zone {
    color: #e74c3c;
}

.alert-warning {
    margin-top: 15px;
    padding: 10px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    color: #856404;
    text-align: center;
    font-weight: 500;
}

.alert-popup-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: center;
}

.alert-popup-button {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.alert-popup-button.acknowledge {
    background-color: #27ae60;
    color: white;
}

.alert-popup-button.acknowledge:hover {
    background-color: #219a52;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Flash d'écran pour attirer l'attention */
.screen-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(231, 76, 60, 0.3);
    z-index: 9999;
    pointer-events: none;
    animation: flash 0.5s ease;
}

@keyframes flash {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Marqueurs sur le SVG */
.marker {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 10;
}

/* Marqueur adulte (vert) */
.marker.device {
    background-color: #fff;
    border: 2px solid #27ae60;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.3), 0 2px 8px rgba(0,0,0,0.3);
}

.marker.device::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background-color: #27ae60;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.device-badge {
    display: none;
}

/* Zones SVG */
.zone-path {
    cursor: pointer;
    transition: all 0.3s ease;
}

.zone-path:hover {
    filter: brightness(1.1);
}

.zone-path text {
    pointer-events: none;
    user-select: none;
}

/* Animation de brillance pour les zones actives */
@keyframes zone-pulse {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
    100% { filter: brightness(1); }
}

/* Items de zone dans la sidebar */
.zone-item {
    padding: 12px;
    margin-bottom: 10px;
    background-color: #fff;
    border-radius: 6px;
    border-left: 4px solid #e0e0e0;
    transition: all 0.3s;
}

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

.zone-name {
    font-weight: 600;
    color: #004d40;
    font-size: 14px;
}

.zone-occupancy {
    font-size: 13px;
    font-weight: 500;
    color: #666;
}

.zone-info {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.zone-type {
    font-size: 11px;
    color: #999;
    text-transform: capitalize;
}

.staff-badge {
    font-size: 11px;
    background-color: #34495e;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
}

.zone-progress {
    height: 4px;
    background-color: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #27ae60;
    transition: all 0.5s ease;
}

/* États d'occupation */
.zone-medium {
    border-left-color: #f39c12;
}

.zone-medium .zone-occupancy {
    color: #f39c12;
}

.zone-full {
    border-left-color: #e74c3c;
}

.zone-full .zone-occupancy {
    color: #e74c3c;
    font-weight: 700;
}