/* ========================================
   Nöbetçi Eczane - Mobile-First CSS
   ======================================== */

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #00E676; /* Vivid Emerald */
    --primary-light: #69F0AE;
    --primary-dark: #00B259;
    --primary-glow: rgba(0, 230, 118, 0.35);

    --bg-dark: #070B14; /* Deeper navy/black */
    --bg-card: #121929; /* Slightly elevated card color */
    --bg-card-hover: #19233A;
    --bg-glass: rgba(18, 25, 41, 0.75);

    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 24px var(--primary-glow);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    --header-height: 60px;
    --sheet-peek: 160px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html,
body {
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, h5, h6, .header-title {
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-glow);
}

.header-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-location {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--primary-light);
    font-size: 12px;
    font-weight: 500;
    background: rgba(0, 200, 83, 0.1);
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid rgba(0, 200, 83, 0.15);
    max-width: 160px;
    overflow: hidden;
    cursor: pointer;
}

.header-location svg {
    flex-shrink: 0;
}

.header-location span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Map --- */
#map {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Dark map tiles */
.leaflet-tile-pane {
    filter: brightness(0.85) contrast(1.05) saturate(0.9);
}

.leaflet-control-zoom {
    border: none !important;
    box-shadow: var(--shadow-md) !important;
}

.leaflet-control-zoom a {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 18px !important;
}

.leaflet-control-zoom a:hover {
    background: var(--bg-card-hover) !important;
}

/* Custom Pharmacy Marker */
.pharmacy-marker {
    width: 36px !important;
    height: 36px !important;
    margin-left: -18px !important;
    margin-top: -36px !important;
}

.pharmacy-marker-inner {
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 50% 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px var(--primary-glow), var(--shadow-sm);
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: markerPulse 2s ease-in-out infinite;
    transition: transform 0.2s ease;
}

.pharmacy-marker-inner svg {
    transform: rotate(45deg);
    width: 18px;
    height: 18px;
    color: white;
}

.pharmacy-marker.active .pharmacy-marker-inner {
    background: linear-gradient(135deg, #FFD600, #FFA000);
    transform: rotate(-45deg) scale(1.2);
    box-shadow: 0 2px 20px rgba(255, 214, 0, 0.5);
}

@keyframes markerPulse {

    0%,
    100% {
        box-shadow: 0 2px 12px var(--primary-glow), var(--shadow-sm);
    }

    50% {
        box-shadow: 0 2px 20px rgba(0, 200, 83, 0.5), var(--shadow-sm);
    }
}

/* User location marker */
.user-marker {
    width: 20px !important;
    height: 20px !important;
    margin-left: -10px !important;
    margin-top: -10px !important;
}

.user-marker-inner {
    width: 20px;
    height: 20px;
    background: #4285F4;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 6px rgba(66, 133, 244, 0.3), var(--shadow-sm);
    animation: userPulse 3s ease-in-out infinite;
}

@keyframes userPulse {

    0%,
    100% {
        box-shadow: 0 0 0 6px rgba(66, 133, 244, 0.3), var(--shadow-sm);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(66, 133, 244, 0.1), var(--shadow-sm);
    }
}

/* Leaflet Popup */
.leaflet-popup-content-wrapper {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 0 !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    min-width: 200px !important;
}

.leaflet-popup-tip {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
}

.leaflet-popup-close-button {
    color: var(--text-secondary) !important;
    font-size: 20px !important;
    padding: 6px 8px !important;
}

.popup-content {
    padding: 14px;
}

.popup-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.popup-content p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    line-height: 1.4;
}

.popup-content .popup-distance {
    font-size: 11px;
    color: var(--primary-light);
    font-weight: 600;
    margin-top: 6px;
}

/* --- Loading Overlay --- */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* --- Permission Screen --- */
.permission-screen {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.permission-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 28px;
    text-align: center;
    max-width: 360px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.permission-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.15), rgba(0, 200, 83, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--primary);
}

.permission-card h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.permission-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
}

.permission-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 12px;
}

.permission-divider::before,
.permission-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.select-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.select-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* --- Toast --- */
.toast {
    position: fixed;
    top: calc(var(--header-height) + 12px);
    left: 16px;
    right: 16px;
    z-index: 3000;
    animation: toastIn 0.3s ease;
}

