/* === LAYOUT: sidebar + full-height map === */

/* Fullscreen map page layout – no scrollbar */
.page-id-305 body {
    overflow: hidden !important;
}

/* Ensure root container fills viewport (subtract header + admin bar automatically) */
.page-id-305 .wosb-map-layout--full {
    height: calc(100vh - var(--wp-admin-bar-offset, 0px));
    overflow: hidden;
}

/* Adjust WP admin bar height automatically */


.wosb-map-layout--full {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    /* fill most of the viewport, adjust 120px if needed */
    min-height: calc(100vh - 120px);
    box-sizing: border-box;
    overflow: hidden;  /* prevent inner overflow from creating extra scroll */
}

/* Sidebar */
.wosb-map-sidebar {
    width: 260px;
    max-width: 40vw;
    padding: 1rem 1.25rem;
    background: radial-gradient(circle at top, #020617 0, #020617 45%, #020617 100%);
    color: #f9fafb;
    border-right: 1px solid rgba(148, 163, 184, 0.3);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* HEADER + SEARCH */
.wosb-map-sidebar__header {
    margin-bottom: 0.75rem;
}

.wosb-map-sidebar__title {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0 0 0.25rem;
}

.wosb-map-sidebar__subtitle {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    color: #9ca3af;
}

.wosb-map-sidebar__search {
    margin-bottom: 0.75rem;
}

.wosb-map-filter-search {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.95);
    color: #e5e7eb;
    font-size: 0.8rem;
}

.wosb-map-filter-search::placeholder {
    color: #6b7280;
}

.wosb-map-sidebar__section {
    margin-bottom: 1rem;
}

/* SECTION TITLES */
.wosb-map-sidebar__section-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #e5e7eb;
    margin: 0 0 0.4rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    padding-bottom: 0.25rem;
}

.wosb-map-sidebar__section--presets {
    margin-bottom: 1.1rem;
}

.wosb-map-sidebar__section--hint {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: auto; /* push to bottom */
}

/* PRESETS */
.wosb-map-presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

/* FULL-WIDTH for the first button */
.wosb-map-preset--all {
    grid-column: 1 / -1;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    background: #334155;
    color: #f9fafb;
    border-color: rgba(255,255,255,0.2);
}

.wosb-map-preset--all:hover {
    background: #475569;
    border-color: rgba(255,255,255,0.3);
}

/* Normal half-width buttons */
.wosb-map-preset {
    background: rgba(15, 23, 42, 0.85);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    color: #e5e7eb;
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: 0.15s ease;
}

.wosb-map-preset:hover {
    background: rgba(30, 58, 138, 0.85);
    border-color: rgba(99, 102, 241, 0.8);
}

.wosb-map-preset:active {
    transform: translateY(0);
}

/* FILTER GROUPS / ROWS */
.wosb-map-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.wosb-map-filter {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.55rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    color: #e5e7eb;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.wosb-map-filter:hover {
    background: rgba(15,23,42,1);
    border-color: rgba(255,255,255,0.15);
}

.wosb-map-filter__checkbox {
    accent-color: #D9B56F;
    width: 14px;
    height: 14px;
}

/* Example color coding (you can swap these for real images) */
.wosb-map-filter__icon--neutral    { background-image: url('/wp-content/plugins/wosb-trade-tools/assets/images/port-neutral.png'); }
.wosb-map-filter__icon--pirate     { background-image: url('/wp-content/plugins/wosb-trade-tools/assets/images/port-pirate.png'); }
.wosb-map-filter__icon--settlement { background-image: url('/wp-content/plugins/wosb-trade-tools/assets/images/port-settlement.png'); }
.wosb-map-filter__icon--trade      { background-image: url('/wp-content/plugins/wosb-trade-tools/assets/images/port-trade.png'); }

.wosb-map-filter__icon--island     { background-image: url('/wp-content/plugins/wosb-trade-tools/assets/images/poi-island.png'); }
.wosb-map-filter__icon--lighthouse { background-image: url('/wp-content/plugins/wosb-trade-tools/assets/images/poi-lighthouse.png'); }

