/* --- VARIABLES --- */
:root {
    --primary: #ff5722;
    --bg: #fafafa;
    --surface: #ffffff;
    --text: #262626;
    --text-grey: #8e8e8e;
    --border: #dbdbdb;
    --input-bg: #transparent;
    --nav-height: 60px;
}
[data-theme="dark"] {
    --bg: #000000;
    --surface: #121212;
    --text: #e0e0e0;
    --text-grey: #a8a8a8;
    --border: #363636;
    --input-bg: #1e1e1e;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); overflow: hidden; transition: background 0.3s, color 0.3s; }

/* HEADER & NAV */
header { height: 50px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; padding: 0 15px; position: fixed; top: 0; width: 100%; z-index: 1000; }
.logo-text { font-family: 'Cookie', cursive; font-size: 1.5rem; font-weight: bold; }
.city-picker { border: none; background: transparent; font-weight: 600; font-size: 0.9rem; outline: none; color: var(--text); }
button.icon-btn { background: transparent; border: none; color: var(--text); font-size: 1.2rem; cursor: pointer; margin-left: 10px; }
#theme-toggle, #admin-btn { background: transparent; border: none; color: var(--text); font-size: 1.1rem; cursor: pointer; }
.bottom-nav { position: fixed; bottom: 0; width: 100%; height: var(--nav-height); background: var(--surface); border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-around; z-index: 1000; padding-bottom: env(safe-area-inset-bottom); }
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-grey); cursor: pointer; transition: transform 0.1s; width: 25%; }
.nav-item i { font-size: 1.2rem; margin-bottom: 3px; }
.nav-label { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.nav-item.active { color: var(--primary); }

/* VIEWS & MAP */
.view-container { position: absolute; top: 50px; bottom: var(--nav-height); width: 100%; overflow-y: auto; display: none; background: var(--bg); }
.view-container.active { display: block; }
#map { width: 100%; height: 100%; }

/* Custom Marker CSS not needed for basic Google Markers, but kept if you want to use OverlayView later */
.custom-marker { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.3); border: 2px solid white; }

.locate-btn { position: absolute; top: 15px; right: 15px; z-index: 900; background: var(--surface); border: none; width: 40px; height: 40px; color: var(--text); border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,0.15); cursor: pointer; }
.map-overlay { position: absolute; bottom: 20px; left: 15px; right: 15px; z-index: 900; background: var(--surface); padding: 20px; border-radius: 20px; box-shadow: 0 5px 20px rgba(0,0,0,0.1); }
.drag-handle { width: 40px; height: 4px; background: var(--border); margin: 0 auto 15px; border-radius: 2px; }
.overlay-header { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 10px; align-items: center; }
.insta-slider { width: 100%; accent-color: var(--primary); height: 4px; margin-bottom: 15px; background: var(--border); }
.current-hunt-tag { font-size: 0.85rem; color: var(--text-grey); background: var(--border); padding: 5px 10px; border-radius: 15px; display: inline-block; }
.vibe-dropdown { border: none; background: var(--bg); color: var(--text); font-weight: bold; padding: 5px; border-radius: 4px; outline: none; max-width: 150px; }

