/* location.css */

/* MAP FULLSCREEN */
#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

/* Red tinted map labels */
.leaflet-tile-pane {
    filter: hue-rotate(330deg) saturate(2.5);
}

/* Hide Leaflet white attribution bar */
.leaflet-control-attribution {
    display: none !important;
}

/* SEARCH BAR */
.map-search-container {
    position: absolute;
    top: 100px; /* adjusted for global header */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 92%;
    max-width: 560px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-glass {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(30px);
    border: 1px solid var(--mt-border-accent);
    border-radius: var(--radius-full);
    display: flex;
    padding: 5px 20px;
    box-shadow: 0 0 25px rgba(255, 7, 58, 0.2);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
}

.search-glass:focus-within {
    border-color: var(--mt-primary);
    box-shadow: 0 0 30px var(--mt-primary-glow);
}

.search-input {
    background: none;
    border: none;
    color: var(--mt-text-primary);
    flex: 1;
    padding: 14px;
    font-size: var(--fs-base);
    outline: none;
    font-family: var(--font-body);
}

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

/* Kill browser autofill white background */
.search-input:-webkit-autofill,
.search-input:-webkit-autofill:hover,
.search-input:-webkit-autofill:focus,
.search-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 50px rgba(10, 10, 10, 0.85) inset !important;
    -webkit-text-fill-color: white !important;
    background-color: transparent !important;
    transition: background-color 5000s ease-in-out 0s;
}

.search-btn {
    background: var(--mt-primary);
    border: none;
    color: white;
    font-size: var(--fs-base);
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 50%;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: #D60632;
    transform: scale(1.1);
}

.radius-inline {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(25px);
    border: 1px solid var(--mt-border-accent);
    border-radius: 30px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.radius-inline label {
    font-size: var(--fs-xs);
    color: var(--mt-primary);
    font-weight: 600;
}

.radius-inline input[type=range] {
    width: 70px;
    accent-color: var(--mt-primary);
}

/* FLOATING ACTION BUTTONS */
.fab-group {
    position: absolute;
    bottom: 30%;
    right: 20px;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: auto;
}

.fab {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: var(--mt-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 5px 15px rgba(255, 7, 58, 0.4);
    cursor: pointer;
    border: none;
    transition: 0.3s;
}

.fab:hover {
    transform: scale(1.1);
    background: #D60632;
}

.fab.secondary {
    background: var(--mt-bg-elevated);
    backdrop-filter: blur(10px);
    border: 1px solid var(--mt-border);
    color: var(--mt-primary);
}

/* RADIUS SLIDER PANEL */
.radius-panel {
    position: absolute;
    top: 150px;
    right: 20px;
    z-index: 1000;
    background: var(--mt-bg-elevated);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--mt-border);
    width: 200px;
    display: none;
}

.radius-panel.visible {
    display: block;
}

.radius-panel h4 {
    font-size: 12px;
    margin-bottom: 10px;
    color: var(--mt-text-secondary);
}

.slider {
    width: 100%;
    accent-color: var(--mt-primary);
}

/* RESULTS LIST PANEL (LEFT SIDE) */
.results-panel {
    position: absolute;
    top: 150px;
    left: 20px;
    bottom: 40px;
    width: 350px;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(25px);
    border: 1px solid var(--mt-primary);
    box-shadow: 0 0 20px rgba(255, 7, 58, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-120%);
}

.results-panel.visible {
    transform: translateX(0);
}

.results-header {
    padding: var(--sp-4);
    border-bottom: 1px solid var(--mt-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-header h3 {
    font-size: var(--fs-base);
    color: var(--mt-primary);
    font-family: var(--font-display);
}

.results-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.result-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--mt-border);
    border-radius: var(--radius-md);
    padding: var(--sp-4);
    margin-bottom: 10px;
    cursor: pointer;
    transition: 0.3s;
}

.result-item:hover {
    background: rgba(255, 7, 58, 0.1);
    border-color: var(--mt-primary);
}

.result-item h4 {
    font-size: var(--fs-sm);
    margin-bottom: 5px;
    color: var(--mt-text-primary);
}

.result-item p {
    font-size: var(--fs-xs);
    color: var(--mt-text-secondary);
}

.result-item .dist {
    font-size: var(--fs-xs);
    color: var(--mt-primary);
    font-weight: bold;
    margin-top: 5px;
}

.skeleton {
    background: linear-gradient(90deg, #111 25%, #222 50%, #111 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    height: 80px;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* BOTTOM DETAIL PANEL */
.detail-panel {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(30px);
    border-top: 2px solid var(--mt-primary);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 30px 20px;
    z-index: 2000;
    transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 80vh;
    overflow-y: auto;
}

.detail-panel.active {
    bottom: 0;
}

.pull-bar {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: -15px auto 20px;
}

.theatre-info h2 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--mt-primary);
    font-family: var(--font-display);
}

.theatre-info p {
    color: var(--mt-text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--mt-border);
}

.stat-card span {
    display: block;
    font-size: var(--fs-xs);
    color: var(--mt-text-secondary);
}

.stat-card strong {
    font-size: 18px;
    color: white;
}

.action-btns {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 15px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
    font-size: 14px;
    font-family: var(--font-display);
}

.btn-primary {
    background: var(--mt-primary);
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* NAVIGATION OVERLAY */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 7, 58, 0.9);
    padding: 20px;
    z-index: 3000;
    display: none;
    flex-direction: column;
    gap: 10px;
    animation: slideDown 0.5s ease;
}

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

.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-instruction {
    font-size: 20px;
    font-weight: bold;
    color: white;
}

.nav-footer {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

/* MARKER STYLES */
.user-marker {
    width: 20px;
    height: 20px;
    background: #2196F3;
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(33, 150, 243, 0.8);
    position: relative;
}

.user-marker::after {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border: 2px solid #2196F3;
    border-radius: 50%;
    animation: pulse-blue 2s infinite;
}

@keyframes pulse-blue {
    0% { opacity: 0.8; transform: scale(0.5); }
    100% { opacity: 0; transform: scale(1.2); }
}

.theatre-dot {
    width: 16px;
    height: 16px;
    background: var(--mt-primary);
    border: 2px solid white;
    border-radius: 50%;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 7, 58, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(255, 7, 58, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 7, 58, 0); }
}

/* ROUTING HIDE DEFAULT UI */
.leaflet-routing-container {
    display: none !important;
}

/* LOADING BLOCKER */
#loader {
    position: fixed;
    inset: 0;
    background: var(--mt-bg);
    z-index: 5000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: 0.5s;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 7, 58, 0.1);
    border-top-color: var(--mt-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .fab-group {
        bottom: 100px;
    }
}
