/* Atlas — faction warfare dashboard (builds on ../styles.css for the shared chrome). */

[hidden] { display: none !important; }

#mainWrapper { overflow: hidden; }            /* the page does not scroll: each column scrolls inside */

/* ---------------- toolbar ---------------- */

#fwBar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 8px 14px;
    background-color: var(--backgroundColor);
    border-bottom: 1px solid var(--borderColor31);
    flex-shrink: 0;
}
#fwTitle {
    font-family: 'Shentox Medium', 'Segoe UI', sans-serif;
    font-size: 1.3571em;
    color: var(--themeColor);
    letter-spacing: 3px;
}
#fwNote { font-size: 0.8214em; color: var(--textColor2); }

/* ---------------- summary strip ---------------- */

#fwWrap { padding: 16px 18px 18px; font-size: 1em; flex: 1 1 auto; min-height: 0; display: flex; }

/* ---------------- two-column layout: action left, reference right -------- */

#fwCols {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 2.05fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}
#fwMain, #fwSide { display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 0; }
#fwSide { overflow-y: auto; }                    /* the sidebar scrolls on its own when the tiles exceed the height */
#panelWarzones { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.wzPane { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.wzPane[data-pane="flips"] .panelList { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

/* activity tabs: shared segmented style from ../styles.css */
#fwTabs { margin-bottom: 10px; }

