/* style.css - Bản đồ số Bến Thành (Smart Ben Thanh Civic Portal) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette - Civic Modern */
    --primary: #0F4C81;
    --primary-light: #1A69B2;
    --primary-dark: #093156;
    --accent: #E3A857;
    --accent-hover: #D49640;
    --emerald: #00875A;
    --emerald-light: #E3FCEF;
    --danger: #DE350B;
    --danger-light: #FFEBE6;
    --warning: #FF991F;
    --info: #0065FF;
    
    /* Light Theme Surfaces */
    --bg-main: #F4F6F9;
    --bg-surface: rgba(255, 255, 255, 0.94);
    --bg-surface-elevated: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --text-primary: #172B4D;
    --text-secondary: #5E6C84;
    --text-tertiary: #8993A4;
    --border-subtle: rgba(9, 30, 66, 0.08);
    --border-strong: rgba(9, 30, 66, 0.16);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(15, 76, 129, 0.2);

    /* UI Measurements */
    --header-height: 64px;
    --sidebar-width: 400px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-main: #080D1A;
    --bg-surface: rgba(14, 23, 42, 0.92);
    --bg-surface-elevated: #111C33;
    --bg-glass: rgba(14, 23, 42, 0.85);
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-tertiary: #64748B;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(26, 105, 178, 0.35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
}

/* ==================================================== */
/* TOP NAVIGATION HEADER                                */
/* ==================================================== */
.app-header {
    height: var(--header-height);
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.brand-logo-wrap {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary) 0%, #002244 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFF;
    box-shadow: 0 4px 10px rgba(15, 76, 129, 0.3);
    position: relative;
    overflow: hidden;
}

.brand-logo-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    100% { left: 100%; }
}

.brand-title {
    display: flex;
    flex-direction: column;
}

.brand-title h1 {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--primary);
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 6px;
}

[data-theme="dark"] .brand-title h1 {
    color: #60A5FA;
}

.brand-tag {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--accent);
    color: #111;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.brand-title span {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Header Middle: Quick Stats / Search Preview */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-header {
    height: 38px;
    padding: 0 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-header:hover {
    background: var(--border-subtle);
    transform: translateY(-1px);
}

.btn-header.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #FFFFFF;
    border: none;
    box-shadow: 0 3px 10px rgba(15, 76, 129, 0.25);
}

.btn-header.btn-primary:hover {
    box-shadow: 0 5px 14px rgba(15, 76, 129, 0.4);
}

.btn-header.btn-danger {
    background: var(--danger-light);
    color: var(--danger);
    border-color: rgba(222, 53, 11, 0.2);
}

.btn-header.btn-danger:hover {
    background: var(--danger);
    color: #FFF;
}

.btn-icon-only {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius-full);
}

/* ==================================================== */
/* MAIN APP WRAPPER                                     */
/* ==================================================== */
.app-container {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

/* ==================================================== */
/* SIDEBAR (SEARCH, LIST, STATS)                        */
/* ==================================================== */
.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 500;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-md);
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Search Box */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 44px;
    padding: 0 40px 0 42px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-strong);
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.15);
}

.search-clear {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    display: none;
    padding: 4px;
}

.search-input:not(:placeholder-shown) + .search-clear {
    display: flex;
}

/* Category Filter Bar in Sidebar */
.category-filter-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.category-filter-scroll::-webkit-scrollbar {
    display: none;
}

.category-chip {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    user-select: none;
}

.category-chip:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.category-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(15, 76, 129, 0.25);
}

/* Sidebar Stats & Count */
.sidebar-sub-bar {
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(0,0,0,0.02);
    border-bottom: 1px solid var(--border-subtle);
}

.place-counter {
    font-weight: 700;
    color: var(--primary);
}

[data-theme="dark"] .place-counter {
    color: #60A5FA;
}

.filter-active-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Places List */
.places-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
}

.place-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    gap: 12px;
    position: relative;
}

.place-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.place-card.active {
    border-color: var(--primary);
    background: rgba(15, 76, 129, 0.04);
    box-shadow: 0 0 0 2px var(--primary);
}

.place-card-thumb {
    width: 78px;
    height: 78px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: #E2E8F0;
}

.place-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.place-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
}

