/* Global Styles */
body {
    font-family: 'Segoe UI', 'Microsoft JhengHei', sans-serif;
    overflow-x: hidden;
}

/* Login Page Styles */
.login-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e2e8f0;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

.form-control, .input-group-text {
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.form-control:focus {
    background-color: rgba(15, 23, 42, 0.8);
    border-color: #3b82f6;
    color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

.input-group-text {
    border-right: none;
}
.form-control {
    border-left: none;
}

.btn-primary {
    background: linear-gradient(to right, #3b82f6, #2563eb);
    border: none;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Dashboard Styles */
.dashboard-body {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8fafc;
}

.navbar {
    background-color: #1e293b;
    border-bottom: 1px solid #334155;
    z-index: 1000;
}

.navbar-brand {
    font-weight: 700;
    color: #fff !important;
}

.main-container {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 350px;
    background-color: #fff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 900;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(0);
}

.sidebar.collapsed {
    transform: translateX(-350px);
}

.sidebar-header {
    padding: 15px;
    background-color: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.sidebar-toggler {
    position: absolute;
    top: 10px;
    left: 360px; /* 350px width + 10px gap */
    z-index: 901;
    transition: left 0.3s ease;
}

.sidebar-toggler i {
    transition: transform 0.3s ease;
}

/* Desktop: When sidebar is collapsed, move button to left */
.sidebar.collapsed ~ #sidebarToggler {
    left: 10px;
}

.sidebar.collapsed ~ #sidebarToggler i {
    transform: rotate(180deg);
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
    margin-left: 350px; /* Same as sidebar width */
    transition: margin-left 0.3s ease;
}

.map-container.expanded {
    margin-left: 0;
}

#map {
    height: 100%;
    width: 100%;
}

/* Filter Section Styles */
.filter-section {
    margin-bottom: 20px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.filter-header {
    background-color: #f8fafc;
    padding: 10px 15px;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-body {
    padding: 15px;
}

/* Custom Checkbox/Radio */
.form-check-input:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

/* Status Badges */
.badge-pass {
    background-color: #22c55e;
    color: white;
}
.badge-fail {
    background-color: #ef4444;
    color: white;
}

/* Popup Styles */
.gm-style-iw-d {
    overflow: auto !important;
}

.popup-content {
    min-width: 260px;
    max-width: 340px;
    font-family: 'Segoe UI', sans-serif;
    padding: 15px; /* Increased padding */
}

.popup-content .badge {
    font-size: 0.9em; /* Larger badge text */
    padding: 0.5em 0.8em;
}

.popup-header {
    font-weight: bold;
    font-size: 1.25em; /* Increased from 1.1em */
    margin-bottom: 12px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.popup-row {
    margin-bottom: 8px; /* Increased spacing */
    display: flex;
    justify-content: space-between;
    align-items: center; /* Align vertically */
}

.popup-label {
    color: #64748b;
    font-size: 1.05em; /* Increased from 0.9em */
}

.popup-value {
    font-weight: 500;
    color: #334155;
    font-size: 1.1em; /* Increased size */
}

.popup-el-img {
    width: 100%;
    margin-top: 15px;
    border-radius: 6px;
    border: 1px solid #ddd;
    cursor: pointer;
}

/* Loader */
#loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    background: rgba(255,255,255,0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    display: none;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* Mobile RWD */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .map-container {
        margin-left: 0;
    }
    
    .sidebar-toggler {
        /* Default generic styles for togglers if needed, but specific IDs should take precedence */
    }

    /* Ensure Desktop button is hidden on mobile */
    #sidebarToggler {
        display: none !important;
    }

    /* Configure Mobile Button */
    #mobileSidebarToggler {
        left: 10px !important;
        top: 10px;
    }
}
