/* =========================================================
   🌓 Theme Variables & Global Styles
   ========================================================= */
:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --card-bg: #ffffff;
    --sidebar-bg: rgba(255, 255, 255, 0.95);
    --border-color: #eeeeee;
    --input-bg: #ffffff;
    --shadow: rgba(0,0,0,0.1);
    --overlay-bg: rgba(0,0,0,0.4);
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --secondary-color: #28a745;
    --secondary-hover: #1e7e34;
    --danger-color: #dc3545;
}

body.dark-theme {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --card-bg: #1e1e1e;
    --sidebar-bg: rgba(30, 30, 30, 0.95);
    --border-color: #333333;
    --input-bg: #2a2a2a;
    --shadow: rgba(0,0,0,0.5);
    --overlay-bg: rgba(0,0,0,0.7);
}

/* Global */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background: var(--bg-color);
    overflow: hidden; /* Prevent body scroll */
}

/* =========================================================
   🏞 Map Background
   ========================================================= */
#map {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Map is base layer */
}

/* =========================================================
   🔎 Search Experience Wrapper
   ========================================================= */
.search-experience-wrapper {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    z-index: 1100; /* Above map and floating buttons */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-bar {
    display: flex;
    gap: 0;
    background: var(--card-bg);
    padding: 6px;
    border-radius: 50px;
    box-shadow: 0 4px 20px var(--shadow);
    border: 1px solid var(--border-color);
}

.search-bar select {
    border: none;
    border-right: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-color);
    padding: 0 15px;
    outline: none;
    cursor: pointer;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-color);
    padding: 10px;
    outline: none;
}

.search-bar button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
}

/* =========================================================
   🪪 Results (Below Search)
   ========================================================= */
main[role="main"] {
    width: 100%;
}

.results-grid {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--card-bg);
    border-radius: 15px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px var(--shadow);
    border: 1px solid var(--border-color);
}

.results-grid:empty { display: none; }

.business-card {
    background: var(--card-bg);
    padding: 15px;
    border: none;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.business-card:hover { background: rgba(0,0,0,0.02); }

/* =========================================================
   🌓 Slide Panel & Overlay
   ========================================================= */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    backdrop-filter: blur(4px);
    display: none;
    z-index: 2000;
}
.overlay.active { display: block; }

.slide-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 350px;
    max-width: 85%;
    height: 100%;
    background: var(--card-bg);
    z-index: 2001;
    transition: right 0.4s cubic-bezier(0.25,0.8,0.25,1);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.slide-panel.active { right: 0; }

.slide-panel .close-btn {
    align-self: flex-end;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-color);
}

/* =========================================================
   🔘 Floating Buttons (Top Corners)
   ========================================================= */
#userLocation {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1050;
    background: var(--card-bg);
    padding: 8px 15px;
    border-radius: 30px;
    box-shadow: 0 2px 10px var(--shadow);
    font-size: 12px;
}

.dark-mode-toggle, #authPanelToggle {
    position: fixed;
    top: 20px;
    z-index: 1050;
}

.dark-mode-toggle {
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    box-shadow: 0 2px 10px var(--shadow);
    cursor: pointer;
}

#authPanelToggle {
    right: 75px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
}

/* =========================================================
   📝 Mission Box inside Auth Panel
   ========================================================= */
.slide-panel .mission-box {
    margin-top: 20px;
    background: var(--sidebar-bg);
    padding: 15px;
    border-radius: 12px;
    font-size: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
}

/* =========================================================
   👤 Auth Profile UI inside Slide Panel
   ========================================================= */
.user-avatar {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    color: white;
}

.logout-btn {
    background: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
}

/* =========================================================
   📱 Mobile Optimization
   ========================================================= */
@media (max-width: 600px) {
    .search-experience-wrapper { top: 10px; width: 95%; }
    .search-bar select { display: none; } /* Hide category on tiny screens */
    .dark-mode-toggle, #authPanelToggle { top: 75px; }
}