/* warzone header: both militias and the share of systems between them */
.wzHead { display: grid; grid-template-columns: auto minmax(100px, 1fr) auto; align-items: center; gap: 14px; padding: 6px 0 12px; }
.wzHead:empty { display: none; }
.wzSide { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wzSide .ent .entName { font-family: 'Shentox Medium', 'Segoe UI', sans-serif; font-size: 1.0714em; color: var(--fc, var(--themeColor)); overflow: visible; }
.wzB { justify-content: flex-end; }
.wzHeld { color: var(--textColor2); font-size: 0.8571em; white-space: nowrap; }
.wzBar { display: flex; height: 9px; background-color: #d2d2d20d; gap: 2px; }
.wzBarA, .wzBarB { height: 100%; filter: brightness(1.4); }

.wzList .thead, .wzList .trow { grid-template-columns: 26px minmax(130px, 1.1fr) minmax(110px, 1fr) minmax(110px, 1fr) 96px minmax(120px, 1fr); }
#listFlips .thead, #listFlips .trow { grid-template-columns: 26px minmax(140px, 1fr) minmax(220px, 2fr) 80px; }
.wzList { flex: 1 1 auto; min-height: 0; overflow-y: auto; }   /* the list takes the rest of the height and scrolls; a map click scrolls to the row */

/* rows that select a system (highlighted on the map and in the other list) */
.trow.selectable, .hotRow.selectable { cursor: pointer; padding-left: 12px; padding-right: 6px; position: relative; overflow: hidden; flex-shrink: 0; }
.selectable:hover { background-color: #d2d2d206; }
.selectable.sel { background-color: #d2d2d212; }
.selectable.sel::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background-color: #d2d2d2; }   /* the H3 leading tick, clipped to the row */
.selectable.sel .cellSys .cn { color: #ffffff; }
/* the region-maps icon (same glyph as the page menu), opens the region map in a new tab */
.mapBtn { justify-self: start; display: inline-flex; align-items: center; justify-content: center; width: 1.7em; height: 1.7em; border: 1px solid var(--borderColor31); }
.mapBtn svg { width: 1.05em; height: 1.05em; stroke: var(--ghost); fill: none; stroke-width: 1.6; }
.mapBtn:hover { border-color: var(--textColor2); }
.mapBtn:hover svg { stroke: var(--ghostActive); }
.trow.flipped .cellSys .cn { color: #e0b040; }        /* occupied by the enemy militia */

/* warzone map: the warzone's regions on the schematic layout, FW systems coloured by occupier */
.wzMapWrap { position: relative; flex: 0 0 44%; min-height: 240px; margin: 0 0 12px; border: 1px solid var(--borderColor31); background-color: #151515; overflow: hidden; }
.wzMap { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; outline: none; }
.wzMap:active { cursor: grabbing; }
.wzTip {
    position: absolute; z-index: 5; pointer-events: none;
    background-color: #0d0d0df2; border: 1px solid #3a3a3a; padding: 6px 10px;
    font-size: 0.8929em; color: var(--textColor); max-width: 240px;
}
.wzTip b { color: var(--themeColor); }
.wzTip .tt { color: var(--textColor2); }

/* status tags */
.st-stable     { color: var(--textColor2); }
.st-contested  { border-color: #7d6b3c; color: #e0b040; }
.st-vulnerable { border-color: #8a3a2a; color: #f06000; }
.st-captured   { border-color: #4a7d8a; color: #7ec3d8; }

/* militias */
.mRow { padding: 7px 0; border-top: 1px solid #d2d2d20a; }
.mRow:first-child { border-top: 0; }
.mHead { display: flex; align-items: center; gap: 9px; }
.mHead .mName { font-family: 'Shentox Medium', 'Segoe UI', sans-serif; color: var(--fc, var(--themeColor)); }
.mHead .mSys { margin-left: auto; color: var(--textColor2); font-size: 0.8571em; white-space: nowrap; }
.mStats { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; margin: 5px 0 0 33px; font-size: 0.8571em; color: var(--textColor2); }
.mStats b { font-weight: normal; color: var(--textColor); font-variant-numeric: tabular-nums; }

/* closest to flipping */
.hotRow { display: grid; grid-template-columns: 26px minmax(90px, 1.2fr) minmax(70px, 1fr) 82px; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid #d2d2d20a; }
.hotRow:first-child { border-top: 0; }
.hotPct { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* overview: compact label/value rows */
.oRow { display: flex; align-items: baseline; padding: 4px 0; border-top: 1px solid #d2d2d20a; }
.oRow:first-child { border-top: 0; }
.oRow .oL { color: var(--textColor2); }
.oRow .oV { margin-left: auto; color: var(--themeColor); font-size: 1.1429em; font-variant-numeric: tabular-nums; }
.panel {
    background-color: var(--backgroundColor);
    border: 1px solid var(--borderColor31);
    padding: 12px 14px 14px;
    min-width: 0;
}
.panelTitle {
    margin: 0 0 10px;
    font-family: 'Shentox Medium', 'Segoe UI', sans-serif;
    font-size: 0.8571em;
    letter-spacing: 2px;
    color: var(--themeColor);
    font-weight: normal;
}
.panelList { display: flex; flex-direction: column; font-size: 1em; }
.panelEmpty { color: var(--textColor2); font-size: 0.8929em; padding: 8px 0; }

/* ---------------- aligned rows (grid per panel) ---------------- */

.thead, .trow {
    display: grid;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
}
.trow { border-top: 1px solid #d2d2d20a; }
.thead {
    font-size: 0.7143em;
    letter-spacing: 1.5px;
    color: var(--textColor2);
    padding-bottom: 4px;
}


/* system + region stacked in one cell */
.cellSys { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.cellSys .cn { color: var(--themeColor); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cellSys .cn:hover { text-decoration: underline; }
.cellSys .cr { color: var(--textColor2); font-size: 0.7857em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* entity = logo + label as one unit */
.ent { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ent .entName { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--textColor); }
.elogo { flex-shrink: 0; border-radius: 2px; background-color: #d2d2d208; }

/* sov transfer: from → to */
.transfer { display: flex; align-items: center; gap: 7px; min-width: 0; }
.transfer .arrow { color: var(--textColor2); flex-shrink: 0; }

.when { color: var(--textColor2); font-size: 0.8571em; white-space: nowrap; text-align: right; }
.timer { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; color: var(--textColor); }
.adm { text-align: right; font-variant-numeric: tabular-nums; }

.hot  { color: #f06000; }
.warm { color: #e0b040; }

.tag {
    font-size: 0.7143em;
    letter-spacing: 1px;
    padding: 2px 0;
    border: 1px solid var(--borderColor31);
    color: var(--textColor);
    text-align: center;
    text-transform: uppercase;
}
.tag-ihub { border-color: #7d6b3c; color: #c0a060; }
.tag-tcu  { border-color: #4a7d8a; color: #7ec3d8; }

/* defender score */
.score { display: flex; align-items: center; gap: 6px; }
.scoreWrap { flex: 1 1 auto; height: 7px; background-color: #d2d2d20d; }
.scoreBar { display: block; height: 100%; background-color: #48f0c0; filter: brightness(1.4); }   /* colour set per occupier */
.scorePct { font-size: 0.7857em; color: var(--textColor2); width: 32px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------- responsive ---------------- */

@media (max-width: 1100px) {
    #mainWrapper { overflow-y: auto; }
    #fwWrap, #fwCols, #fwMain, #fwSide, #panelWarzones, .wzPane { display: block; flex: none; min-height: auto; overflow: visible; }
    #fwCols { display: grid; grid-template-columns: 1fr; grid-template-rows: none; }
    .wzMapWrap { height: 360px; flex: none; }
    .wzList, .wzPane[data-pane="flips"] .panelList { max-height: none; overflow: visible; }
    #fwSide > .panel { margin-top: 14px; }
}
@media (max-width: 900px) {
    #legnot { display: none; }
}

/* faction links (faction pages) keep the cell look */
.ent a.entName { text-decoration: none; }
.ent a.entName:hover { text-decoration: underline; }
