/* Space AI Battle - Styles */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    overflow: hidden;
    color: #fff;
}

canvas { display: block; }

/* Info Panel (top-left) */
#info {
    position: fixed;
    top: 10px;
    left: 10px;
    background: rgba(20,20,30,0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    z-index: 100;
    max-width: 300px;
}

/* Stats Panel (top-right) */
#stats {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(20,20,30,0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 11px;
    z-index: 100;
}

/* Nation Colors */
.nation { margin: 5px 0; }
.red { color: #ff5555; }
.green { color: #44dd44; }
.blue { color: #5599ff; }

/* GPT Log Panel (bottom-left) */
#gptLog {
    position: fixed;
    bottom: 10px;
    left: 10px;
    width: 400px;
    max-height: 200px;
    background: rgba(20,20,30,0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 11px;
    overflow-y: auto;
    z-index: 100;
}

/* Log Entry Styles */
.log-entry {
    margin: 3px 0;
    padding: 3px;
    border-left: 3px solid #666;
    padding-left: 8px;
}
.log-system { border-color: #888; color: #aaa; }
.log-info { border-color: #5599ff; color: #5599ff; }
.log-success { border-color: #44dd44; color: #44dd44; }
.log-warning { border-color: #ffcc33; color: #ffcc33; }
.log-error { border-color: #ff5555; color: #ff5555; }

/* AI Learning Stats Panel (bottom-right) */
#aiStats {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 320px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: rgba(20,20,30,0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 8px;
    border-radius: 6px;
    font-size: 10px;
    z-index: 100;
    border: 1px solid rgba(255,255,255,0.1);
}

#aiStats h4 {
    margin: 0 0 6px 0;
    font-size: 10px;
    color: #888;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 4px;
}

/* Compact Nation Headers */
#nationHeaders {
    margin-bottom: 8px;
}

.nation-header-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    font-size: 9px;
}

.nation-label {
    font-weight: bold;
    width: 40px;
}

.nation-header-row .ai-score-current {
    font-size: 11px;
    font-weight: bold;
    min-width: 30px;
}

.nation-header-row .ai-score-delta {
    font-size: 8px;
    min-width: 35px;
}

.ai-callout-mini {
    font-size: 8px;
    font-style: italic;
    color: #999;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* AI Nation Stats Cards */
.ai-nation-stats {
    margin: 8px 0;
    padding: 8px;
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
}

.ai-nation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.ai-nation-name {
    font-weight: bold;
    font-size: 12px;
}

.ai-strategy-style {
    font-size: 10px;
    opacity: 0.8;
    font-style: italic;
}

/* AI Callout Box - Commander statements */
.ai-callout {
    font-size: 11px;
    font-style: italic;
    font-weight: 500;
    padding: 6px 8px;
    margin: 6px 0;
    background: rgba(0,0,0,0.4);
    border-left: 3px solid rgba(255,255,255,0.4);
    border-radius: 3px;
    color: #ccc;
    line-height: 1.4;
    min-height: 16px;
}
.ai-callout:empty {
    display: none;
}
.ai-nation-stats:has(.ai-nation-name.red) .ai-callout {
    background: rgba(80,20,20,0.5);
    border-left-color: rgba(255,100,100,0.7);
    color: #ffaaaa;
}
.ai-nation-stats:has(.ai-nation-name.green) .ai-callout {
    background: rgba(20,60,20,0.5);
    border-left-color: rgba(100,255,100,0.7);
    color: #aaffaa;
}
.ai-nation-stats:has(.ai-nation-name.blue) .ai-callout {
    background: rgba(20,30,70,0.5);
    border-left-color: rgba(100,150,255,0.7);
    color: #aaccff;
}

/* AI Score Display */
.ai-score-row {
    display: flex;
    justify-content: space-between;
    margin: 3px 0;
}

.ai-score-current {
    font-size: 14px;
    font-weight: bold;
}

.ai-score-delta {
    font-size: 11px;
}
.ai-score-delta.improving { color: #44dd44; }
.ai-score-delta.declining { color: #ff5555; }
.ai-score-delta.stable { color: #777; }

/* AI Weights Bar */
.ai-weights-bar {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 5px;
}

.ai-weight-segment {
    height: 100%;
}
.ai-weight-mobility { background: #7799bb; }   /* Steel blue - thrust/speed */
.ai-weight-agility { background: #bbaa66; }    /* Golden tan - maneuverability */
.ai-weight-firepower { background: #aa7777; }  /* Dusty rose - weaponry */

.ai-weights-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    margin-top: 2px;
    opacity: 0.7;
}

/* AI Params Rows */
.ai-params-row,
.ai-accuracy-row {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    margin-top: 3px;
    color: #99bbcc;
}

.ai-params-row span,
.ai-accuracy-row span {
    cursor: help;
}

.ai-accuracy-row {
    color: #cc9966;
    padding-top: 3px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.ai-score-range {
    font-size: 9px;
    opacity: 0.6;
    margin-top: 2px;
}

/* Nation Radar Charts with Callouts */
#nationRadarsContainer {
    display: flex;
    gap: 8px;
}

.nation-radar-box {
    flex: 1;
    min-width: 100px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
}

.nation-radar-header {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nation-radar-header .ai-score-current {
    font-size: 12px;
}

.nation-radar-header .ai-score-delta {
    font-size: 9px;
}

.nation-radar-box canvas {
    max-width: 100%;
    height: auto !important;
}

.nation-radar-box .ai-callout {
    font-size: 9px;
    margin: 6px 0 4px 0;
    padding: 4px 6px;
    min-height: 28px;
    text-align: left;
}

.ai-stats-compact {
    font-size: 8px;
    color: #888;
    text-align: center;
}

/* Parameter Sliders Panel */
#paramSlidersPanel {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.param-group {
    margin-bottom: 6px;
}

.param-group-title {
    font-size: 8px;
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.param-row {
    display: flex;
    align-items: center;
    margin: 1px 0;
    height: 10px;
}

.param-label {
    font-size: 7px;
    color: #666;
    width: 55px;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.param-slider-track {
    flex: 1;
    height: 8px;
    position: relative;
    margin-left: 4px;
}

.param-slider-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255,255,255,0.1);
    transform: translateY(-50%);
}

.param-dot {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: left 0.3s ease;
}

.param-dot.red { background: rgba(255, 85, 85, 0.65); }
.param-dot.green { background: rgba(68, 221, 68, 0.65); }
.param-dot.blue { background: rgba(85, 153, 255, 0.65); }