.wosb-map-filter__icon--coal       { background-image: url('/wp-content/plugins/wosb-trade-tools/assets/images/poi-prod-coal.png'); }
.wosb-map-filter__icon--iron       { background-image: url('/wp-content/plugins/wosb-trade-tools/assets/images/poi-prod-iron.png'); }
.wosb-map-filter__icon--wood       { background-image: url('/wp-content/plugins/wosb-trade-tools/assets/images/poi-prod-wood.png'); }
.wosb-map-filter__icon--resin      { background-image: url('/wp-content/plugins/wosb-trade-tools/assets/images/poi-prod-resin.png'); }
.wosb-map-filter__icon--rum        { background-image: url('/wp-content/plugins/wosb-trade-tools/assets/images/poi-prod-rum.png'); }
.wosb-map-filter__icon--farm       { background-image: url('/wp-content/plugins/wosb-trade-tools/assets/images/poi-prod-farm.png'); }
.wosb-map-filter__icon--copper       { background-image: url('/wp-content/plugins/wosb-trade-tools/assets/images/poi-prod-copper.png'); }
.wosb-map-filter__icon--water       { background-image: url('/wp-content/plugins/wosb-trade-tools/assets/images/poi-prod-water.png'); }

.wosb-map-filter__icon--altar      { background-image: url('/wp-content/plugins/wosb-trade-tools/assets/images/poi-altar.png'); }
.wosb-map-filter__icon--fort       { background-image: url('/wp-content/plugins/wosb-trade-tools/assets/images/poi-fort.png'); }
.wosb-map-filter__icon--printshop  { background-image: url('/wp-content/plugins/wosb-trade-tools/assets/images/poi-printshop.png'); }

.wosb-map-filter__label {
    flex: 1;
    color: #e5e7eb;
    font-weight: 500;
}

/* LITTLE ICON DOTS (hook these up to image URLs later if you want) */
.wosb-map-filter__icon {
    width: 25px;
    height: 25px;
    border-radius: 999px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 3px rgba(0,0,0,0.6);
    flex-shrink: 0;
}

/* SECTION HEADER + COLLAPSE BUTTON */
.wosb-map-sidebar__section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.3rem;
}

.wosb-map-section-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: transparent;
    border: none;
    padding: 0;
    color: #e5e7eb;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.wosb-map-section-toggle__icon {
    font-size: 0.8rem;
    opacity: 0.7;
    transition: transform 0.15s ease;
}

.wosb-map-section-actions {
    display: flex;
    gap: 0.25rem;
}

.wosb-map-section-action {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: rgba(15,23,42,0.8);
    color: #e5e7eb;
    font-size: 0.7rem;
    padding: 0.05rem 0.4rem;
    cursor: pointer;
}

/* Collapsed state */
.wosb-map-sidebar__section--collapsed .wosb-map-filter-group {
    display: none;
}

.wosb-map-sidebar__section--collapsed .wosb-map-section-toggle__icon {
    transform: rotate(-90deg);
}

/* === MAP CONTAINER === */

.wosb-map-fullpage {
    flex: 1;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

#wosb-fullmap,
#wosb-fullmap.leaflet-container {
    width: 100%;
    height: 100%;
    margin: 0;
    background: transparent;
}

/* === TOOLTIPS === */
.wosb-map-tooltip {
    min-width: 230px;
    max-width: 320px;
    font-size: 12px;
    line-height: 1.3;
}

.wosb-map-tooltip-container {
    background: rgba(15, 23, 42, 0.95);
    border-radius: 0.5rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.7);
}

/* Header row: icon + title block side by side */
.wosb-map-tooltip__header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;                /* spacing between icon + text */
    margin-bottom: 6px;
}

/* Icon container – fixed square */
.wosb-map-tooltip__icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
}

/* Icon image – keep natural aspect ratio */
.wosb-map-tooltip__icon img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
}

