/* BMS Monitor Custom Styles */

/* Device Markers on Map */
.device-marker-container {
    background: transparent;
    border: none;
}

.device-marker {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    border: 2px solid white;
}

.device-marker-green {
    background-color: #48c78e;
}

.device-marker-orange {
    background-color: #ffdd57;
    color: #333;
}

.device-marker-red {
    background-color: #f14668;
}

.device-marker-gray {
    background-color: #7a7a7a;
}

/* Device List Item */
.device-list-item {
    padding: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #eee;
}

.device-list-item:hover {
    background-color: #f5f5f5;
}

.device-list-item.is-selected {
    background-color: #e8f4fd;
    border-left: 3px solid #3298dc;
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-container .notification {
    pointer-events: auto;
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
}

.toast-container .notification.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

.toast {
    animation: slideInRight 0.3s ease-out;
}

.toast.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

/* Toast Notifications (legacy) */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Table Improvements */
.table td, .table th {
    vertical-align: middle;
}

/* Slider Input */
input[type="range"].slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: #dbdbdb;
    border-radius: 3px;
    outline: none;
}

input[type="range"].slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #3298dc;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"].slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #3298dc;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Cell Voltage Progress Bars */
.cell-voltages .progress,
.temperatures .progress {
    margin-bottom: 0;
}

/* Border Bottom Helper */
.border-bottom {
    border-bottom: 1px solid #eee;
}

/* Map Popup Styles */
.device-popup {
    min-width: 200px;
}

.device-popup .title {
    margin-bottom: 0.5rem;
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    margin: 12px;
}

/* Status Cards */
.box .level-item .title {
    margin-bottom: 0;
}

/* Fix for dark navbar dropdown */
.navbar-dropdown {
    background-color: white;
}

.navbar-dropdown .navbar-item {
    color: #4a4a4a;
}

.navbar-dropdown .navbar-item:hover {
    background-color: #f5f5f5;
}

/* Loading states */
.is-loading-content {
    opacity: 0.5;
    pointer-events: none;
}

/* Mobile Responsive Adjustments */
@media screen and (max-width: 768px) {
    .section {
        padding: 1rem;
    }

    .columns.is-mobile-reversed {
        flex-direction: column-reverse;
        display: flex;
    }

    #map {
        height: 300px !important;
    }

    .notification-toast {
        left: 10px;
        right: 10px;
        min-width: auto;
    }
}

/* Status indicator animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(72, 199, 142, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(72, 199, 142, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(72, 199, 142, 0);
    }
}

.status-online {
    animation: pulse 2s infinite;
}

/* Alert severity colors in tables */
tr.alert-critical {
    background-color: #fff5f5;
}

tr.alert-warning {
    background-color: #fffbeb;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Full-height layout helpers */
.is-fullheight-with-navbar {
    min-height: calc(100vh - 52px);
}

/* Box shadows */
.box {
    box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.1);
}

.box:hover {
    box-shadow: 0 4px 8px rgba(10, 10, 10, 0.15), 0 0 0 1px rgba(10, 10, 10, 0.1);
}

/* Device Detail Panel */
#device-details .table {
    font-size: 0.9rem;
}

#device-details .table td:first-child {
    width: 40%;
    color: #7a7a7a;
}
