@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --sab: env(safe-area-inset-bottom, 0px);
    --sat: env(safe-area-inset-top, 0px);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f8fafc;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
}

/* Prevent auto-zoom on iOS inputs when font size is less than 16px */
@media (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Touch & tap responsiveness */
button, a, select, input[type="range"] {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Custom scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Hide scrollbars for slick horizontal touch-scroll */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

/* Pulsing Live Beacon */
.pulsing-beacon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.pulsing-beacon::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #10b981;
    opacity: 0.75;
    animation: beacon-pulse 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes beacon-pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(2.2); opacity: 0; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* Leaflet Custom Marker & Popups */
.custom-price-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    white-space: nowrap;
    border: 2px solid white;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.custom-price-pin:hover, .custom-price-pin.selected-pin {
    transform: scale(1.18);
    z-index: 9999;
}
.pin-green { background: #10b981; color: white; }
.pin-blue { background: #2563eb; color: white; }
.pin-amber { background: #f59e0b; color: white; }

.leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15), 0 8px 10px -6px rgba(0,0,0,0.1);
}
.leaflet-popup-content {
    margin: 0;
    line-height: 1.4;
    font-family: inherit;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
    box-shadow: 0 -4px 20px -2px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
    transition: all 0.15s ease;
    border-radius: 0.5rem;
    position: relative;
}

.mobile-nav-btn.active {
    color: #2563eb;
}

.mobile-nav-btn.active i {
    transform: translateY(-1px);
    color: #2563eb;
}

/* Floating Map / List Toggle */
.floating-toggle-btn {
    position: fixed;
    bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 38;
    box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.3);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.floating-toggle-btn:active {
    transform: translateX(-50%) scale(0.95);
}

/* Bottom Sheet Slide Up Animation */
.bottom-sheet-content {
    animation: sheetSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sheetSlideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.sheet-handle-bar {
    width: 38px;
    height: 4px;
    background-color: #cbd5e1;
    border-radius: 9999px;
    margin: 8px auto 14px;
}

/* Mobile Map Peek Card */
#map-card-peek {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

/* Native-feeling Card Active Tap State */
.property-card-touch {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.property-card-touch:active {
    transform: scale(0.985);
}

/* Kanban column */
.kanban-col {
    min-height: calc(100vh - 300px);
}

/* Print Run Sheet Layout */
@media print {
    body {
        background: white;
        color: black;
    }
    nav, header, .no-print, #map-container, .tab-bar, button, .mobile-bottom-nav, .floating-toggle-btn {
        display: none !important;
    }
    .print-only {
        display: block !important;
    }
    .print-sheet {
        display: block !important;
    }
    .card-print {
        page-break-inside: avoid;
        border: 1px solid #ccc;
        margin-bottom: 12px;
        padding: 10px;
    }
}