.toast-content {
    background: #ef4444;
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- My Location Button --- */
.btn-my-location {
    position: fixed;
    right: 14px;
    bottom: calc(var(--sheet-peek) + 16px);
    z-index: 800;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: transform 0.2s ease, background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-my-location:active {
    transform: scale(0.9);
    background: var(--bg-card-hover);
}

/* --- Bottom Sheet --- */
.bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    transform: translateY(calc(100% - var(--sheet-peek)));
    max-height: calc(100vh - var(--header-height) - 20px);
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.bottom-sheet.expanded {
    transform: translateY(0);
}

.sheet-handle {
    padding: 16px 0 12px;
    cursor: grab;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.handle-bar {
    width: 48px;
    height: 5px;
    border-radius: 3px;
    background: var(--text-muted);
    opacity: 0.4;
    transition: opacity 0.2s ease, width 0.2s ease;
}

.sheet-handle:hover .handle-bar {
    opacity: 0.7;
    width: 54px;
}

.sheet-header {
    padding: 0 24px 16px;
    flex-shrink: 0;
}

.sheet-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sheet-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.sheet-date {
    font-size: 12px;
    color: var(--primary-light);
    font-weight: 500;
    margin-top: 2px;
}

.duty-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(0, 200, 83, 0.1);
    border: 1px solid rgba(0, 200, 83, 0.2);
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.duty-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
    animation: dutyPulse 2s ease-in-out infinite;
}

@keyframes dutyPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.pharmacy-count {
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    min-width: 28px;
    text-align: center;
}

.filter-row {
    margin-top: 10px;
}

.filter-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* --- Search Bar --- */
.search-row {
    padding: 0 24px 12px;
    flex-shrink: 0;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.2s ease;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.1);
}

.search-input:focus ~ .search-icon {
    color: var(--primary);
}

.search-input-wrapper:focus-within .search-icon {
    color: var(--primary);
}

.search-clear {
    position: absolute;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.search-clear:hover {
    background: var(--border);
    color: var(--text-secondary);
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.no-results svg {
    margin-bottom: 12px;
    opacity: 0.4;
}

.no-results p {
    font-size: 14px;
    line-height: 1.5;
}
/* --- Info Notice --- */
.info-notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 16px;
    margin: 0 16px 12px;
    background: rgba(255, 183, 77, 0.08);
    border: 1px solid rgba(255, 183, 77, 0.15);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.info-notice svg {
    color: #FFB74D;
    flex-shrink: 0;
    margin-top: 1px;
}

.info-notice p {
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0;
}

/* --- Install Banner --- */
.install-banner {
    margin: 0 16px 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.08), rgba(0, 200, 83, 0.04));
    border: 1px solid rgba(0, 230, 118, 0.2);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.install-banner-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.install-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.install-banner-text strong {
    font-size: 13px;
    color: var(--text-primary);
}

.install-banner-text span {
    font-size: 11px;
    color: var(--text-muted);
}

.install-banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.install-btn-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 6px 10px;
}

.install-btn-action {
    background: var(--accent);
    color: white;
    border: none;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.install-btn-action:hover {
    opacity: 0.9;
}

/* --- Pharmacy List --- */
.pharmacy-list {
    overflow-y: auto;
    flex: 1;
    padding: 0 16px 20px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: calc(20px + var(--safe-bottom));
}

.pharmacy-list::-webkit-scrollbar {
    width: 3px;
}

.pharmacy-list::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

.pharmacy-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    -webkit-tap-highlight-color: transparent;
    box-shadow: var(--shadow-sm);
}

.pharmacy-card:active {
    transform: scale(0.97);
}

.pharmacy-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.pharmacy-card.active {
    border-color: var(--primary);
    background: linear-gradient(to right, rgba(0, 230, 118, 0.08), rgba(0, 230, 118, 0.02));
    box-shadow: 0 0 0 1px var(--primary), var(--shadow-sm);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.15), rgba(0, 230, 118, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(0, 230, 118, 0.2);
}

.card-icon svg {
    width: 24px;
    height: 24px;
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.3;
    color: var(--text-primary);
}

.card-address {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.card-distance {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-light);
    display: flex;
    align-items: center;
    gap: 3px;
}

.card-district {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 14px;
    line-height: 1.5;
}

/* --- Detail Overlay --- */
.detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }

    to {
        opacity: 1;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }
}

