/* AI Hedge Fund web app styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #1c2128;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --border: #30363d;
    --accent: #58a6ff;
    --green: #3fb950;
    --red: #f85149;
    --yellow: #d29922;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

#app {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

header {
    margin-bottom: 28px;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-muted);
}

section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-size: 0.95rem;
    color: var(--text);
}

input,
select,
button {
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    padding: 12px 14px;
    font-size: 0.95rem;
}

input::placeholder {
    color: var(--text-muted);
}

button {
    cursor: pointer;
    transition: 0.2s ease;
}

button:hover {
    border-color: var(--accent);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.helper-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 10px 12px;
}

.agent-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

#agent-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.agent-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
}

.agent-card label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.agent-name {
    font-weight: 500;
}

.agent-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent);
    font-size: 0.8rem;
}

#run-analysis {
    width: 100%;
    font-size: 1rem;
    font-weight: 700;
}

#progress-area {
    margin-top: 14px;
}

#progress-bar {
    width: 0;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #58a6ff, #3fb950);
    transition: width 0.2s ease;
}

#progress-status {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.raw-error {
    margin-top: 12px;
    background: rgba(248, 81, 73, 0.08);
    border: 1px solid rgba(248, 81, 73, 0.35);
    border-radius: 8px;
    padding: 10px 12px;
}

.raw-error summary {
    color: #ffb4b4;
    margin-bottom: 0;
}

.raw-error pre {
    margin-top: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.highlight {
    border-color: rgba(88, 166, 255, 0.35);
}

.signal {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 700;
    margin: 8px 0;
}

.signal.buy,
.signal.bullish {
    background: rgba(63, 185, 80, 0.15);
    color: var(--green);
}

.signal.sell,
.signal.bearish {
    background: rgba(248, 81, 73, 0.15);
    color: var(--red);
}

.signal.hold,
.signal.neutral {
    background: rgba(210, 153, 34, 0.15);
    color: var(--yellow);
}

.ticker-signals {
    margin-top: 16px;
}

.ticker-signals h4 {
    margin-bottom: 10px;
}

.agent-signal {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.agent-label {
    font-weight: 600;
}

.confidence {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.reasoning {
    width: 100%;
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-top: 4px;
    white-space: pre-wrap;
}

.hidden {
    display: none;
}

.api-warning {
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #ffc107;
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 700px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    #agent-grid {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 1.6rem;
    }
}
