/* =========================================================================
   Infopolitie – Verkeersborden extension
   Styles for [bord] and [onderbord] BBCodes + browse pages
   ========================================================================= */

/* --- Inline BBCode: [bord]A01[/bord] ------------------------------------ */

.ip-bord {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
    max-width: 88px;
    text-align: center;
    font-size: 0.75em;
    text-decoration: none !important;
    color: inherit;
    margin: 0 3px;
    cursor: pointer;
}

.ip-bord a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.ip-bord__img {
    display: block;
    max-height: 60px;
    max-width: 88px;
    width: auto;
    height: auto;
}

.ip-bord__naam {
    display: block;
    font-size: 0.85em;
    color: #555;
    margin-top: 2px;
}

.ip-bord--unknown {
    display: inline-block;
    background: #fff0f0;
    border: 1px solid #ffcccc;
    padding: 2px 5px;
    color: #cc0000;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.85em;
}

/* --- Inline BBCode: [onderbord]text[/onderbord] -------------------------- */

.ip-onderbord {
    display: inline-block;
    background: #ffffff;
    border: 2px solid #333333;
    padding: 1px 7px;
    font-size: 0.82em;
    font-weight: bold;
    color: #333333;
    border-radius: 2px;
    vertical-align: middle;
    margin: 0 3px;
}

/* --- Inline BBCode: [wahv]K030a[/wahv] ----------------------------------- */

.ip-wahv {
    display: inline-block;
    background: var(--ip-surface-2);
    border-left: 4px solid #8a9bb5;
    padding: 3px 8px 3px 10px;
    font-size: 0.85em;
    color: var(--ip-text);
    border-radius: 0 3px 3px 0;
    vertical-align: middle;
    margin: 0 3px;
    cursor: default;
}

[data-theme="dark"] .ip-wahv {
    border-left-color: var(--ip-blue);
}

.ip-wahv__code {
    font-weight: bold;
    font-family: monospace;
    color: var(--ip-text-muted);
    margin-right: 5px;
}

.ip-wahv__omschrijving {
    color: var(--ip-text);
}

.ip-wahv__boete {
    margin-left: 6px;
    font-weight: bold;
    color: var(--ip-blue);
    white-space: nowrap;
}

.ip-wahv--unknown {
    background: #fff0f0;
    border-left-color: #cc6666;
    color: #cc0000;
    font-family: monospace;
}

/* --- Browse page: category grid ----------------------------------------- */

.borden-header {
    margin-bottom: 16px;
}

.borden-header h2 {
    margin-bottom: 4px;
}

.borden-breadcrumb {
    font-size: 0.9em;
    margin-bottom: 12px;
    color: #666;
}

.borden-breadcrumb a {
    color: #336699;
}

.borden-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0;
}

.borden-cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 160px;
    padding: 20px 12px;
    background: #f5f7f9;
    border: 1px solid #dde;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    text-align: center;
    transition: background 0.15s;
}

.borden-cat-card:hover {
    background: #e8edf5;
    border-color: #99b;
}

/* --- Browse page: sign grid ---------------------------------------------- */

.borden-sign-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
    padding: 10px 6px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 0.8em;
    text-align: center;
    transition: background 0.15s;
}

.borden-sign-card:hover {
    background: #ecf0f8;
    border-color: #99b;
}

.borden-sign-img {
    display: block;
    max-height: 70px;
    max-width: 90px;
    width: auto;
    height: auto;
    margin-bottom: 6px;
}

.borden-sign-naam {
    font-weight: bold;
    word-break: break-all;
}

.borden-sign-sub {
    font-size: 0.85em;
    color: #777;
    margin-top: 2px;
}

/* --- Detail page --------------------------------------------------------- */

.borden-detail {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.borden-detail-image {
    flex-shrink: 0;
}

.borden-detail-img {
    max-height: 200px;
    max-width: 200px;
    width: auto;
    height: auto;
    display: block;
    border: 1px solid #ddd;
    padding: 8px;
    background: #fff;
    border-radius: 4px;
}

.borden-detail-info h2 {
    margin-top: 0;
}

.borden-detail-voluit {
    font-size: 1em;
    color: #555;
}

.borden-fine {
    text-align: right;
    white-space: nowrap;
}

.borden-no-fines {
    color: #888;
    font-style: italic;
}

.borden-footnote {
    font-size: 0.85em;
    color: #888;
    margin-top: 0.4em;
}

.borden-cat-label {
    font-size: 0.8em;
    color: #777;
    font-style: italic;
}

.borden-count {
    text-align: right;
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 600px) {
    .borden-detail {
        flex-direction: column;
    }

    .borden-sign-card {
        width: 76px;
    }

    .borden-cat-card {
        width: 130px;
    }
}

/* =========================================================================
   Editor toolbar: custom BBCode buttons + sign/WAHV picker modals
   ========================================================================= */

.ip-abbc3-sep {
    display: inline-block;
    width: 1px;
    height: 22px;
    background: var(--ip-border);
    vertical-align: middle;
    margin: 0 6px;
}

/* ── Picker overlay (full-screen backdrop) ───────────────────────────────── */

.ip-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 60px;
}

