@font-face {
    font-family: 'MVFaseyha';
    src: url('/fonts/MV_Faseyha.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-size: 20px;
}

html, body {
    height: 100dvh;
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

#map {
    width: 100%;
    height: 100%;
    touch-action: pan-x pan-y pinch-zoom rotate;
    -webkit-touch-callout: none;
    background: #bae6fd; 
}

.font-dhivehi {
    font-family: 'MVFaseyha', sans-serif !important;
    direction: rtl;
}

input.font-dhivehi::placeholder {
    font-family: 'MVFaseyha', sans-serif !important;
    direction: rtl;
    text-align: right;
}

#topSearchWrapper, .side-stack, #navTopBanner, #placeInfoCard, .routing-panel {
    touch-action: auto;
}

main.relative {
    pointer-events: none;
}
main.relative > * {
    pointer-events: auto;
}
#map {
    pointer-events: auto;
}

.routing-panel {
    background-color: #ffffff !important;
    padding: 0 0 calc(16px + env(safe-area-inset-bottom, 0px)) 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 24px 24px 0 0 !important;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.15) !important;
    font-family: inherit !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: 48vh !important;
    overflow-y: auto !important;
    z-index: 2000 !important;
    color: #1e293b !important;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.nav-mode-active .routing-panel {
    transform: translateY(120%);
}

@media (min-width: 768px) {
    .routing-panel {
        top: 80px !important;
        bottom: 24px !important;
        width: 400px !important;
        max-height: calc(100vh - 110px) !important;
        border-radius: 24px !important;
        box-shadow: 0 12px 40px rgba(0,0,0,0.15) !important;
    }
    #uiLayer[dir="ltr"] .routing-panel {
        left: 16px !important;
        right: auto !important;
    }
    #uiLayer[dir="rtl"] .routing-panel {
        right: 16px !important;
        left: auto !important;
    }

    .nav-mode-active #uiLayer[dir="ltr"] .routing-panel {
        transform: translateX(-120%);
    }
    .nav-mode-active #uiLayer[dir="rtl"] .routing-panel {
        transform: translateX(120%);
    }
}

.routing-panel::before {
    content: '';
    display: block;
    width: 40px;
    height: 5px;
    background: #cbd5e1;
    border-radius: 3px;
    margin: 10px auto 12px auto;
}
@media (min-width: 768px) {
    .routing-panel::before { display: none; }
}

@keyframes ultraSmoothSlowTilt {
    0%   { transform: scale(1.0) rotate(0deg); }
    8%   { transform: scale(2.0) rotate(0deg); }
    30%  { transform: scale(2.0) rotate(-8deg); }
    50%  { transform: scale(2.0) rotate(8deg); }
    75%  { transform: scale(2.0) rotate(-3deg); }
    100% { transform: scale(2.0) rotate(0deg); }
}

@keyframes pulseGps {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 14px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.gps-active-pulse { animation: pulseGps 2s infinite; }

@keyframes pulseBlue {
    0% { transform: scale(0.6); opacity: 0.9; }
    70% { transform: scale(1.8); opacity: 0; }
    100% { transform: scale(0.6); opacity: 0; }
}

.pin-anchor.pin-label-container {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    width: max-content;
}

.pin-balloon-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.15s ease-out;
    transform-origin: bottom center;
    position: relative;
    z-index: 10;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.25));
}

.custom-icon-wrapper {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-sizing: border-box;
    font-size: 16px;
    color: white;
    overflow: hidden;
    position: relative;
    background-color: #2563eb; 
}

