/* Core Variables */
:root {
    --bg-dark: #0f1015;
    --bg-sidebar: rgba(18, 20, 26, 0.85);
    --border-gold: rgba(212, 175, 55, 0.3);
    --border-gold-focus: rgba(212, 175, 55, 0.8);
    --text-primary: #e6e8eb;
    --text-muted: #8e95a5;
    --gold: #d4af37;
    --gold-glow: rgba(212, 175, 55, 0.25);
    --crimson: #e74c3c;
    --green: #2ecc71;
    --violet: #9b59b6;
    --amber: #f39c12;
    --blue: #3498db;
    --cyan: #00d2ff;
    
    --font-heading: 'Cinzel', serif;
    --font-body: 'Outfit', sans-serif;
    --font-ui: 'Inter', sans-serif;
}

/* Reset and Scrollbars */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow: hidden;
    height: 100vh;
}

::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.4);
}

/* Main Layout Grid */
#app-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styling */
#sidebar {
    background: var(--bg-sidebar);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-gold);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 1000;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
    overflow: visible;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    text-align: center;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.logo-icon {
    font-size: 28px;
    filter: drop-shadow(0 0 8px var(--gold));
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #fff 30%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.tagline {
    font-family: var(--font-heading);
    font-size: 10px;
    color: var(--gold);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 4px;
    opacity: 0.8;
}

/* Section Headings */
h2 {
    font-family: var(--font-heading);
    font-size: 13px;
    color: var(--gold);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

h2::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.3), transparent);
    margin-left: 10px;
}

/* Search Box styling */
.search-section {
    padding: 20px 24px 10px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-gold);
    border-radius: 6px;
    padding: 4px 12px;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--border-gold-focus);
    box-shadow: 0 0 8px var(--gold-glow);
}

.search-icon {
    font-size: 14px;
    color: var(--text-muted);
    margin-right: 8px;
}

#search-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 13px;
    outline: none;
    padding: 8px 0;
    width: 100%;
}

.clear-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s;
}

.clear-btn:hover {
    color: #fff;
}

/* Act Selector styling */
.act-selector-section {
    padding: 10px 24px;
}

.act-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.act-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 11px;
    padding: 10px 0;
    transition: all 0.3s ease;
    text-align: center;
}

.act-btn:hover {
    background: rgba(212, 175, 55, 0.05);
    color: var(--text-primary);
    border-color: var(--gold);
}

.act-btn.active {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold);
    border-color: var(--gold);
    box-shadow: inset 0 0 8px rgba(212, 175, 55, 0.2);
    text-shadow: 0 0 5px rgba(212, 175, 55, 0.4);
}

/* Map Selector Dropdown styling */
.map-selector-section {
    padding: 10px 24px;
}

#map-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-gold);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.3s;
}

#map-select:hover, #map-select:focus {
    border-color: var(--border-gold-focus);
}

#map-select option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

/* Visibility Filters styling */
.filter-section {
    padding: 10px 24px;
}

.filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.filter-item input {
    display: none;
}

.filter-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: transform 0.2s;
}

.filter-item input:checked + .filter-indicator {
    transform: scale(1.2);
}

.filter-location { background-color: var(--blue); box-shadow: 0 0 6px var(--blue); }
.filter-quest { background-color: var(--gold); box-shadow: 0 0 6px var(--gold); }
.filter-boss { background-color: var(--crimson); box-shadow: 0 0 6px var(--crimson); }
.filter-npc { background-color: var(--green); box-shadow: 0 0 6px var(--green); }
.filter-portal { background-color: var(--violet); box-shadow: 0 0 6px var(--violet); }
.filter-poi { background-color: var(--amber); box-shadow: 0 0 6px var(--amber); }
.filter-fountain { background-color: var(--cyan); box-shadow: 0 0 6px var(--cyan); }

.filter-label {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-ui);
    transition: color 0.2s;
}

.filter-item input:checked ~ .filter-label {
    color: var(--text-primary);
}

/* Regions list styling */
.regions-section {
    padding: 10px 24px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.regions-list {
    flex: 1;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.08);
    border-radius: 6px;
    max-height: 320px;
}

.region-btn {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 12px;
    padding: 10px 14px;
    text-align: left;
    transition: all 0.2s;
}

.region-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--gold);
    padding-left: 18px;
}

/* Map Canvas Container */
#main-content {
    position: relative;
    background-color: #000000;
}

#map {
    height: 100%;
    width: 100%;
    background-color: #000000; /* Pure black to blend with dark game map backgrounds */
}

/* Leaflet Dark Theme popups */
.leaflet-popup-content-wrapper {
    background: rgba(18, 20, 26, 0.95) !important;
    border: 1px solid var(--gold) !important;
    border-radius: 6px !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6) !important;
    font-family: var(--font-body) !important;
}

.leaflet-popup-tip {
    background: rgba(18, 20, 26, 0.95) !important;
    border-left: 1px solid var(--gold) !important;
    border-bottom: 1px solid var(--gold) !important;
}

