html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Remove hardcoded light-mode colors — let Syncfusion theme + data-bs-theme handle it */
h1:focus {
    outline: none;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem rgba(255,255,255,0.25), 0 0 0 0.25rem #258cfb;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #333;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #1b6ec2;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* ═══════════ Glow Effects (dark themes only) ═══════════ */
/* !important needed to override Syncfusion theme CSS and Blazor scoped CSS specificity */

/* Status dot glow — stronger on dark themes */
[data-bs-theme="dark"] .status-dot-online {
    box-shadow: 0 0 8px 3px rgba(25, 135, 84, 0.7) !important;
}
[data-bs-theme="dark"] .status-dot-offline {
    box-shadow: 0 0 8px 3px rgba(220, 53, 69, 0.7) !important;
}
[data-bs-theme="dark"] .status-dot-warning {
    box-shadow: 0 0 8px 3px rgba(255, 193, 7, 0.7) !important;
}

/* Card border glow + hover intensify */
[data-bs-theme="dark"] .card {
    border: 1px solid rgba(13, 110, 253, 0.15) !important;
    box-shadow: 0 0 12px rgba(13, 110, 253, 0.08) !important;
    transition: box-shadow 0.3s ease, border-color 0.3s ease !important;
}
[data-bs-theme="dark"] .card:hover {
    border-color: rgba(13, 110, 253, 0.3) !important;
    box-shadow: 0 0 25px rgba(13, 110, 253, 0.18), 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

/* Source pill glow */
[data-bs-theme="dark"] .source-pill-grid-active {
    box-shadow: 0 0 12px rgba(13, 110, 253, 0.5) !important;
}
[data-bs-theme="dark"] .source-pill-genset-active {
    box-shadow: 0 0 12px rgba(220, 53, 69, 0.5) !important;
}
[data-bs-theme="dark"] .source-pill-solar-active {
    box-shadow: 0 0 12px rgba(255, 193, 7, 0.5) !important;
}

/* KPI large value glow */
[data-bs-theme="dark"] h2.fw-bold,
[data-bs-theme="dark"] h3.fw-bold,
[data-bs-theme="dark"] .display-6 {
    text-shadow: 0 0 12px rgba(13, 110, 253, 0.4) !important;
}

/* Chart SVG glow — makes lines appear to emit light */
[data-bs-theme="dark"] .e-chart svg {
    filter: drop-shadow(0 0 6px rgba(13, 110, 253, 0.25)) !important;
}

/* Badge glow */
[data-bs-theme="dark"] .badge.bg-success {
    box-shadow: 0 0 8px rgba(25, 135, 84, 0.5) !important;
}
[data-bs-theme="dark"] .badge.bg-danger {
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.5) !important;
}
[data-bs-theme="dark"] .badge.bg-warning {
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.5) !important;
}
[data-bs-theme="dark"] .badge.bg-primary {
    box-shadow: 0 0 8px rgba(13, 110, 253, 0.5) !important;
}

/* Active nav link glow */
[data-bs-theme="dark"] .nav-link.active {
    text-shadow: 0 0 8px rgba(13, 110, 253, 0.5) !important;
}

/* ═══════════ Tree device status indicators ═══════════ */

.tree-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.tree-status-dot.device-online {
    background-color: #198754;
    box-shadow: 0 0 6px rgba(25, 135, 84, 0.6);
    animation: blink-green 1.5s ease-in-out infinite;
}

.tree-status-dot.device-offline {
    background-color: #dc3545;
    box-shadow: 0 0 6px rgba(220, 53, 69, 0.6);
    animation: blink-red 1.5s ease-in-out infinite;
}

.tree-status-dot.device-disabled {
    background-color: #6c757d;
}

@keyframes blink-green {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(25, 135, 84, 0.6); }
    50% { opacity: 0.4; box-shadow: 0 0 2px rgba(25, 135, 84, 0.2); }
}

@keyframes blink-red {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(220, 53, 69, 0.6); }
    50% { opacity: 0.4; box-shadow: 0 0 2px rgba(220, 53, 69, 0.2); }
}

/* ═══════════ NavMenu ═══════════ */

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-radius: 0.375rem;
}

/* ═══════════ Monitoring — Device list, status dots & source pills ═══════════ */

.device-list {
    max-height: 300px;
    overflow-y: auto;
}

.device-list .list-group-item {
    border: none;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.15s;
}

.device-list .list-group-item:not(.active):hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot-online {
    background-color: #198754;
    box-shadow: 0 0 4px rgba(25, 135, 84, 0.5);
}

.status-dot-warning {
    background-color: #ffc107;
    box-shadow: 0 0 4px rgba(255, 193, 7, 0.5);
}

.status-dot-offline {
    background-color: #dc3545;
    box-shadow: 0 0 4px rgba(220, 53, 69, 0.5);
}

.status-dot-disabled {
    background-color: #6c757d;
}

.source-pill-grid-active {
    background-color: #0d6efd !important;
    color: #fff !important;
}

.source-pill-genset-active {
    background-color: #dc3545 !important;
    color: #fff !important;
}

.source-pill-solar-active {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.source-pill-dimmed {
    background-color: rgba(108, 117, 125, 0.2) !important;
    color: #6c757d !important;
    opacity: 0.7;
}

.source-pill-inactive {
    background-color: rgba(108, 117, 125, 0.3) !important;
    color: #6c757d !important;
}