.pin-tail {
    width: 0; 
    height: 0; 
    border-left: 3px solid transparent; 
    border-right: 3px solid transparent; 
    border-top: 4px solid white; 
    margin-top: -1px;
    position: relative;
    z-index: -1;
    opacity: 0;
    transform: scaleY(0);
    transform-origin: top center;
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

.floor-dot {
    position: absolute;
    bottom: -6px;
    width: 8px;
    height: 8px;
    background: #2563eb;
    border: 2px solid white;
    border-radius: 50%;
    z-index: 1;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

.pin-anchor:hover .pin-balloon-wrapper {
    transform: scale(1.08);
}

.pin-selected .pin-balloon-wrapper {
    transform: scale(2);
    filter: drop-shadow(0 14px 20px rgba(0,0,0,0.35));
}

.pin-selected .pin-tail {
    opacity: 1;
    transform: scaleY(1);
}

.pin-selected .floor-dot {
    opacity: 1;
    transform: scale(1);
}

.pin-anchor[data-category="house"].pin-selected .custom-icon-wrapper {
    background-color: #2563eb !important;
}

.custom-icon-wrapper img, .custom-uploaded-icon {
    width: 58% !important;
    height: 58% !important;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 0 1px rgba(255,255,255,0.9));
}

.pin-label-text {
    font-weight: 700;
    color: #0f172a;
    text-shadow: 
        -1px -1px 0 #ffffff,
         1px -1px 0 #ffffff,
        -1px  1px 0 #ffffff,
         1px  1px 0 #ffffff,
         0px  2px 4px rgba(255,255,255,0.9);
    pointer-events: none;
    margin-top: 4px;
    opacity: 0;
    visibility: hidden;
    transition: none;
}

.pin-selected .pin-label-text {
    opacity: 1;
    visibility: visible;
}

.user-nav-marker { width: 48px; height: 48px; position: relative; }
.user-nav-marker-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform: rotate(0deg) !important;
    display: flex;
    align-items: center;
    justify-content: center;
}
.user-nav-marker-inner::before { 
    content: ''; 
    position: absolute; 
    width: 34px; height: 34px; 
    background: rgba(66, 133, 244, 0.35); 
    border-radius: 50%; 
    animation: pulseBlue 2s infinite ease-out; 
    margin-top: 4px;
}
.user-nav-marker-inner::after { 
    content: ''; 
    position: absolute; 
    inset: 0; 
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 4 L6 34 L20 25 L34 34 Z' fill='none' stroke='white' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M20 4 L6 34 L20 25 Z' fill='%234285F4'/%3E%3Cpath d='M20 4 L20 25 L34 34 Z' fill='%231A73E8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 75%;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.45));
}

.search-badge-dark { 
    background-color: #334155 !important; 
    border-color: #475569 !important; 
    color: #ffffff !important; 
}
.search-badge-dark img { 
    filter: brightness(0) invert(1) !important; 
}

.side-stack-btn { 
    width: 44px; 
    height: 44px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: #334155; 
    background: transparent; 
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); 
    position: relative; 
    cursor: pointer; 
    -webkit-tap-highlight-color: transparent; 
}
.side-stack-btn:hover, .side-stack-btn:active { 
    background: #f8fafc; 
    color: #2563eb; 
}

.start-nav-btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 8px; background: rgba(255, 255, 255, 0.18); backdrop-filter: blur(4px); }
.card-action-btn-danger { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.18); color: #dc2626; transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.card-action-btn-danger:hover, .card-action-btn-danger:active { background: rgba(239, 68, 68, 0.16); transform: scale(1.04); }

#recenterNavBtn { box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4); }
#mainArea { transition: background-color 1s ease; background-color: #bae6fd; }

#topSearchWrapper {
    top: max(12px, env(safe-area-inset-top, 12px)) !important;
    left: max(12px, env(safe-area-inset-left, 12px)) !important;
    right: max(12px, env(safe-area-inset-right, 12px)) !important;
}
@media (min-width: 768px) {
    #topSearchWrapper {
        width: 380px !important;
    }
    #uiLayer[dir="ltr"] #topSearchWrapper {
        left: 16px !important;
        right: auto !important;
    }
    #uiLayer[dir="rtl"] #topSearchWrapper {
        right: 16px !important;
        left: auto !important;
    }
}

#uiLayer[dir="ltr"] .side-stack {
    right: max(12px, env(safe-area-inset-right, 12px)) !important;
    left: auto !important;
}
#uiLayer[dir="rtl"] .side-stack {
    left: max(12px, env(safe-area-inset-left, 12px)) !important;
    right: auto !important;
}

#placeInfoCard {
    position: fixed !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    /* Lifted up in mobile view to clear the bottom floating tab bar */
    bottom: 110px !important; 
    width: calc(100vw - 24px) !important;
    max-width: 380px !important;
    z-index: 2147483647 !important;
}

.routing-panel {
    bottom: 100px !important;
    z-index: 2000000 !important;
}

@media (min-width: 768px) {
    #placeInfoCard {
        /* Desktop view positioning */
        bottom: 24px !important;
        width: 380px !important;
    }
}
.side-stack {
    position: fixed;
    /* Increase this value (e.g. from 50% to 35% or set an explicit top offset) to lift the buttons higher */
    top: 32% !important;
    transform: translateY(0) !important;
    right: max(12px, env(safe-area-inset-right, 12px)) !important;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (min-width: 768px) {
    .side-stack {
        top: 50% !important;
        transform: translateY(-50%) !important;
    }
}