/* Title + coords block aligned to the left */
.wosb-map-tooltip__titleblock {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

/* Strong title */
.wosb-map-tooltip__name {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

/* Muted coords */
.wosb-map-tooltip__coords {
    font-size: 11px;
    margin-top: 2px;
    color: rgba(226, 232, 240, 0.75);
}

.wosb-map-tooltip__type {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a5b4fc;
}

/* === RESPONSIVE === */

@media (max-width: 768px) {
    .wosb-map-layout--full {
        flex-direction: column;
        min-height: calc(100vh - 100px);
    }

    .wosb-map-sidebar {
        width: 100%;
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(148, 163, 184, 0.3);
    }

    .wosb-map-fullpage {
        min-height: calc(100vh - 160px);
    }
}

.wosb-pvp-tooltip {
    background: rgba(10, 10, 10, 0.85);
    border-radius: 999px;
    padding: 2px 8px;
    border: 1px solid #b92b2b;
    font-size: 11px;
    color: #f5e6c0;
}

/* Base tooltip shell (you already have this) */
.leaflet-tooltip.wosb-map-tooltip-container {
    background: radial-gradient(circle at top, #151f32 0, #050813 70%);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 10px;
    color: #f7f7ff; /* fallback text color */
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.7);
}

/* Make sure everything inside POI tooltips is fully visible */
.wosb-map-tooltip--poi,
.wosb-map-tooltip--poi * {
    color: #e5e7eb;
}

/* Body section */
.wosb-map-tooltip__body {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* Clean, aligned rows */
.wosb-map-tooltip__meta-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    line-height: 1.4;
}

.wosb-map-tooltip__meta-label {
    min-width: 80px;          /* aligns CATEGORY/TYPE perfectly */
    opacity: 0.8;
}

.wosb-map-tooltip__meta-value {
    font-weight: 500;
    color: #ffffff;
    text-align: left;            /* no need for right-align now */
}


/* Optional notes line */
.wosb-map-tooltip__notes {
    margin-top: 5px;
    font-size: 11px;
    opacity: 0.9;
}

.wosb-map-tooltip__market {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(17,24,39,0.6) 0%, rgba(7,11,22,0.9) 100%);
    border-radius: 8px;
    padding: 8px 8px 6px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.wosb-map-tooltip__market-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #cbd5f1;
    margin-bottom: 4px;
    opacity: 0.85;
}

.wosb-map-tooltip__market-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* Remove default table borders inside the tooltip */
.wosb-map-tooltip__market-table,
.wosb-map-tooltip__market-table th,
.wosb-map-tooltip__market-table td {
    border: none;
}

.wosb-map-tooltip__market-row {
    font-size: 11px;
    color: #e5e7eb;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.wosb-map-tooltip__market-row:last-child {
    border-bottom: none;
}

.wosb-map-tooltip__market-row td {
    padding: 2px 0;
    vertical-align: middle;
}

.wosb-map-tooltip__market-thumb {
    width: 30px;
    text-align: left;
}

.wosb-map-tooltip__market-thumb-img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    display: inline-block;
    box-shadow: 0 0 6px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.wosb-map-tooltip__market-thumb-img--placeholder {
    background: rgba(255,255,255,0.05);
}

.wosb-map-tooltip__market-resource {
    text-align: left;
    padding-left: 2px;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.wosb-map-tooltip__market-price {
    text-align: right;
    padding-right: 2px;
    white-space: nowrap;
    font-weight: 600;
    font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.7rem;
}

.wosb-map-tooltip__market-price-buy {
    color: #4ade80;  /* green */
}

.wosb-map-tooltip__market-price-sell {
    color: #f97316;  /* orange */
}

.wosb-map-tooltip__market-head th {
    font-size: 9px;
    padding: 0 0 2px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(148, 163, 184, 0.9);
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
}

/* thumb column (blank header) */
.wosb-map-tooltip__market-head-thumb,
.wosb-map-tooltip__market-thumb {
    width: 28px;
    padding-right: 4px;
}

/* resource column */
.wosb-map-tooltip__market-resource,
.wosb-map-tooltip__market-head-resource {
    text-align: left;
    padding-right: 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* buy/sell columns */
.wosb-map-tooltip__market-price,
/* BUY / SELL header alignment */
/* BUY / SELL header alignment */
.wosb-map-tooltip__market-head-buy,
.wosb-map-tooltip__market-head-sell {
    text-align: right;
    width: 32px;
}
/* keep the color split we added earlier */
.wosb-map-tooltip__market-price-buy {
    color: #4ade80; /* buy = green */
}

.wosb-map-tooltip__market-price-sell {
    color: #f97316; /* sell = orange */
}

.wosb-map-tooltip__market-mode {
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.68rem;
}

.wosb-map-tooltip__market-head-mode {
    text-align: center;
    width: 48px;
}

.wosb-map-tooltip__market-head-price {
    text-align: right;
    width: 48px;
}

.wosb-market-mode--buy {
    color: #4ade80;
}

.wosb-market-mode--sell {
    color: #f97316;
}

/* === MARKET BLOCK REFINEMENTS ======================================= */

/* Section label "MARKET" */
.wosb-map-tooltip__market-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(203, 213, 225, 0.9);
    margin-bottom: 4px;
}

/* Whole market block */
.wosb-map-tooltip__market {
    margin-top: 6px;
    padding: 6px 8px;
    border-radius: 8px;
    background: radial-gradient(circle at top left,
        rgba(15, 23, 42, 0.98),
        rgba(15, 23, 42, 0.90));
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9),
                0 8px 16px rgba(0, 0, 0, 0.6);
}

/* Thin accent bar on the left of the market block */
.wosb-map-tooltip__market::before {
    content: "";
    position: absolute;
    left: -2px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    border-radius: 999px;
    /* background: linear-gradient(to bottom, #22c55e, #f97316); */
}

/* Make sure the pseudo-element positions correctly */
.wosb-map-tooltip__market {
    position: relative;
}

/* Table layout */
.wosb-map-tooltip__market-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

/* Header row: RESOURCE | BUY | SELL */
.wosb-map-tooltip__market-head th {
    font-size: 0.68rem;
    padding: 0 0 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(148, 163, 184, 0.95);
    border-bottom: 1px solid rgba(51, 65, 85, 0.9);
}

/* Columns */
.wosb-map-tooltip__market-thumb,
.wosb-map-tooltip__market-head-thumb {
    width: 30px;
    padding-right: 6px;
}

.wosb-map-tooltip__market-resource,
.wosb-map-tooltip__market-head-resource {
    text-align: left;
    padding-right: 8px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #e5e7eb;
    font-size: 0.78rem;
}

.wosb-map-tooltip__market-price,
.wosb-map-tooltip__market-head-buy,
.wosb-map-tooltip__market-head-sell {
    width: 42px;
    text-align: right;
    white-space: nowrap;
}

/* Rows */
.wosb-map-tooltip__market-row {
    font-size: 0.78rem;
    color: #e5e7eb;
    border-bottom: 1px solid rgba(30, 41, 59, 0.9);
}

.wosb-map-tooltip__market-row:last-child {
    border-bottom: none;
}

/* Subtle hover highlight on each resource row */
.wosb-map-tooltip__market-row:hover {
    background: rgba(15, 23, 42, 0.95);
}

/* Prices (keep the green/orange split) */
.wosb-map-tooltip__market-price {
    padding-right: 2px;
    font-weight: 600;
    font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
                 "Liberation Mono", "Courier New", monospace;
    font-size: 0.72rem;
}

.wosb-map-tooltip__market-price-buy {
    color: #4ade80;
}

.wosb-map-tooltip__market-price-sell {
    color: #f97316;
}

/* Resource icon cell */
.wosb-map-tooltip__market-thumb-img {
    display: block;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
}
