/* ========================================
   BATTERY HISTORY GRAPH DIALOGS (BatteryHistoryGraph.razor)
   Scoped to the three dialogs so generic names (.dialog-header, .modal-footer, .detail-row, ...) no longer leak.
   ======================================== */

/* ---------- Shared/BatteryHistoryGraph.razor ---------- */
/* Event Details Modal - Compact and Scrollable */
.event-details-modal .lbsa-mobile-dialog-content {
    padding: 0 !important;
    overflow: hidden !important;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-details-scrollable {
    max-height: calc(80vh - 120px); /* Subtract header and footer height */
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 16px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-details-content .detail-section {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.1);
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-details-content .detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-details-content h5 {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-details-content .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-details-content .detail-row label {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    min-width: 140px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-details-content .detail-row span {
    color: rgba(255, 255, 255, 0.9);
    text-align: right;
    flex: 1;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-details-content .detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-details-content .detail-grid .detail-row {
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 2px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-details-content .detail-grid .detail-row label {
    min-width: unset;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-details-content .detail-grid .detail-row span {
    text-align: left;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .loading-log-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 10px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .modal-header-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-primary);
    font-size: 16px;
    font-weight: 500;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-items-virtualized {
    height: 280px;
    overflow-y: auto;
    padding-right: 3px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-row-chevron {
    color: rgba(255, 255, 255, .32);
    font-size: .7rem;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .history-event-skeleton-row {
    height: 39px;
    margin-bottom: 4px;
    border-radius: 7px;
    background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.08), rgba(255,255,255,.03));
    background-size: 200% 100%;
    animation: history-event-shimmer 1.3s infinite;
}

@keyframes history-event-shimmer { to { background-position: -200% 0; } }

.history-graph-module-modal {
    background: #151a21 !important;
    border: 1px solid rgba(var(--color-primary-rgb), .28) !important;
    border-radius: 14px !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .55) !important;
    overflow: hidden;
}

.history-graph-module-modal .lbsa-mobile-dialog-content { min-height: 0; overflow: hidden; }
.history-graph-module-modal .module-modal-content { height: 100% !important; min-height: 0; }
.history-graph-module-modal .module-data-grid-container { flex: 1; min-height: 0; }
:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .modal-header-custom span { display: flex; flex-direction: column; min-width: 0; }
:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .modal-header-custom small { color: rgba(255,255,255,.55); font-size: .7rem; font-weight: 400; }
:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-module-mobile-cards { display: none; }

@media (max-width: 768px) {
    .event-details-modal,
.history-graph-module-modal {
        width: 100vw !important;
        height: 100dvh !important;
        max-width: none !important;
        max-height: none !important;
        border: 0 !important;
        border-radius: 0 !important;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-details-scrollable { max-height: none; height: 100%; padding: 10px; }
    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-details-content .detail-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
    .history-graph-module-modal .module-data-grid-container { display: none !important; }
    .history-graph-module-modal .module-modal-content { overflow-y: auto; padding: 8px !important; }
    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-module-mobile-cards { display: grid; gap: 10px; }
    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-module-mobile-card { overflow: hidden; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; background: rgba(255,255,255,.025); }
    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-module-mobile-header { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px 10px; padding: 9px; background: rgba(var(--color-primary-rgb), .07); font-size: .72rem; }
    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-module-mobile-header strong { color: #5ee7f2; }
    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-cell-mobile-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; background: rgba(255,255,255,.06); }
    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-cell-mobile { display: grid; grid-template-columns: 1fr auto; align-items: baseline; padding: 9px 7px; background: #171d24; }
    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-cell-mobile span { grid-column: 1 / -1; color: rgba(255,255,255,.45); font-size: .62rem; }
    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-cell-mobile strong { font-size: .8rem; }
    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-cell-mobile small { color: rgba(255,255,255,.42); font-size: .55rem; }
    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-cell-mobile.cell-low strong { color: #f4c65d; }
    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-cell-mobile.cell-high strong { color: #5ee7f2; }
}

.battery-history-dialog {
    background: rgba(18, 18, 18, 0.98) !important;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .dialog-header {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 36px;
    padding: 0;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .dialog-title {
    color: var(--color-primary);
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 1px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .history-graph-container {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    position: relative;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-timezone-note {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 10px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-controls .e-dropdown {
    background: rgba(var(--color-primary-rgb), 0.05);
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
    color: rgba(255, 255, 255, 0.9);
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-action-btn {
    background: transparent !important;
    border: 1px solid rgba(var(--color-primary-rgb), 0.3) !important;
    color: var(--color-primary) !important;
    min-width: 38px !important;
    width: 38px;
    height: 38px;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-action-btn:hover {
    background: rgba(var(--color-primary-rgb), 0.1) !important;
    border-color: rgba(var(--color-primary-rgb), 0.5) !important;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-action-spinner {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(var(--color-primary-rgb), 0.3);
    border-radius: 4px;
    background: transparent;
    box-sizing: border-box;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .button-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(var(--color-primary-rgb), 0.18);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: button-spin 0.8s linear infinite;
}

@keyframes button-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .history-loading-skeleton {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .history-chart-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .history-chart-skeleton-key {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .history-chart-skeleton-block {
    border-radius: 6px;
    overflow: hidden;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .history-statistics-skeleton h4 {
    margin-bottom: 1rem;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .history-stat-skeleton-item {
    gap: 0.45rem;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .history-events-skeleton h4 {
    margin-bottom: 0.9rem;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .history-event-skeleton-item {
    align-items: center;
    cursor: default;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .chart-wrapper {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(var(--color-primary-rgb), 0.1);
    border-radius: 4px;
    margin-bottom: 20px;
    padding: 10px;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .history-range-navigator {
    margin-top: 12px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .chart-axis-key {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 8px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .axis-key-item {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .axis-key-primary {
    color: var(--color-primary);
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .axis-key-voltage {
    color: var(--color-success);
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .axis-key-delta {
    color: #ffd54f;
}

/* Ensure chart tooltip renders above all other elements including dialogs */
/* Ensure the LbsaChart doesn't clip its tooltip */
:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .statistics-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(var(--color-primary-rgb), 0.1);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .statistics-panel h4 {
    color: var(--color-primary);
    margin: 0 0 15px 0;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .stat-item {
    display: flex;
    flex-direction: column;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .stat-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .stat-value {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 400;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-list {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(var(--color-primary-rgb), 0.1);
    border-radius: 4px;
    padding: 15px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-list h4 {
    color: var(--color-primary);
    margin: 0 0 15px 0;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-list-header h4 {
    margin-bottom: 0;
    min-width: 0;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-list-caption {
    font-size: 11px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.5);
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-page-loading,
:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-page-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 90px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 13px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-item {
    display: flex;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid rgba(var(--color-primary-rgb), 0.3);
    font-size: 13px;
    align-items: center;
    transition: all 0.2s ease;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-item.clickable {
    cursor: pointer;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-item.clickable:hover {
    background: rgba(var(--color-primary-rgb), 0.08);
    border-left-color: var(--color-primary);
    transform: translateX(2px);
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-icon {
    width: 20px;
    text-align: center;
    color: var(--color-primary);
    font-size: 14px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-item.marker-error {
    border-left-color: var(--color-danger);
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-item.marker-warning {
    border-left-color: var(--color-warning);
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-time {
    color: rgba(255, 255, 255, 0.5);
    min-width: 70px;
    margin-right: 15px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-desc {
    color: rgba(255, 255, 255, 0.9);
    flex: 1;
    font-weight: 400;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-indicator {
    color: var(--color-primary);
    font-size: 14px;
    opacity: 0.7;
    margin-left: auto;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-item.clickable:hover .event-indicator {
    opacity: 1;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(var(--color-primary-rgb), 0.2);
    border: 2px solid var(--color-primary);
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-marker.marker-error {
    background: rgba(var(--color-danger-rgb), 0.2);
    border-color: var(--color-danger);
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-marker.marker-warning {
    background: rgba(var(--color-warning-rgb), 0.2);
    border-color: var(--color-warning);
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .marker-icon {
    font-size: 14px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: rgba(255, 255, 255, 0.5);
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .no-data i {
    font-size: 48px;
    color: rgba(var(--color-primary-rgb), 0.3);
    margin-bottom: 20px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .data-extended-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
    background: rgba(var(--color-success-rgb), 0.1);
    border: 1px solid rgba(var(--color-success-rgb), 0.3);
    border-radius: 4px;
    color: rgba(var(--color-success-rgb), 0.9);
    font-size: 13px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .data-extended-note i {
    font-size: 16px;
}

/* Event Details Modal */
:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-details-content {
    padding: 20px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.1);
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .detail-row:last-child {
    border-bottom: none;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .detail-row label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 300;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .detail-row span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .severity-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .severity-info {
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    border: 1px solid rgba(var(--color-primary-rgb), 0.3);
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .severity-warning {
    background: rgba(var(--color-warning-rgb), 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(var(--color-warning-rgb), 0.3);
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .severity-error {
    background: rgba(var(--color-danger-rgb), 0.1);
    color: var(--color-danger);
    border: 1px solid rgba(var(--color-danger-rgb), 0.3);
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .modal-header-custom {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-primary);
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 1px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid rgba(var(--color-primary-rgb), 0.2);
}

/* Event Details Sections */
:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .detail-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.1);
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .detail-section:last-child {
    border-bottom: none;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .detail-section h5 {
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .loading-log-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 15px;
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .loading-log-details p {
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Module Modal */
:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .module-summary {
    padding: 15px 20px;
    border-top: 1px solid rgba(var(--color-primary-rgb), 0.2);
}

:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .module-data-grid-container .e-grid {
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
}

@media (max-width: 768px) {
    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .dialog-header {
        min-height: 30px;
        padding: 0;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .dialog-title {
        font-size: 14px;
        letter-spacing: 0.35px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .history-graph-container {
        padding: 8px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-controls {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 6px;
        margin-bottom: 10px;
        align-items: center;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-controls .e-dropdown {
        width: 100%;
        min-width: 0;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-controls > span:not(.graph-timezone-note),
:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-controls > .graph-action-spinner {
        display: inline-flex;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-timezone-note {
        grid-column: 1 / -1;
        margin-left: 0;
        font-size: 9px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-action-btn {
        min-width: 30px !important;
        width: 30px;
        height: 30px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .graph-action-spinner {
        width: 30px;
        height: 30px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .button-spinner {
        width: 14px;
        height: 14px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .chart-wrapper {
        padding: 2px;
        margin-bottom: 8px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .chart-axis-key {
        gap: 6px;
        margin-bottom: 6px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .axis-key-item {
        padding: 2px 6px;
        font-size: 9px;
        letter-spacing: 0.3px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .statistics-panel,
:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-list {
        padding: 10px;
        margin-bottom: 10px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .statistics-panel h4,
:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-list h4 {
        margin-bottom: 10px;
        font-size: 12px;
        letter-spacing: 0.65px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-list-caption {
        font-size: 9px;
        display: inline-block;
        margin-top: 3px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-list-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .stat-label {
        font-size: 10px;
        letter-spacing: 0.55px;
        margin-bottom: 3px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .stat-value {
        font-size: 13px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-items {
        gap: 6px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-item {
        gap: 7px;
        padding: 6px 8px;
        font-size: 11px;
        align-items: flex-start;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-icon,
:where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-indicator {
        font-size: 12px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-time {
        min-width: 56px;
        margin-right: 6px;
        font-size: 10px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .data-extended-note {
        gap: 6px;
        padding: 6px 8px;
        margin-bottom: 8px;
        font-size: 11px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .data-extended-note i {
        font-size: 13px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .event-details-content {
        padding: 12px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .detail-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .detail-row {
        gap: 8px;
        padding: 8px 0;
        align-items: flex-start;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .detail-row label {
        font-size: 11px;
        letter-spacing: 0.45px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .detail-row span {
        font-size: 12px;
        text-align: right;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .detail-section {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .detail-section h5 {
        font-size: 12px;
        margin-bottom: 8px;
    }

    :where(.battery-history-dialog, .event-details-modal, .history-graph-module-modal) .module-summary {
        padding: 10px 12px;
    }

}

