/* ============================================================
   TERRANOVA INTERACTIVE MAP — web version
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    background: #0a0c10;
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    overflow: hidden;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   TRI-FOLD WRAPPER — fills the viewport
   ============================================================ */
#map-wrapper {
    display: flex;
    flex-direction: row;
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

/* ============================================================
   PANELS — shared
   ============================================================ */
.panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #111318;
    overflow: hidden;
    position: relative;
}

.panel-left {
    width: 26%;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.07);
}

.panel-center {
    flex: 1;
    position: relative;
    z-index: 2;
    background: #0d0f12;
}

.panel-right {
    width: 26%;
    flex-shrink: 0;
    border-left: 1px solid rgba(255,255,255,0.07);
}

/* ============================================================
   SIDE PANEL INNER SCROLL
   ============================================================ */
.panel-inner {
    height: 100%;
    overflow-y: auto;
    padding: 8px 0 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(214,31,92,0.3) transparent;
}

.panel-inner::-webkit-scrollbar { width: 3px; }
.panel-inner::-webkit-scrollbar-thumb {
    background: rgba(214,31,92,0.3);
    border-radius: 2px;
}

/* ============================================================
   LAND SECTIONS
   ============================================================ */
.land {
    margin: 0;
    cursor: default;
}

.land-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px 7px;
    user-select: none;
    position: relative;
    border-left: 3px solid transparent;
}

.land-name {
    font-family: 'Poppins', sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.2;
}

.land-badge {
    font-family: 'Montserrat', sans-serif;
    font-size: 7.5px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.15);
    padding: 2px 6px;
    border-radius: 20px;
    white-space: nowrap;
}

.land-list {
    list-style: none;
    padding: 4px 14px 6px 14px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.land-list li {
    display: flex;
    align-items: baseline;
    gap: 7px;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    color: rgba(255,255,255,0.65);
    padding: 3.5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    line-height: 1.3;
    font-weight: 400;
}

.land-list li:last-child { border-bottom: none; }

.postal {
    font-family: 'Poppins', monospace;
    font-size: 8.5px;
    font-weight: 600;
    color: rgba(214,31,92,0.8);
    background: rgba(214,31,92,0.08);
    padding: 1px 5px;
    border-radius: 4px;
    white-space: nowrap;
    min-width: 34px;
    text-align: center;
    flex-shrink: 0;
}

/* Hover highlight */
.land.highlighted .land-header {
    background: rgba(214,31,92,0.06);
    border-left-color: #d61f5c;
}

.land.highlighted .land-list {
    background: rgba(214,31,92,0.03);
}

.land.highlighted .land-list li {
    color: rgba(255,255,255,0.85);
}

/* ============================================================
   CENTER PANEL — MAP
   ============================================================ */
.panel-center {
    display: flex;
    flex-direction: column;
}

.map-title-bar {
    background: #0d0f12;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 11px 20px 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-title-text { text-align: center; }

.title-main {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    line-height: 1;
}

.title-sub {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 7px;
    font-weight: 500;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-top: 4px;
}

/* ============================================================
   MAP CONTAINER + SVG OVERLAY
   ============================================================ */
.map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #0a0c10;
}

#gtav-map {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    filter: brightness(0.85) saturate(0.9);
}

#region-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: all;
}

.region-label {
    font-family: 'Poppins', sans-serif;
    font-size: 8px;
    font-weight: 700;
    fill: rgba(255,255,255,0.95);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    pointer-events: none;
    paint-order: stroke;
    stroke: rgba(0,0,0,0.4);
    stroke-width: 2px;
}

/* ============================================================
   HOVER INFO CARD
   ============================================================ */
#hover-card {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: min(340px, 85%);
    background: rgba(13, 15, 18, 0.97);
    border: 1px solid rgba(255,255,255,0.1);
    border-top: 2px solid #d61f5c;
    border-radius: 8px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 10;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

#hover-card.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(6px);
}

#hover-card-header {
    padding: 10px 16px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

#hover-card-name {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

#hover-card-tagline {
    padding: 7px 16px 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: 9.5px;
    color: rgba(255,255,255,0.5);
    font-style: italic;
    line-height: 1.5;
    font-weight: 400;
}

#hover-card-list {
    list-style: none;
    padding: 4px 16px 12px;
    columns: 2;
    column-gap: 12px;
}

#hover-card-list li {
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    color: rgba(255,255,255,0.75);
    padding: 2.5px 0;
    padding-left: 10px;
    position: relative;
    line-height: 1.3;
    break-inside: avoid;
    font-weight: 500;
}

#hover-card-list li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: #d61f5c;
    font-size: 12px;
    line-height: 1;
}

/* ============================================================
   MAP FOOTER
   ============================================================ */
.map-footer {
    background: #0d0f12;
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 6px 14px;
    text-align: center;
    flex-shrink: 0;
}

.map-footer span {
    font-family: 'Montserrat', sans-serif;
    font-size: 8.5px;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ============================================================
   INDIVIDUAL ITEM TOOLTIP
   ============================================================ */
#item-tooltip {
    position: fixed;
    max-width: 240px;
    background: rgba(10, 12, 16, 0.97);
    border: 1px solid rgba(255,255,255,0.12);
    border-left: 2px solid #d61f5c;
    border-radius: 8px;
    padding: 10px 14px 11px;
    pointer-events: none;
    z-index: 20000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    transition: opacity 0.15s;
}

#item-tooltip.hidden {
    opacity: 0;
    pointer-events: none;
}

#item-tooltip-name {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 5px;
}

#item-tooltip-desc {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    color: rgba(255,255,255,0.65);
    line-height: 1.5;
    font-weight: 400;
}

/* Hoverable list items */
li.has-desc {
    cursor: default;
    border-radius: 3px;
    transition: background 0.15s, color 0.15s;
    padding-left: 3px;
    margin-left: -3px;
}

li.has-desc:hover {
    background: rgba(214,31,92,0.08);
    color: rgba(255,255,255,0.9) !important;
}

/* ============================================================
   MAP MARKER PILLS
   ============================================================ */
.map-marker rect {
    transition: fill-opacity 0.2s;
}

.map-marker:hover rect,
.map-marker.highlighted rect {
    fill-opacity: 1 !important;
    stroke: rgba(255,255,255,0.7) !important;
    stroke-width: 1.5 !important;
}

/* ============================================================
   RESPONSIVE — narrow screens get stacked panels
   ============================================================ */
@media (max-width: 900px) {
    #map-wrapper {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
    }

    .panel-left,
    .panel-right {
        width: 100%;
        height: auto;
        border-right: none;
        border-left: none;
        border-bottom: 1px solid rgba(255,255,255,0.07);
    }

    .panel-inner {
        height: auto;
        overflow-y: visible;
        max-height: none;
    }

    .panel-center {
        height: 60vw;
        min-height: 300px;
        flex-shrink: 0;
    }

    .panel-left  { order: 2; }
    .panel-center { order: 1; }
    .panel-right { order: 3; }
}