/* ── Dialog box ──────────────────────────────────────────────────────────── */

.ip-picker-dialog {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .35);
    width: 660px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ip-picker-dialog--wahv {
    width: 500px;
}

.ip-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #ddd;
    background: #f3f3f3;
    flex-shrink: 0;
}

.ip-picker-header strong {
    font-size: 14px;
}

.ip-picker-close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0 2px;
}

.ip-picker-close:hover {
    color: #000;
}

/* ── Category tabs ───────────────────────────────────────────────────────── */

.ip-picker-tabs {
    display: flex;
    gap: 3px;
    padding: 8px 12px 0;
    background: #f7f7f7;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
}

.ip-picker-tab {
    padding: 5px 14px;
    border: 1px solid #ccc;
    border-bottom: none;
    background: #eee;
    cursor: pointer;
    font-size: 13px;
    border-radius: 3px 3px 0 0;
}

.ip-picker-tab.active {
    background: #fff;
    border-color: #aaa;
    font-weight: bold;
    color: #2a5a8c;
}

/* ── Subcategory buttons ─────────────────────────────────────────────────── */

.ip-picker-subcats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    max-height: 96px;
    overflow-y: auto;
    flex-shrink: 0;
}

.ip-picker-subcat {
    padding: 3px 10px;
    border: 1px solid #ccc;
    background: #f4f4f4;
    cursor: pointer;
    font-size: 12px;
    border-radius: 3px;
    white-space: nowrap;
}

.ip-picker-subcat.active {
    background: #2a5a8c;
    color: #fff;
    border-color: #1e4070;
}

/* ── Sign grid ───────────────────────────────────────────────────────────── */

.ip-picker-grid {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
    min-height: 160px;
}

.ip-picker-grid > em {
    width: 100%;
    color: #888;
    font-style: italic;
    font-size: 13px;
}

.ip-picker-sign {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 72px;
    cursor: pointer;
    padding: 6px 4px;
    border-radius: 4px;
    border: 2px solid transparent;
    text-align: center;
    transition: border-color .12s, background .12s;
}

.ip-picker-sign:hover {
    border-color: #2a5a8c;
    background: #eef4fb;
}

.ip-picker-sign img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.ip-picker-sign span {
    font-size: 11px;
    color: #444;
    margin-top: 3px;
    word-break: break-all;
}

/* ── WAHV search modal ───────────────────────────────────────────────────── */

.ip-picker-search {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.ip-picker-search input {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
}

.ip-picker-results {
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
    max-height: 380px;
    padding: 2px 0;
}

.ip-picker-results > em {
    display: block;
    padding: 12px 16px;
    color: #888;
    font-style: italic;
    font-size: 13px;
}

.ip-wahv-result {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

.ip-wahv-result:hover {
    background: #eef4fb;
}

.ip-wahv-result strong {
    font-family: monospace;
    color: #2a5a8c;
    margin-right: 6px;
}

/* =========================================================================
   Sign panel: [panel=green/yellow/white/blue]
   ========================================================================= */

.ip-panel {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 18px;
    border-radius: 3px;
    vertical-align: middle;
    margin: 4px 3px;
    text-align: center;
}

.ip-panel .ip-bord__naam {
    display: none;
}

.ip-panel--green {
    background: #b8ff3c;
    border: 4px solid #1a1a1a;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, .4);
}

.ip-panel--yellow {
    background: #ffd000;
    border: 4px solid #1a1a1a;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, .35);
}

.ip-panel--white {
    background: #ffffff;
    border: 3px solid #1a1a1a;
    box-shadow: 1px 1px 4px rgba(0, 0, 0, .2);
}

.ip-panel--blue {
    background: #003b8e;
    border: 3px solid #ffffff;
    outline: 2px solid #003b8e;
    box-shadow: 1px 1px 4px rgba(0, 0, 0, .3);
}

.ip-panel--blue .ip-onderbord {
    color: #ffffff;
}

.ip-panel-btn-wrap {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

#ip-panel-swatches {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid #bbb;
    border-radius: 4px;
    padding: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
    flex-direction: row;
    gap: 5px;
    white-space: nowrap;
}

#ip-panel-swatches.open {
    display: flex;
}

.ip-panel-swatch {
    width: 28px;
    height: 28px;
    border-radius: 3px;
    cursor: pointer;
    border: 2px solid #444;
    padding: 0;
}

.ip-panel-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}

.ip-panel-swatch--green  { background: #b8ff3c; }
.ip-panel-swatch--yellow { background: #ffd000; }
.ip-panel-swatch--white  { background: #ffffff; }
.ip-panel-swatch--blue   { background: #003b8e; border-color: #003b8e; outline: 1px solid #888; }
