:root {
    /* Premium Dark Mode Colors */
    --bg-base: #0f172a;
    --bg-glass: rgba(15, 23, 42, 0.75);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --accent-glow: rgba(56, 189, 248, 0.4);
    --card-bg: rgba(30, 41, 59, 0.85);

    /* Industry Colors */
    --color-agriculture: #10b981; /* Emerald */
    --color-construction: #f59e0b; /* Amber */
    --color-digital: #3b82f6; /* Blue */
    --color-energy: #eab308; /* Yellow */
    --color-food: #f43f5e; /* Rose */
    --color-manufacturing: #8b5cf6; /* Violet */
    --color-tourism: #06b6d4; /* Cyan */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-base);
    color: var(--text-main);
}

/* Map Container */
#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* UI Wrapper */
.ui-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none; /* Let clicks pass through to map */
    display: flex;
    flex-direction: column;
    padding: 24px;
}

/* Glassmorphism Panel Base */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    pointer-events: auto; /* Re-enable clicks for UI elements */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.white-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
}

/* Header */
.header-panel {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    gap: 20px;
    margin-bottom: 24px;
    max-width: 500px;
}

.logo-container {
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.title-container h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    color: #93b230;
}

.title-container p {
    font-size: 13px;
    color: #2e4a75;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Sidebar Filter */
.sidebar {
    padding: 24px;
    width: 320px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) transparent;
}

.sidebar h2 {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

ul#industry-filter {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    background: rgba(255,255,255,0.02);
    border: 1px solid transparent;
    transition: all 0.2s ease;
    font-size: 15px;
    font-weight: 400;
}

.filter-item:hover {
    background: rgba(255,255,255,0.06);
    transform: translateX(4px);
}

.filter-item.active {
    background: rgba(255,255,255,0.1);
    border-color: var(--border-glass);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px currentColor;
}

/* Details Panel (Bottom or Side depending on screen) */
.details-panel {
    position: absolute;
    bottom: 24px;
    left: 24px;
    width: 380px;
    padding: 24px;
    transform: translateY(0);
    opacity: 1;
}

.details-panel.hidden {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-main);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10;
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
}

.pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    background: rgba(255,255,255,0.1);
}

.details-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.details-content .address {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    width: 100%;
}

.primary-btn {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

/* Map Markers */
.custom-marker {
    position: relative;
    width: 0;
    height: 0;
    cursor: pointer;
}

.custom-marker:hover, .custom-marker.active {
    z-index: 1000 !important;
}

.marker-shadow {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    filter: blur(2px);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
}

.custom-marker:hover .marker-shadow, .custom-marker.active .marker-shadow {
    width: 22px;
    height: 8px;
    background: rgba(0, 0, 0, 0.25);
    filter: blur(3px);
}

.marker-content {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Invisible hitbox to prevent hover jitter when translating up */
.marker-content::before {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -20px;
    right: -20px;
    top: -20px;
    z-index: -1;
}

.custom-marker:hover .marker-content, .custom-marker.active .marker-content {
    transform: translate(-50%, -8px);
}

.marker-pin {
    width: 24px;
    height: 24px;
    border-radius: 50% 50% 50% 0;
    background: var(--accent);
    transform: rotate(-45deg);
    box-shadow: inset -2px 2px 4px rgba(0,0,0,0.2);
    border: 2px solid #fff;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.marker-pin::after {
    content: '';
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

.marker-label {
    margin-bottom: 6px;
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-glass);
    color: #fff;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: normal;
    text-align: center;
    max-width: 280px;
    word-wrap: break-word;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s ease;
    line-height: 1.25;
}

.custom-marker:hover .marker-label, .custom-marker.active .marker-label {
    opacity: 1;
    transform: translateY(0);
}

.marker-inline-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
    background: white;
    border: 2px solid rgba(255,255,255,0.3);
    margin-bottom: 0;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-marker.active .marker-inline-logo {
    opacity: 1;
    max-height: 64px;
    margin-bottom: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Mapbox specific overrides */
.maplibregl-ctrl-bottom-right {
    z-index: 2;
}

/* Hidden utility classes */
.hidden-desktop {
    display: none !important;
}

/* Responsive Mobile Layout */
@media (max-width: 768px) {
    .hidden-desktop {
        display: flex !important;
    }

    .ui-wrapper {
        padding: 16px;
        justify-content: space-between;
    }

    .header-panel {
        position: relative;
        margin-bottom: 0;
        max-width: none;
    }

    #mobile-filter-btn {
        position: absolute;
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
        padding: 12px 24px;
        font-size: 15px;
        font-weight: 600;
        color: #fff;
        border: none;
        cursor: pointer;
        z-index: 50;
    }

    .sidebar {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 20px 20px 0 0;
        flex-direction: column;
        overflow-y: auto;
        padding: 24px;
        z-index: 100;
        transform: translateY(150%);
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .sidebar.open {
        transform: translateY(0);
        visibility: visible;
    }

    .sidebar h2 {
        display: block;
    }

    .sidebar-header .close-btn {
        position: static;
        flex-shrink: 0;
    }

    .details-panel {
        bottom: 70px; /* Leave space for the filter button */
        left: 16px;
        right: 16px;
        width: auto;
        max-width: none;
        z-index: 20;
    }
}
