/* ---------------------------------------------------------------------- */
/* SENTINEL STATUS WIDGET STYLES (ADAPTIV FÜR DAY/NIGHT MODE)             */
/* ---------------------------------------------------------------------- */

/* --- Basis-Struktur des Widgets --- */
.camera-status-widget {
    /* Verwendung von Theme-Variablen für konsistente Optik */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    
    /* NEU: Vorbereitung für den linken roten Rahmen (Standard: Transparent) */
    border-left: 5px solid transparent;
    transition: all 0.3s ease;
    
    /* NEU: Flexbox für die Anordnung von Schalter und Indikatoren */
    display: flex;
    flex-direction: column; 
    gap: 12px;
}

/* NEU: Flex-Container für Schalter und Indikatoren */
.camera-status-widget #cameraIndicators {
    display: flex; /* Richtet Schalter und Indikatoren nebeneinander aus */
    align-items: center;
    flex-wrap: wrap;
    gap: 8px; /* Kleinerer Abstand zwischen den Elementen */
}


/* --- Globaler Schalter (Nur Admin) --- */

/* Globaler Schalter Container: GLEICHE GRÖSSE WIE INDIKATOREN (28px) */
.global-switch-container {
    /* Setzt die neue kleinere Größe */
    width: 28px; 
    height: 28px;
    border-radius: 50%; /* Rund machen */
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.3s;
    flex-shrink: 0;
    color: white; 
}

/* Zustand AN (Blau/Aktiv) - Neutraler als Rot */
.global-switch-on {
    background-color: #2196F3; /* Helles Blau */
}

/* Zustand AUS (Grau/Inaktiv) */
.global-switch-off {
    background-color: #9E9E9E; /* Neutrales Grau */
}

/* Der Button selbst */
.global-switch-btn {
    background: none;
    border: none;
    color: inherit;
    font-weight: bold;
    font-size: 8px; /* NOCH Kleinere Schrift */
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    outline: none;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
}
.global-switch-btn:hover:not(:disabled) {
    opacity: 0.8;
}
.global-switch-btn:disabled {
    cursor: wait;
}


/* --- Individueller Indikator-Punkt & Link-Anpassung (28px) --- */
.indicator-point {
    width: 28px; /* NEU: 10% kleiner (von 32px auf 28px) */
    height: 28px; /* NEU: 10% kleiner (von 32px auf 28px) */
    border-radius: 50%;
    
    background-color: transparent;
    
    /* Flex-Eigenschaften */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--text-color) !important;
    
    /* Standard Randfarbe ist die Border-Color des Themes */
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    
    /* SICHERHEIT/KLICKBARKEIT */
    pointer-events: auto !important;
    cursor: pointer !important;
    text-decoration: none !important;
    flex-shrink: 0;
}

.indicator-point .cam-label {
    font-size: 0.65em; /* Auch etwas kleiner */
}

.indicator-point:hover {
    opacity: 0.9;
    transform: scale(1.1);
}


/* --- Status-Definitionen (Rest bleibt gleich) --- */

/* 1. ROT: Bewegung erkannt (Status-Active) */
.camera-status-widget .indicator-point.status-active {
    background-color: var(--color-red) !important;
    border-color: var(--color-red) !important;
    color: #fff;
    box-shadow: 0 0 8px 5px rgba(255, 85, 85, 0.6);
    animation: pulse 1s infinite alternate;
}

/* 2. GRÜN: Stream läuft, keine Bewegung (Status-OK) */
.camera-status-widget .indicator-point.status-ok {
    background-color: #38c172 !important;
    border-color: #38c172 !important;
    color: #fff;
    box-shadow: 0 0 3px rgba(56, 193, 114, 0.5);
}

/* 3. GRAU/WEISS: RTMP-Stream ausgefallen (Status-RTMP-Down) */
.camera-status-widget .indicator-point.status-rtmp-down {
    background-color: var(--bar-bg-color) !important;
    border-color: var(--secondary-text-color) !important;
    color: var(--secondary-text-color);
    box-shadow: none;
}

/* --- Zusätzliche Zustände (Rest bleibt gleich) --- */

/* Widget-Alarm: Roter senkrechter Strich */
.camera-status-widget.motion-alert {
    border-left: 5px solid var(--color-red) !important;
    border-top-color: var(--border-color);
    border-right-color: var(--border-color);
    border-bottom-color: var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Lade- und Fehlertexte */
.status-loading, .status-error {
    color: var(--secondary-text-color);
    font-style: italic;
    align-self: center;
}

.status-error {
    color: var(--color-red);
    font-weight: bold;
}

/* Keyframe für den Puls-Effekt (Rot) */
@keyframes pulse {
    from {
        box-shadow: 0 0 0 0 rgba(255, 85, 85, 0.7);
    }
    to {
        box-shadow: 0 0 8px 5px rgba(255, 85, 85, 0);
    }
}
