/* Device Type Styles */
.device-type-description {
    height: 100px;
}

/* Toast Container */
.toast-container {
    z-index: 1055;
}

/* Verification Code Input Styles */
.verification-code-input {
    text-align: center;
}

.code-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
    max-width: 300px;
}

.code-digit {
    width: 45px;
    height: 55px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: all 0.3s ease;
    outline: none;
}

.code-digit:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    transform: scale(1.05);
}

.code-digit:valid {
    border-color: #28a745;
    background-color: #f8fff9;
}

@media (max-width: 576px) {
    .code-inputs {
        gap: 8px;
    }
    
    .code-digit {
        width: 40px;
        height: 50px;
        font-size: 20px;
    }
}

/* Loading Bar Styles */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #0056b3);
    z-index: 9999;
    transition: width 0.3s ease;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.1);
    z-index: 9998;
    display: none;
}

/* Leaflet Map Styles */
#deviceMap {
    height: 400px;
    width: 100%;
    border-radius: 8px;
    z-index: 1;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.leaflet-popup-content {
    margin: 0;
    padding: 0;
    width: 280px !important;
}

.device-popup {
    padding: 16px;
}

.device-popup .device-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.device-popup .device-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.device-popup .device-info h6 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.device-popup .device-info p {
    margin: 0;
    font-size: 12px;
    color: #6c757d;
}

.device-popup .device-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
}

.device-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.device-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.device-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.device-toggle .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.device-toggle input:checked + .slider {
    background-color: #28a745;
}

.device-toggle input:checked + .slider:before {
    transform: translateX(26px);
}

.leaflet-marker-icon {
    border-radius: 50% !important;
}

.elegant-marker {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    border: 3px solid #fff !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.elegant-marker .marker-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    z-index: 2;
    position: relative;
}

.elegant-marker.on .marker-pulse {
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background-color: #28a745;
    opacity: 0.3;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.1;
    }
    100% {
        transform: scale(1);
        opacity: 0.3;
    }
}

.elegant-marker.on {
    background-color: #28a745 !important;
}

.elegant-marker.off {
    background-color: #6c757d !important;
}

/* Dark Mode Styles */
[data-bs-theme="dark"] .leaflet-popup-content-wrapper {
    background-color: #2d3748 !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .device-popup .device-info p {
    color: #a0aec0 !important;
}

[data-bs-theme="dark"] .device-popup .device-controls {
    border-top-color: #4a5568 !important;
}

[data-bs-theme="dark"] .elegant-marker {
    border-color: #2d3748 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6) !important;
}

/* Select2 Custom Styles */
.select2-container--default .select2-selection--single {
    height: 58px !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.375rem !important;
    padding: 16px 12px !important;
    background-color: var(--bs-body-bg) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 26px !important;
    padding-left: 0 !important;
    color: var(--bs-body-color) !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 56px !important;
    right: 12px !important;
}

.select2-dropdown {
    border: 1px solid #ced4da !important;
    border-radius: 0.375rem !important;
    background-color: var(--bs-body-bg) !important;
}

.select2-container--default .select2-results__option {
    padding: 12px 16px !important;
    color: var(--bs-body-color) !important;
}

.select2-container--default .select2-results__option--highlighted {
    background-color: var(--bs-primary) !important;
    color: white !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #ced4da !important;
    border-radius: 0.375rem !important;
    padding: 8px 12px !important;
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

.select2-container {
    width: 100% !important;
}

/* Avatar Theme Colors */
.avatar.theme-red {
    background-color: rgba(220, 53, 69, 0.1) !important;
    color: #dc3545 !important;
}

.avatar.theme-blue {
    background-color: rgba(13, 110, 253, 0.1) !important;
    color: #0d6efd !important;
}

.avatar.theme-green {
    background-color: rgba(25, 135, 84, 0.1) !important;
    color: #198754 !important;
}

.avatar.theme-orange {
    background-color: rgba(253, 126, 20, 0.1) !important;
    color: #fd7e14 !important;
}

.avatar.theme-purple {
    background-color: rgba(111, 66, 193, 0.1) !important;
    color: #6f42c1 !important;
}

.avatar.theme-cyan {
    background-color: rgba(13, 202, 240, 0.1) !important;
    color: #0dcaf0 !important;
}

.avatar.theme-yellow {
    background-color: rgba(255, 193, 7, 0.1) !important;
    color: #ffc107 !important;
}

.avatar.theme-teal {
    background-color: rgba(32, 201, 151, 0.1) !important;
    color: #20c997 !important;
}

.avatar.theme-grey {
    background-color: rgba(108, 117, 125, 0.1) !important;
    color: #6c757d !important;
}

.avatar.theme-pink {
    background-color: rgba(214, 51, 132, 0.1) !important;
    color: #d63384 !important;
}

.avatar.theme-indigo {
    background-color: rgba(102, 16, 242, 0.1) !important;
    color: #6610f2 !important;
}

.avatar.theme-brown {
    background-color: rgba(121, 85, 72, 0.1) !important;
    color: #795548 !important;
}

.avatar.theme-chocolate {
    background-color: rgba(139, 69, 19, 0.1) !important;
    color: #8b4513 !important;
}

.avatar.theme-black {
    background-color: rgba(33, 37, 41, 0.1) !important;
    color: #212529 !important;
}

/* Device Type Specific Styles */
.device-street-light {
    background-color: rgba(255, 193, 7, 0.1) !important;
    color: #ffc107 !important;
}

.device-sensor {
    background-color: rgba(13, 110, 253, 0.1) !important;
    color: #0d6efd !important;
}

.device-camera {
    background-color: rgba(220, 53, 69, 0.1) !important;
    color: #dc3545 !important;
}

.device-gateway {
    background-color: rgba(25, 135, 84, 0.1) !important;
    color: #198754 !important;
}

.device-controller {
    background-color: rgba(111, 66, 193, 0.1) !important;
    color: #6f42c1 !important;
}

.device-meter {
    background-color: rgba(13, 202, 240, 0.1) !important;
    color: #0dcaf0 !important;
}

.device-switch {
    background-color: rgba(253, 126, 20, 0.1) !important;
    color: #fd7e14 !important;
}

.device-default {
    background-color: rgba(108, 117, 125, 0.1) !important;
    color: #6c757d !important;
}

.device-smart-pole {
    background-color: rgba(32, 201, 151, 0.1) !important;
    color: #20c997 !important;
}

.device-energy-meter {
    background-color: rgba(214, 51, 132, 0.1) !important;
    color: #d63384 !important;
}

.device-weather-station {
    background-color: rgba(102, 16, 242, 0.1) !important;
    color: #6610f2 !important;
}

.device-traffic-light {
    background-color: rgba(121, 85, 72, 0.1) !important;
    color: #795548 !important;
}
