/* Map Page Styles */
#map-container {
    width: 100%;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 23, 42, 0.9);
    color: #f8fafc;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    z-index: 999;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-offline-banner {
    display: none;
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 90%;
    max-width: 400px;
    background-color: rgba(239, 68, 68, 0.95);
    color: #fff;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
}

.map-offline-banner.visible {
    display: block;
}

.map-popup-card {
    text-align: center;
    padding: 6px 4px;
    min-width: 180px;
}

.map-popup-title {
    margin: 0 0 4px 0;
    font-weight: 700;
    color: #0f172a;
    font-size: 0.95rem;
}

.map-popup-address {
    margin: 0 0 8px 0;
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.3;
}

.map-popup-badges {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.map-popup-badge-avail {
    background: #e0e7ff;
    color: #4f46e5;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
}

.map-popup-badge-online {
    background: #dcfce7;
    color: #16a34a;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
}

.map-popup-badge-offline {
    background: #fee2e2;
    color: #ef4444;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
}

.map-popup-btn-scan {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff !important;
    border: none;
    padding: 9px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
    transition: transform 0.15s ease;
}

.map-popup-btn-scan:hover {
    transform: translateY(-1px);
}

.map-popup-btn-offline {
    background: #94a3b8;
    color: #ffffff;
    border: none;
    padding: 9px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: not-allowed;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.map-popup-hint {
    margin: 6px 0 0 0;
    font-size: 0.72rem;
    color: #94a3b8;
}

.user-loc-dot {
    background: #2563eb;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.3), 0 4px 6px rgba(0,0,0,0.2);
    border: 3px solid white;
}

.user-loc-popup {
    text-align: center;
    font-weight: 600;
}

.station-marker-pin {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border: 2px solid white;
}

.station-marker-pin.online {
    background: #10b981;
}

.station-marker-pin.offline {
    background: #94a3b8;
}

.station-marker-pin i {
    color: white;
    font-size: 1.2rem;
}

/* ========================================================== */
/* Scanner Overlay Styles (Consistent Dark Glassmorphism)     */
/* ========================================================== */

#scanner-overlay,
.scanner-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.98) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    z-index: 9999 !important;
    display: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    color: #f8fafc !important;
    overflow-y: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

#scanner-overlay.active,
.scanner-overlay.active {
    display: flex !important;
}

.scanner-header-new {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 16px 24px !important;
    width: 100% !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(15, 23, 42, 0.9) !important;
    box-sizing: border-box !important;
}

.scanner-header-new .brand {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    height: auto !important;
    min-height: 40px !important;
}

.scanner-header-new .brand img,
.scanner-header-new .brand .brand-logo-img {
    height: 40px !important;
    max-height: 42px !important;
    max-width: 170px !important;
    width: auto !important;
    object-fit: contain !important;
    display: block !important;
}

.scanner-header-new .brand .bi {
    font-size: 1.4rem !important;
    color: #3b82f6 !important;
}

.scanner-header-new .brand-text {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #f8fafc !important;
}

.scanner-header-new .close-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #f8fafc !important;
    font-size: 1.2rem !important;
    cursor: pointer !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    line-height: 1 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}

.scanner-header-new .close-btn:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #ef4444 !important;
    transform: scale(1.05) !important;
}

.scanner-content-new {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 24px 20px 32px !important;
    text-align: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.scanner-title {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #f8fafc !important;
    margin: 4px 0 8px 0 !important;
    letter-spacing: -0.3px !important;
}

.scanner-subtitle {
    font-size: 0.92rem !important;
    color: #94a3b8 !important;
    margin-bottom: 24px !important;
    max-width: 360px !important;
    line-height: 1.45 !important;
}

.scanner-camera-wrapper {
    position: relative !important;
    width: 280px !important;
    height: 280px !important;
    max-width: 80vw !important;
    max-height: 80vw !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    margin: 0 auto 24px auto !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.12) !important;
    background: #020617 !important;
}

.scanner-camera-wrapper #reader {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.scanner-camera-wrapper #reader video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.viewfinder-bracket {
    position: absolute !important;
    width: 36px !important;
    height: 36px !important;
    border: 3.5px solid #3b82f6 !important;
    z-index: 10 !important;
    pointer-events: none !important;
}

.bracket-tl { top: 14px; left: 14px; border-right: none !important; border-bottom: none !important; border-top-left-radius: 12px; }
.bracket-tr { top: 14px; right: 14px; border-left: none !important; border-bottom: none !important; border-top-right-radius: 12px; }
.bracket-bl { bottom: 14px; left: 14px; border-right: none !important; border-top: none !important; border-bottom-left-radius: 12px; }
.bracket-br { bottom: 14px; right: 14px; border-left: none !important; border-top: none !important; border-bottom-right-radius: 12px; }

.scanner-cancel-btn {
    margin-top: auto !important;
    margin-bottom: 16px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #f8fafc !important;
    padding: 12px 28px !important;
    border-radius: 100px !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.2s ease !important;
    backdrop-filter: blur(8px) !important;
    text-decoration: none !important;
}

.scanner-cancel-btn:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    color: #fca5a5 !important;
    transform: translateY(-1px) !important;
}

.scanner-footer-text {
    font-size: 0.78rem !important;
    color: #64748b !important;
    text-align: center !important;
    margin-bottom: 8px !important;
    padding: 0 10px !important;
}

.scanner-developer-credit {
    font-size: 0.72rem !important;
    color: #64748b !important;
    text-align: center !important;
    position: relative !important;
    z-index: 10 !important;
}

.scanner-developer-credit a,
.scanner-dev-link {
    color: #94a3b8 !important;
    text-decoration: underline !important;
    transition: color 0.2s ease !important;
}

.scanner-developer-credit a:hover,
.scanner-dev-link:hover {
    color: #cbd5e1 !important;
}