/* DIRECTORY & SEARCH */
.directory-grid { display: flex; flex-direction: column; gap: 10px; padding-bottom: 20px; }
.dir-card { background: var(--surface); padding: 15px; border-radius: 12px; border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.dir-info { flex: 1; }
.dir-info h4 { margin: 0; font-size: 1rem; color: var(--text); }
.dir-info p { margin: 3px 0 0; font-size: 0.8rem; color: var(--text-grey); }
.dir-actions { display: flex; gap: 8px; }
.icon-box { width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--bg); border: 1px solid var(--border); color: var(--text); cursor: pointer; transition: 0.2s; }
.icon-box:hover { background: var(--border); }
.icon-box.delete-icon { color: #ed4956; border-color: #ed4956; }
.small-btn { padding: 8px 12px; font-size: 0.8rem; width: auto; }

/* FEED & CATEGORIES */
.category-tabs { display: flex; gap: 10px; padding: 15px; background: var(--surface); overflow-x: auto; border-bottom: 1px solid var(--border); }
.cat-tab { padding: 8px 16px; border-radius: 20px; background: var(--bg); border: 1px solid var(--border); font-size: 0.9rem; font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--text); }
.cat-tab.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.stories-container { padding: 15px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; gap: 15px; align-items: center; }
.story-circle { width: 60px; height: 60px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.add-story { border: 2px dashed var(--text-grey); color: var(--text-grey); }
.story-label { font-size: 0.75rem; text-align: center; margin-top: 5px; color: var(--text); }
.feed-grid { padding: 10px; padding-bottom: 80px; }
.card { background: var(--surface); border-radius: 15px; overflow: hidden; margin-bottom: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.03); border: 1px solid var(--border); cursor: pointer; }
.card-img-holder { height: 200px; background: var(--border); position: relative; overflow: hidden; }
.card-img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 12px; }
.card-title { font-weight: 700; font-size: 1rem; margin-bottom: 4px; color: var(--text); }
.card-origin { font-size: 0.8rem; color: var(--primary); font-weight: 600; margin-bottom: 5px; text-transform: uppercase; }
.card-vibes { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.vibe-pill { font-size: 0.7rem; background: var(--bg); border: 1px solid var(--border); padding: 2px 6px; border-radius: 4px; color: var(--text-grey); }
.card-desc { font-size: 0.9rem; color: var(--text-grey); }
.card-footer { margin-top: 10px; display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 600; color: var(--primary); }

/* FORMS */
.form-container { padding: 30px 20px; max-width: 500px; margin: 0 auto; }
.input-group { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0 15px; margin-bottom: 15px; display: flex; align-items: center; height: 50px; }
.input-group i { color: var(--text-grey); margin-right: 10px; width: 20px; text-align: center; }
.input-group select, .input-group input { border: none; width: 100%; background: transparent; font-size: 1rem; outline: none; color: var(--text); }
.input-group option { background: var(--surface); color: var(--text); }
textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 15px; font-family: inherit; font-size: 1rem; margin-bottom: 20px; outline: none; resize: none; background: var(--surface); color: var(--text); }
.insta-btn { background: #0095f6; color: white; border: none; width: 100%; padding: 15px; border-radius: 8px; font-weight: 600; font-size: 0.95rem; cursor: pointer; }
.vibe-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.vibe-inputs input { padding: 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--input-bg); color: var(--text); }
.slider-group { margin-bottom: 15px; }
.slider-group label { display: block; margin-bottom: 5px; color: var(--text-grey); font-weight: 600; font-size: 0.8rem; }
.slider-row { display: flex; align-items: center; gap: 10px; }
.slider-value { text-align: right; color: var(--primary); font-weight: bold; margin-top: 2px; font-size: 0.9rem; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 2000; display: none; align-items: center; justify-content: center; }
.modal-card { background: var(--surface); width: 85%; border-radius: 12px; padding: 20px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; margin-bottom: 20px; font-weight: 700; color: var(--text); }
.modal-card input { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 10px; background: var(--input-bg); color: var(--text); }
.fa-xmark { cursor: pointer; color: var(--text); }
.admin-table-wrapper { overflow-x: auto; margin-top: 20px; border: 1px solid var(--border); border-radius: 8px; }
#admin-table, #cat-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { background: var(--border); padding: 10px; text-align: left; color: var(--text); }
td { padding: 10px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.admin-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
/* --- FIX GOOGLE AUTOCOMPLETE VISIBILITY --- */
.pac-container {
    z-index: 99999 !important; /* Force search results on top of modal */
    font-family: 'Roboto', sans-serif; /* Match your font */
    border-radius: 8px;
    margin-top: 5px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
/* --- FUTURISTIC HUD MARKER STYLES --- */
.hud-container {
    position: absolute;
    /* Center the bottom tip of the HUD on the coordinate */
    transform: translate(-50%, -100%); 
    pointer-events: auto; /* Allow clicking */
    cursor: pointer;
    z-index: 100;
    padding-bottom: 20px; /* Space for the "stem" or line connecting to map */
}

/* The Card Body */
.hud-card {
    background: rgba(16, 25, 35, 0.85); /* Dark semi-transparent blue */
    border: 1px solid #00f0ff; /* Cyan Neon Border */
    color: #00f0ff;
    width: 220px;
    padding: 10px;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 12px;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3), inset 0 0 15px rgba(0, 240, 255, 0.1);
    
    /* The "Chopped Corner" look */
    clip-path: polygon(
        0 0, 
        100% 0, 
        100% 85%, 
        90% 100%, 
        0 100%
    );
    position: relative;
    backdrop-filter: blur(4px);
}

/* Decorative Header Line */
.hud-header-line {
    width: 100%;
    height: 2px;
    background: #00f0ff;
    margin-bottom: 8px;
    box-shadow: 0 0 5px #00f0ff;
}

.hud-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
    color: #fff;
    text-shadow: 0 0 5px #00f0ff;
}

.hud-subtitle {
    font-size: 10px;
    color: #a3c4c7;
    margin-bottom: 8px;
    text-transform: uppercase;
}

/* Progress Bars */
.hud-stat-row {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.hud-stat-label {
    width: 50px;
    font-size: 9px;
    color: #00f0ff;
    text-transform: uppercase;
}

.hud-bar-bg {
    flex: 1;
    height: 4px;
    background: rgba(0, 240, 255, 0.2);
    margin-left: 5px;
    position: relative;
    /* Dashed line effect */
    background-image: linear-gradient(90deg, transparent 50%, rgba(0,0,0,0.8) 50%);
    background-size: 4px 100%;
}

.hud-bar-fill {
    height: 100%;
    background: #00f0ff;
    box-shadow: 0 0 4px #00f0ff;
    width: 0%; /* JS will set this */
    transition: width 1s ease-out;
}

/* The "Stem" connecting card to the map location */
.hud-stem {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 1px;
    height: 20px;
    background: #00f0ff;
    box-shadow: 0 0 4px #00f0ff;
}

.hud-dot {
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #fff;
    border: 1px solid #00f0ff;
    border-radius: 50%;
    box-shadow: 0 0 8px #00f0ff;
}

/* Hover Effect: Bring to front and brighten */
.hud-container:hover {
    z-index: 200;
}
.hud-container:hover .hud-card {
    background: rgba(16, 25, 35, 0.95);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
}