.detail-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-top: 1px solid var(--border);
    width: 100%;
    max-width: 500px;
    padding: 32px 24px calc(24px + var(--safe-bottom));
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.detail-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--bg-dark);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: background 0.2s;
}

.detail-close:hover {
    background: var(--bg-card-hover);
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-right: 40px;
}

.detail-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
}

.detail-name {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.detail-district {
    font-size: 12px;
    color: var(--primary-light);
    font-weight: 500;
    margin-top: 2px;
    display: block;
}

.detail-info {
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row svg {
    color: var(--text-muted);
    flex-shrink: 0;
    margin-top: 1px;
}

.detail-row p,
.detail-row span {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.detail-row a {
    font-size: 13px;
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
}

.detail-distance-row span {
    color: var(--primary) !important;
    font-weight: 700;
}

.detail-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn-directions {
    flex: 1;
    padding: 16px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 8px 16px -4px var(--primary-glow);
}

.btn-directions:active {
    transform: scale(0.96);
    box-shadow: 0 4px 8px -2px var(--primary-glow);
}

.btn-directions:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -4px var(--primary-glow);
}

.btn-call {
    padding: 16px 24px;
    border-radius: var(--radius-md);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-call:active {
    transform: scale(0.97);
    background: var(--bg-card-hover);
}

/* --- Responsive Desktop --- */
@media (min-width: 768px) {
    .bottom-sheet {
        left: 16px;
        right: auto;
        width: 380px;
        bottom: 16px;
        border-radius: var(--radius-xl);
        max-height: calc(100vh - var(--header-height) - 40px);
        transform: none;
        border: 1px solid var(--border);
    }

    .bottom-sheet.expanded {
        transform: none;
    }

    .sheet-handle {
        display: none;
    }

    .btn-my-location {
        bottom: 30px;
        right: 20px;
    }

    .detail-overlay {
        align-items: center;
    }

    .detail-card {
        border-radius: var(--radius-xl);
        max-width: 440px;
    }
}

/* ========================================
   Light Theme
   ======================================== */
[data-theme="light"] {
    --bg-dark: #F1F5F9; /* Softer gray */
    --bg-card: #FFFFFF;
    --bg-card-hover: #F8FAFC;
    --bg-glass: rgba(255, 255, 255, 0.85);

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;

    --border: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(15, 23, 42, 0.15);

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

    --primary-light: #00B259;
}

[data-theme="light"] .leaflet-tile-pane {
    filter: none;
}

[data-theme="light"] .leaflet-control-zoom a {
    background: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
}

[data-theme="light"] .leaflet-control-zoom a:hover {
    background: #f8fafc !important;
}

[data-theme="light"] .header-location {
    background: rgba(0, 200, 83, 0.08);
    border-color: rgba(0, 200, 83, 0.2);
    color: #00A844;
}

[data-theme="light"] .pharmacy-marker-inner {
    border-color: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .card-icon {
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.12), rgba(0, 200, 83, 0.04));
}

[data-theme="light"] .card-district {
    background: rgba(0, 0, 0, 0.05);
    color: #64748b;
}

[data-theme="light"] .duty-badge {
    background: rgba(0, 200, 83, 0.08);
    border-color: rgba(0, 200, 83, 0.15);
}

[data-theme="light"] .detail-overlay {
    background: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .bottom-sheet {
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .select-input,
[data-theme="light"] .filter-select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23475569' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

[data-theme="light"] .sheet-date {
    color: #00A844;
}

[data-theme="light"] .detail-district {
    color: #00A844;
}

/* --- Install Float Button --- */
.btn-install-float {
    position: fixed;
    left: 14px;
    bottom: calc(var(--sheet-peek) + 16px);
    z-index: 800;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: transform 0.2s ease, background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-install-float:active {
    transform: scale(0.9);
    background: var(--bg-card-hover);
}

/* --- Theme Toggle Button --- */
.btn-theme-toggle {
    position: fixed;
    right: 14px;
    bottom: calc(var(--sheet-peek) + 72px);
    z-index: 800;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: transform 0.3s ease, background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-theme-toggle:active {
    transform: scale(0.9);
}

.btn-theme-toggle .icon-sun,
.btn-theme-toggle .icon-moon {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.btn-theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.btn-theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="light"] .btn-theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="light"] .btn-theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

@media (min-width: 768px) {
    .btn-theme-toggle {
        bottom: 86px;
        right: 20px;
    }
}