/* eCars User Frontend - Metronic-inspired styles */

:root {
    --bs-primary: #3699FF;
    --bs-success: #50CD89;
    --bs-danger: #F1416C;
    --bs-warning: #FFC700;
    --bs-info: #7239EA;
    --bs-gray-100: #F9F9F9;
    --bs-gray-200: #F4F4F4;
    --bs-gray-300: #E4E6EF;
    --bs-gray-400: #B5B5C3;
    --bs-gray-600: #7E8299;
    --bs-gray-900: #181C32;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bs-gray-100);
    overflow: hidden;
}

/* Navbar styling */
.navbar {
    height: 52px;
    z-index: 1000;
    background: linear-gradient(135deg, #3699FF 0%, #005FC5 100%) !important;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
    padding: 0;
}

.navbar > .container-fluid {
    height: 100%;
    align-items: center;
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

.navbar-brand i {
    font-size: 1.3rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Toggler — no border, bright white bars */
.navbar-toggler {
    border: none !important;
    box-shadow: none !important;
    padding: 0.25rem 0.375rem;
    line-height: 1;
}
.navbar-toggler:focus {
    box-shadow: none !important;
    outline: none;
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255%2C255%2C255%2C1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    width: 1.5em;
    height: 1.5em;
}

.nav-link {
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    padding: 0.4rem 0.85rem !important;
}

.nav-link:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

/* Mobile expanded menu */
@media (max-width: 991.98px) {
    .navbar {
        height: auto;
        min-height: 52px;
    }
    .navbar > .container-fluid {
        flex-wrap: wrap;
        padding-top: 0;
        padding-bottom: 0;
    }
    .navbar-brand,
    .navbar-toggler {
        height: 52px;
        display: flex;
        align-items: center;
    }
    .navbar-collapse {
        border-top: 1px solid rgba(255, 255, 255, 0.18);
        padding: 0.5rem 0 0.75rem;
        width: 100%;
    }
    .navbar-collapse .nav-link {
        padding: 0.6rem 0.75rem !important;
        border-radius: 6px;
        margin: 0.1rem 0.25rem;
        transform: none !important;
        opacity: 1 !important;
    }
    .navbar-collapse .nav-link:hover {
        background: rgba(255, 255, 255, 0.12);
    }
    .navbar-collapse .nav-link.active {
        background: rgba(255, 255, 255, 0.2);
    }
    .nav-divider {
        border-color: rgba(255, 255, 255, 0.18);
        margin: 0.4rem 0.75rem;
        opacity: 1;
    }
    .nav-link-logout {
        color: rgba(255, 200, 200, 0.9) !important;
    }
}

/* Search container */
.search-container {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    z-index: 999;
    box-shadow: 0 0.15rem 0.5rem rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid var(--bs-gray-300);
}

.search-container .input-group {
    box-shadow: 0 0.15rem 0.5rem rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    overflow: hidden;
    background-color: var(--bs-gray-200);
}

.search-container .input-group-text {
    border: none;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    background-color: var(--bs-gray-200);
}

.search-container .form-control {
    border: none;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    background-color: var(--bs-gray-200);
}

.search-container .form-control:focus {
    box-shadow: none;
    background-color: var(--bs-gray-200);
}

/* Filter buttons - pill style */
.btn-group .btn {
    border-radius: 18px !important;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    margin: 0 0.2rem;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.btn-group .btn:first-child {
    margin-left: 0;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

.btn-group .btn.active,
.btn-group .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.15);
}

.btn-outline-secondary {
    background: var(--bs-gray-200);
    color: var(--bs-gray-600);
    border-color: var(--bs-gray-300);
}

.btn-outline-secondary.active {
    background: var(--bs-gray-900);
    color: white;
    border-color: var(--bs-gray-900);
}

.btn-outline-success {
    background: var(--bs-gray-200);
    color: var(--bs-success);
    border-color: var(--bs-success);
}

.btn-outline-success.active {
    background: var(--bs-success);
    color: white;
    border-color: var(--bs-success);
}

.btn-outline-danger {
    background: var(--bs-gray-200);
    color: var(--bs-danger);
    border-color: var(--bs-danger);
}

.btn-outline-danger.active {
    background: var(--bs-danger);
    color: white;
    border-color: var(--bs-danger);
}

.btn-group .badge {
    font-weight: 700;
    font-size: 0.7rem;
    padding: 0.2em 0.45em;
}

/* Map container */
#map {
    position: fixed;
    top: 105px;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 0.5rem 1.5rem 0.5rem rgba(0, 0, 0, 0.075);
}

.leaflet-popup-content {
    margin: 15px;
    font-size: 14px;
}

/* Custom marker icons */
.station-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    font-weight: bold;
}

.marker-available {
    background-color: var(--bs-success);
}

.marker-busy {
    background-color: var(--bs-danger);
}

.marker-offline {
    background-color: var(--bs-gray-400);
}

/* Modal customization */
.modal-content {
    border-radius: 10px;
    border: none;
    box-shadow: 0 0.5rem 1.5rem 0.5rem rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 1rem;
}

.modal-body {
    padding: 1rem;
}

.modal-footer {
    padding: 1rem;
}

/* Station card in modal */
.station-info {
    padding: 0;
}

.station-header {
    padding: 1rem;
    background: linear-gradient(135deg, var(--bs-primary) 0%, #005FC5 100%);
    color: white;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.station-status-badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 6px;
}

.connector-card {
    border: 2px solid var(--bs-gray-300);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.connector-card:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 0.25rem 0.75rem rgba(54, 153, 255, 0.15);
}

.connector-card.available {
    border-color: var(--bs-success);
    background-color: rgba(80, 205, 137, 0.05);
}

.connector-card.busy {
    border-color: var(--bs-danger);
    background-color: rgba(241, 65, 108, 0.05);
}

.connector-card.offline {
    border-color: var(--bs-gray-300);
    background-color: var(--bs-gray-100);
    opacity: 0.7;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

/* Button styling (Metronic-inspired) */
.btn {
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--bs-primary) 0%, #005FC5 100%);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.75rem rgba(54, 153, 255, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--bs-success) 0%, #47BE7D 100%);
    border: none;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.75rem rgba(80, 205, 137, 0.3);
}

/* Info labels */
.info-label {
    font-size: 0.75rem;
    color: var(--bs-gray-600);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 1rem;
    color: var(--bs-gray-900);
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .search-container {
        top: 52px;
    }

    #map {
        top: 120px;
    }

    .navbar-brand {
        font-size: 0.95rem;
    }

    .navbar-brand i {
        font-size: 1.1rem;
    }

    .btn-group .btn {
        padding: 0.35rem 0.5rem;
    }

    .search-container .form-control {
        font-size: 0.85rem;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--bs-gray-200);
}

::-webkit-scrollbar-thumb {
    background: var(--bs-gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-600);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}