.popup-container {
    padding: 6px;
    min-width: 220px;
}

.popup-title {
    font-family: var(--font-heading);
    font-size: 14px;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 4px;
}

.popup-row {
    font-family: var(--font-ui);
    font-size: 11px;
    margin-bottom: 4px;
    display: flex;
}

.popup-label {
    color: var(--text-muted);
    width: 70px;
    font-weight: 500;
}

.popup-value {
    color: var(--text-primary);
    flex: 1;
}

.popup-link-btn {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.2));
    border: 1px solid var(--gold);
    border-radius: 4px;
    color: var(--gold);
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 11px;
    letter-spacing: 1px;
    margin-top: 10px;
    padding: 8px 0;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s;
}

.popup-link-btn:hover {
    background: rgba(212, 175, 55, 0.3);
    color: #fff;
    box-shadow: 0 0 8px var(--gold-glow);
}

/* Custom Marker Styles */
.custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.marker-inner {
    border-radius: 50%;
    width: 100%;
    height: 100%;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
}

.marker-inner-quest {
    background-color: rgba(212, 175, 55, 0.7);
    border-color: var(--gold);
    box-shadow: 0 0 10px var(--gold);
}

.marker-inner-boss {
    background-color: rgba(231, 76, 60, 0.85);
    border-color: var(--crimson);
    box-shadow: 0 0 12px var(--crimson);
}

.marker-inner-portal {
    background-color: rgba(155, 89, 182, 0.8);
    border-color: var(--violet);
    box-shadow: 0 0 10px var(--violet);
}

.marker-inner-npc {
    background-color: rgba(46, 204, 113, 0.75);
    border-color: var(--green);
    box-shadow: 0 0 8px var(--green);
}

.marker-inner-location {
    background-color: rgba(52, 152, 219, 0.7);
    border-color: var(--blue);
    box-shadow: 0 0 8px var(--blue);
}

.marker-inner-poi {
    background-color: rgba(243, 156, 18, 0.7);
    border-color: var(--amber);
    box-shadow: 0 0 8px var(--amber);
}

.marker-inner-fountain {
    background-color: rgba(0, 210, 255, 0.7);
    border-color: var(--cyan);
    box-shadow: 0 0 8px var(--cyan);
}

/* Pulsing Animation for Bosses and Portals */
@keyframes markerPulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.9; }
    100% { transform: scale(1); opacity: 1; }
}

.marker-inner-boss, .marker-inner-portal {
    animation: markerPulse 2.5s infinite ease-in-out;
}

/* Floating Navigation Controls */
.floating-btn {
    position: absolute;
    bottom: 24px;
    left: 24px;
    background: rgba(18, 20, 26, 0.9);
    border: 1px solid var(--gold);
    border-radius: 6px;
    color: var(--gold);
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 13px;
    letter-spacing: 1px;
    padding: 12px 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
}

.floating-btn:hover {
    background: var(--gold);
    color: #000;
    box-shadow: 0 0 15px var(--gold-glow);
}

/* Floating Panel (Search Results Autocomplete Dropdown) */
.floating-panel {
    position: absolute;
    top: 100%;
    left: 24px;
    right: 24px;
    width: calc(100% - 48px);
    max-height: 350px;
    background: rgba(18, 20, 26, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid var(--gold);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    z-index: 2000;
    overflow: hidden;
    margin-top: 4px;
}

.panel-header {
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
}

.panel-header h3 {
    font-family: var(--font-heading);
    font-size: 13px;
    color: var(--gold);
    letter-spacing: 1px;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #fff;
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.search-result-item {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    padding: 12px 18px;
    text-align: left;
    transition: all 0.2s;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.result-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.result-meta {
    font-family: var(--font-ui);
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
}

.result-type {
    text-transform: uppercase;
    font-weight: 700;
}

.result-type-quest { color: var(--gold); }
.result-type-boss { color: var(--crimson); }
.result-type-portal { color: var(--violet); }
.result-type-npc { color: var(--green); }
.result-type-location { color: var(--blue); }
.result-type-poi { color: var(--amber); }
.result-type-fountain { color: var(--cyan); }

/* Permanent Location Labels on Map */
.location-label {
    background: rgba(10, 11, 15, 0.8) !important;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(212, 175, 55, 0.4) !important;
    border-radius: 4px !important;
    color: #e6e8eb !important;
    font-family: var(--font-body) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 2px 6px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8) !important;
    pointer-events: none !important; /* Allow click-through to marker */
}

/* Hide the default Leaflet tooltip arrow */
.location-label::before {
    display: none !important;
}

/* Sidebar Footer Attribution */
.sidebar-footer {
    padding: 12px 24px;
    border-top: 1px solid rgba(212, 175, 55, 0.1);
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-footer p {
    font-family: var(--font-ui);
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.4;
}

.sidebar-footer a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s, text-shadow 0.2s;
}

.sidebar-footer a:hover {
    color: #fff;
    text-shadow: 0 0 4px var(--gold);
}


