/* ====================================
   Border Access Indicator Markers
   Extracted from styles.css for modularity
   ==================================== */

.border-access-marker {
    background: transparent !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.border-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(2px);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.border-badge:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.border-access-open {
    background: rgba(76, 175, 80, 0.85);
    color: #fff;
}

.border-access-restricted {
    background: rgba(255, 152, 0, 0.85);
    color: #fff;
}

.border-access-none {
    background: rgba(244, 67, 54, 0.85);
    color: #fff;
}

.border-access-unknown {
    background: rgba(100, 100, 100, 0.85);
    color: #ccc;
}

.border-badge-sep {
    opacity: 0.5;
    margin: 0 1px;
}

/* Stacked layout for asymmetric access (different each direction) */
.border-badge-stacked {
    flex-direction: column;
    padding: 2px 6px;
    gap: 0;
}

.border-badge-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    line-height: 1.2;
}

.border-badge-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.35);
    margin: 1px 0;
    width: 100%;
}

.border-dir {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

/* Icons inside border map badges should be white, not the colored
   inline styles injected by replaceSymbolsInText */
.border-badge .border-dir i.fa-right-left,
.border-badge .border-dir i.fa-arrow-up,
.border-badge .border-dir i.fa-arrow-down {
    color: inherit !important;
}

/* Coin icons blend with the gold restricted background — give them a dark outline */
.border-badge i.fa-coins {
    color: inherit !important;
    -webkit-text-stroke: 0.5px rgba(0, 0, 0, 0.6);
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

/* Border popup styles */
.border-popup {
    font-size: 0.85rem;
    line-height: 1.4;
}

.border-popup-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ddd;
}

.border-popup-row {
    margin-bottom: 6px;
}

.border-popup-row strong {
    color: #333;
}

.border-popup-access {
    margin-top: 2px;
    padding-left: 8px;
    font-size: 0.8rem;
}

.border-popup-notation {
    font-weight: 600;
}

/* Level indicator markers (up/down arrows beneath territory labels) */
.level-indicator-marker {
    background: transparent !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.level-indicator-up {
    background: rgba(30, 100, 180, 0.9);
    color: #fff;
}

.level-indicator-down {
    background: rgba(180, 80, 30, 0.9);
    color: #fff;
}

.level-indicator-up:hover,
.level-indicator-down:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* Level connection table inside level indicator popups */
.level-conn-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    margin-top: 4px;
    table-layout: fixed;
}

.level-conn-table .lct-hdr {
    font-size: 0.65rem;
    font-weight: 600;
    color: #888;
    padding: 2px 4px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    white-space: nowrap;
}

.level-conn-table .lct-level-hdr {
    padding: 2px 4px;
    border-bottom: 1px solid #ddd;
    width: 30px;
}

.level-conn-table .lct-hdr:nth-child(2),
.level-conn-table .lct-hdr:nth-child(3),
.level-conn-table .lct-hdr:nth-child(4) {
    width: calc((100% - 30px) / 3);
}

.level-conn-table .lct-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 3px;
    vertical-align: middle;
}

.level-conn-table .lct-level {
    font-weight: 700;
    font-size: 0.7rem;
    color: #555;
    white-space: nowrap;
    padding: 4px 6px 4px 2px;
    vertical-align: top;
    border-right: 1px solid #eee;
}

.level-conn-table .lct-cell {
    padding: 3px 4px;
    vertical-align: top;
    overflow-wrap: break-word;
    word-break: break-word;
}

.level-conn-table .lct-cell .popup-connection {
    font-size: 0.7rem;
    padding: 2px 6px;
    margin: 1px 0;
}

.level-conn-table tbody tr:not(:last-child) td {
    border-bottom: 1px solid #f0f0f0;
}

/* Current-level row highlight */
.level-conn-table .lct-current-cell {
    background: rgba(0, 0, 0, 0.05);
}

.level-conn-table tr.lct-current .lct-level {
    color: #7e57c2;
    font-weight: 700;
}

/* Recalculate Borders button in edit status bar */
#recalc-borders-btn {
    background: rgba(156, 39, 176, 0.3);
    border: 1px solid rgba(156, 39, 176, 0.5);
    color: #ce93d8;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

#recalc-borders-btn:hover {
    background: rgba(156, 39, 176, 0.5);
}

#recalc-borders-btn .fa-spinner {
    display: none;
}

#recalc-borders-btn.loading .fa-spinner {
    display: inline-block;
}

#recalc-borders-btn.loading .fa-border-all {
    display: none;
}
