/* ============================================================================
 * ICAN Mamdani Index — Controls CSS
 * Shared header, buttons, legend, and info panel patterns
 * ============================================================================ */

/* ===== HEADER BAR ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background: var(--carbon);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    z-index: 1000;
    font-family: var(--font);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #ccc;
    letter-spacing: 0.5px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.header-title-star {
    color: var(--ican-red);
    font-size: 14px;
}

.header-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
}

.header-right {
    display: flex;
    gap: 24px;
    font-size: 11px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    color: #fff;
    font-weight: 600;
    font-size: 13px;
}

/* ===== CONTROL PANEL (button group) ===== */
.control-panel {
    position: fixed;
    top: 80px;
    left: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 900;
}

.btn {
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-family: var(--font);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.btn:hover {
    border-color: var(--ican-red);
    color: var(--ican-red);
    box-shadow: 0 0 12px rgba(236, 26, 51, 0.3);
}

.btn.active {
    background: var(--ican-red);
    border-color: var(--ican-red);
    color: #fff;
}

/* ===== LEGEND ===== */
.legend {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 16px;
    z-index: 800;
    font-size: 11px;
    font-family: var(--font);
    width: 220px;
}

.legend-title {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #aaa;
    margin-bottom: 12px;
    font-weight: 600;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #ccc;
}

.legend-swatch {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ===== INFO PANEL (slide-in detail panel) ===== */
.info-panel {
    position: fixed;
    right: -320px;
    top: 56px;
    width: 320px;
    height: calc(100% - 56px);
    background: var(--surface);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding: 24px;
    z-index: 850;
    overflow-y: auto;
    transition: right 0.3s ease;
    font-family: var(--font-primary);
}

.info-panel.open {
    right: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.panel-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-family: var(--font);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
}

.panel-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
}

.panel-close:hover {
    color: var(--ican-red);
}

.panel-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #fff;
}

.panel-title {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-family: var(--font);
}

.panel-value {
    font-size: 13px;
    color: #fff;
    margin-bottom: 16px;
}

/* Score bar visualization */
.score-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
    margin-bottom: 12px;
}

.score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--hostile-3), var(--allied-3));
    width: 50%;
    transition: width 0.3s ease;
}

/* ===== STATE TOOLTIP ===== */
.state-tooltip {
    position: absolute;
    background: var(--surface);
    border: 1px solid rgba(45, 109, 229, 0.3);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 8px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    pointer-events: none;
    z-index: 600;
    animation: fadeInTooltip 0.3s ease;
}

@keyframes fadeInTooltip {
    from { opacity: 0; }
    to { opacity: 1; }
}