.place-category-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-red { background: #FFEBE6; color: #BF2600; }
.badge-pink { background: #FCE8E6; color: #C2185B; }
.badge-teal { background: #E6FCF5; color: #00897B; }
.badge-purple { background: #F3E8FD; color: #7B1FA2; }
.badge-orange { background: #FFF0B3; color: #B76E00; }
.badge-green { background: #E3FCEF; color: #006644; }
.badge-blue { background: #DEEBFF; color: #0747A6; }
.badge-amber { background: #FFF4E5; color: #D97706; }

[data-theme="dark"] .badge-red { background: rgba(191,38,0,0.25); color: #FF8F73; }
[data-theme="dark"] .badge-pink { background: rgba(194,24,91,0.25); color: #F48FB1; }
[data-theme="dark"] .badge-teal { background: rgba(0,137,123,0.25); color: #4DB6AC; }
[data-theme="dark"] .badge-purple { background: rgba(123,31,162,0.25); color: #BA68C8; }
[data-theme="dark"] .badge-orange { background: rgba(183,110,0,0.25); color: #FFC400; }
[data-theme="dark"] .badge-green { background: rgba(0,102,68,0.25); color: #57D9A3; }
[data-theme="dark"] .badge-blue { background: rgba(7,71,166,0.25); color: #79F2C0; }
[data-theme="dark"] .badge-amber { background: rgba(217,119,6,0.25); color: #FCD34D; }

.place-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 3px 0 2px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.place-card-addr {
    font-size: 0.74rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

.place-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--border-subtle);
    font-size: 0.72rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.status-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.status-open .status-indicator {
    background: #36B37E;
    box-shadow: 0 0 0 2px rgba(54, 179, 126, 0.2);
}
.status-open { color: #006644; }
[data-theme="dark"] .status-open { color: #57D9A3; }

.status-closed .status-indicator {
    background: #FF5630;
}
.status-closed { color: #BF2600; }
[data-theme="dark"] .status-closed { color: #FF8F73; }

.distance-tag {
    color: var(--text-tertiary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ==================================================== */
/* MAP VIEW & FLOATING CONTROLS                         */
/* ==================================================== */
.map-container-wrap {
    flex: 1;
    position: relative;
    height: 100%;
}

#map {
    width: 100%;
    height: 100%;
    background: #E5E9F0;
    z-index: 1;
}

/* Floating Quick Filter Bar on Top of Map */
.map-floating-filters {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 400;
    display: flex;
    gap: 8px;
    pointer-events: none;
}

.filter-glass-pill {
    pointer-events: auto;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-glass-pill:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.filter-glass-pill.active {
    background: var(--primary);
    color: #FFF;
    border-color: var(--primary);
}

/* Floating Map Right Controls */
.map-controls-right {
    position: absolute;
    right: 16px;
    top: 80px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-control-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: var(--transition);
}

.map-control-btn:hover {
    background: var(--bg-surface-elevated);
    color: var(--primary);
    transform: scale(1.05);
}

.map-control-btn.active {
    background: var(--primary);
    color: #FFF;
}

/* ==================================================== */
/* DETAIL SLIDE-OVER DRAWER                             */
/* ==================================================== */
.detail-drawer {
    position: absolute;
    top: 16px;
    bottom: 16px;
    right: 16px;
    width: 420px;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-strong);
    z-index: 600;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(calc(100% + 24px));
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-drawer.open {
    transform: translateX(0);
}

.detail-hero {
    position: relative;
    height: 200px;
    width: 100%;
    flex-shrink: 0;
    background: #111;
}

.detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.7) 100%);
}

.detail-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: #FFF;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: var(--transition);
    z-index: 10;
}

.detail-close-btn:hover {
    background: rgba(0,0,0,0.8);
    transform: scale(1.1);
}

.detail-hero-content {
    position: absolute;
    bottom: 14px;
    left: 16px;
    right: 16px;
    color: #FFF;
}

.detail-hero-cat {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--accent);
    color: #111;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 6px;
}

.detail-hero-title {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

/* Detail Primary Quick Action Buttons (Yêu cầu đề bài) */
.detail-actions-bar {
    padding: 14px 16px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.action-btn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 4px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.action-btn-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.action-btn-item.call {
    background: #E3FCEF;
    color: #006644;
    border-color: rgba(0, 135, 90, 0.3);
}
.action-btn-item.call:hover {
    background: #00875A;
    color: #FFF;
}

.action-btn-item.directions {
    background: #DEEBFF;
    color: #0747A6;
    border-color: rgba(15, 76, 129, 0.3);
}
.action-btn-item.directions:hover {
    background: var(--primary);
    color: #FFF;
}

.action-btn-item.web {
    background: #F4F5F7;
    color: var(--text-primary);
}
.action-btn-item.web:hover {
    background: #E2E8F0;
}

.action-btn-item.qr {
    background: #FFF0B3;
    color: #8F4B00;
    border-color: rgba(227, 168, 87, 0.4);
}
.action-btn-item.qr:hover {
    background: var(--accent);
    color: #111;
}

/* Detail Scrollable Content */
.detail-content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
}

.info-block {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

[data-theme="dark"] .info-block {
    background: rgba(255, 255, 255, 0.03);
}

.info-icon-box {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(15, 76, 129, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

[data-theme="dark"] .info-icon-box {
    background: rgba(96, 165, 250, 0.15);
    color: #60A5FA;
}

.info-text-group {
    flex: 1;
}

.info-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 2px;
}

.info-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.info-copy-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.detail-section-title {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.services-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.service-tag-item {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.service-tag-item::before {
    content: '•';
    color: var(--primary);
    font-weight: 800;
}

.detail-desc-text {
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ==================================================== */
/* MODALS (QR CODE, QR SCANNER, EMERGENCY)              */
/* ==================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: var(--bg-surface-elevated);
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-strong);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    display: flex;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* QR Code Card Display */
.qr-display-card {
    background: #FFFFFF;
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

#qrCanvas {
    width: 220px !important;
    height: 220px !important;
}

.qr-caption-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0F172A;
    text-align: center;
}

.qr-caption-sub {
    font-size: 0.75rem;
    color: #64748B;
    text-align: center;
}

.qr-actions-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.qr-actions-row button {
    flex: 1;
    height: 42px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}

/* QR Scanner View */
.scanner-viewport-wrap {
    width: 100%;
    height: 280px;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    background: #000;
}

#scannerVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-reticle {
    position: absolute;
    inset: 40px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.scanner-reticle::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #00E676;
    box-shadow: 0 0 8px #00E676;
    animation: scanAnim 2s infinite ease-in-out;
}

@keyframes scanAnim {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

/* Preset Demo QR Buttons for Fast Testing */
.scanner-presets-box {
    width: 100%;
    background: rgba(0,0,0,0.03);
    padding: 12px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scanner-presets-box p {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.presets-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.preset-chip-btn {
    font-size: 0.74rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-strong);
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.preset-chip-btn:hover {
    background: var(--primary);
    color: #FFF;
    border-color: var(--primary);
}

/* Emergency Hotlines Modal */
.emergency-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
}

.emergency-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    transition: var(--transition);
}

.emergency-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.emergency-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.emergency-number-tag {
    font-size: 1.3rem;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    color: #FFF;
    min-width: 75px;
    text-align: center;
}

.emergency-call-btn {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    background: var(--emerald);
    color: #FFF;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.emergency-call-btn:hover {
    background: #006644;
    transform: scale(1.05);
}

/* ==================================================== */
/* LEAFLET CUSTOM MARKER STYLING                        */
/* ==================================================== */
.custom-map-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-map-pin:hover {
    transform: scale(1.25) translateY(-4px);
    z-index: 9999 !important;
}

.custom-map-pin.active-pin {
    transform: scale(1.3) translateY(-6px);
    z-index: 10000 !important;
}

.pin-bubble {
    width: 38px;
    height: 38px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    border: 2px solid #FFFFFF;
    position: relative;
}

.pin-bubble svg {
    transform: rotate(45deg);
    color: #FFFFFF;
}

.user-gps-pulse {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0065FF;
    border: 3px solid #FFF;
    box-shadow: 0 0 0 4px rgba(0, 101, 255, 0.4);
    animation: pulseUser 2s infinite;
}

@keyframes pulseUser {
    0% { box-shadow: 0 0 0 0 rgba(0, 101, 255, 0.6); }
    70% { box-shadow: 0 0 0 16px rgba(0, 101, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 101, 255, 0); }
}

/* ==================================================== */
/* RESPONSIVE DESIGN (MOBILE & TABLET)                  */
/* ==================================================== */
@media (max-width: 900px) {
    .sidebar {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 60vh;
        max-height: 60vh;
        border-radius: 20px 20px 0 0;
        border-right: none;
        border-top: 1px solid var(--border-strong);
        transform: translateY(calc(100% - 70px));
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .sidebar.expanded {
        transform: translateY(0);
    }

    .sidebar-handle-bar {
        display: block;
        width: 40px;
        height: 4px;
        border-radius: 2px;
        background: var(--text-tertiary);
        margin: 8px auto 4px auto;
        cursor: grab;
    }

    .detail-drawer {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 75vh;
        max-height: 75vh;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
    }

    .detail-drawer.open {
        transform: translateY(0);
    }

    .brand-title span {
        display: none;
    }

    .btn-header span {
        display: none;
    }

    .btn-header {
        padding: 0 10px;
    }
}
