/* Traffic Light Central - Custom Styles */

:root {
    --tlc-primary: #0d6efd;
    --tlc-success: #198754;
    --tlc-warning: #ffc107;
    --tlc-danger: #dc3545;
    --tlc-info: #0dcaf0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f8f9fa;
}

.navbar-brand {
    font-weight: bold;
    letter-spacing: 0.5px;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.075);
    font-weight: 500;
}

.badge {
    font-weight: 500;
}

.led {
    display: inline-block;
    font-size: 1.2em;
    line-height: 1;
    margin: 0 0.2em;
}

.led-on  { color: #198754; }
.led-off { color: #adb5bd; }
.led-faint { color: #ffc107; }
.led-fail { color: #dc3545; }

.led-large {
    font-size: 2.5em;
    font-weight: bold;
    margin: 0 0.2em;
}

.led-state {
    display: inline-block;
    padding: 0.3em 0.8em;
    border-radius: 1em;
    font-weight: bold;
    margin: 0 0.3em;
}

.led-state.on  { background: #198754; color: white; }
.led-state.off { background: #6c757d; color: white; }
.led-state.fail { background: #dc3545; color: white; }
.led-state.faint { background: #ffc107; color: black; }

.lamp-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 0.5rem;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    margin-bottom: 1rem;
}

.lamp-card.active {
    border-color: #198754;
    background: #d1e7dd;
}

#map {
    border-radius: 0.25rem;
}

.leaflet-popup-content {
    font-family: inherit;
}

.leaflet-popup-content b {
    color: var(--tlc-primary);
}

.phase-indicator {
    display: inline-block;
    padding: 0.25em 0.6em;
    border-radius: 0.25rem;
    background: #e9ecef;
    font-weight: bold;
    color: #495057;
    min-width: 60px;
    text-align: center;
}

table.table-sm td, table.table-sm th {
    padding: 0.4rem 0.5rem;
    font-size: 0.875rem;
}

.text-muted {
    color: #6c757d !important;
}

.bg-critical {
    background-color: #dc3545 !important;
    color: white;
}

.bg-warning-soft {
    background-color: #fff3cd !important;
}

.display-4 {
    font-size: 3rem;
    font-weight: 300;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }
}

/* Phase color coding */
.phase-0 { color: #dc3545; }  /* All red */
.phase-1 { color: #fd7e14; }  /* Red+Yellow */
.phase-2 { color: #198754; }  /* Green */
.phase-3 { color: #ffc107; }  /* Yellow */
.phase-4 { color: #6c757d; }  /* Clearance */
.phase-5 { color: #fd7e14; }  /* Red+Yellow (slave) */
.phase-6 { color: #198754; }  /* Green (slave) */
.phase-7 { color: #ffc107; }  /* Yellow (slave) */
.phase-8 { color: #6c757d; }  /* Clearance (slave) */

/* Sticky override pulzáló animáció (állomás lista "Érvényben" oszlop) */
.pulse-sticky {
    animation: pulse-sticky-anim 1.5s ease-in-out infinite;
}

@keyframes pulse-sticky-anim {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.5);
    }
    50% {
        opacity: 0.85;
        box-shadow: 0 0 0 6px rgba(255, 193, 7, 0);
    }
}

/* Sárga villogó (yellow flash / korábban cascade) animációk */
.pulse-cascade {
    animation: pulse-cascade-anim 1.5s ease-in-out infinite;
}

@keyframes pulse-cascade-anim {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% {
        opacity: 0.9;
        box-shadow: 0 0 0 8px rgba(220, 53, 69, 0);
    }
}

.cascade-row {
    background-color: rgba(220, 53, 69, 0.08) !important;
}

.cascade-alert {
    border: 2px solid #dc3545;
}

/* Térkép marker: sárga villogó állomás */
.pulse-cascade-marker {
    animation: map-cascade-pulse 1.2s ease-in-out infinite;
}

@keyframes map-cascade-pulse {
    0%, 100% {
        stroke-opacity: 1;
        stroke-width: 4;
    }
    50% {
        stroke-opacity: 0.4;
        stroke-width: 6;
    }
}

.pulse-warning-marker {
    animation: map-warning-pulse 1.5s ease-in-out infinite;
}

@keyframes map-warning-pulse {
    0%, 100% {
        stroke-opacity: 1;
    }
    50% {
        stroke-opacity: 0.5;
    }
}
