/* ===================================================================
   TBW INTERACTIVE COMPONENT STYLES
   System Map, Calculators, Chat Simulation, Radar Chart
   =================================================================== */

/* -------------------------------------------------------------------
   PROPOSAL CALCULATOR
   ------------------------------------------------------------------- */
.calc-inputs {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    margin-bottom: 32px;
}
.calc-group label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 8px;
}
.calc-group input {
    width: 100%; padding: 14px 16px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: 8px;
    color: var(--text-primary); font-size: 18px; font-weight: 700;
    font-family: 'Inter', sans-serif; transition: border-color 0.3s;
}
.calc-group input:focus {
    outline: none; border-color: var(--red-bright);
}
.calc-results {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.calc-result-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 24px; text-align: center; position: relative;
}
.calc-result-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 3px; border-radius: 12px 12px 0 0;
}
.calc-loss::before { background: var(--red-bright); }
.calc-gain::before { background: #10B981; }
.calc-delta::before { background: linear-gradient(90deg, var(--red-bright), var(--gold)); }
.calc-result-label {
    font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
    color: var(--text-tertiary); margin-bottom: 12px;
}
.calc-result-num {
    font-size: clamp(24px, 3vw, 36px); font-weight: 900;
    letter-spacing: -0.03em; line-height: 1.2;
}
.calc-loss .calc-result-num { color: var(--red-bright); }
.calc-gain .calc-result-num { color: #10B981; }
.calc-delta .calc-result-num { color: var(--gold); }
.calc-result-desc {
    font-size: 13px; color: var(--text-tertiary); margin-top: 8px; line-height: 1.5;
}

@media (max-width: 768px) {
    .calc-inputs { grid-template-columns: 1fr; }
    .calc-results { grid-template-columns: 1fr; }
}


/* -------------------------------------------------------------------
   CHAT SIMULATION
   ------------------------------------------------------------------- */
.chat-window {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 16px; overflow: hidden; max-width: 560px;
    margin: 0 auto;
}
.chat-header {
    display: flex; align-items: center; gap: 6px;
    padding: 14px 20px; background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}
.chat-header-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--border);
}
.chat-header-dot:nth-child(1) { background: #E74C3C; }
.chat-header-dot:nth-child(2) { background: #C9A227; }
.chat-header-dot:nth-child(3) { background: #10B981; }
.chat-header-title {
    font-size: 14px; font-weight: 700; margin-left: 8px;
}
.chat-header-status {
    font-size: 11px; color: #10B981; margin-left: auto;
    display: flex; align-items: center; gap: 4px;
}
.chat-header-status::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: #10B981; display: inline-block;
}
.chat-messages {
    height: 400px; overflow-y: auto; padding: 20px;
    display: flex; flex-direction: column; gap: 12px;
    scroll-behavior: smooth;
}
.chat-msg { display: flex; }
.chat-msg-user { justify-content: flex-end; }
.chat-msg-sage { justify-content: flex-start; }
.chat-bubble {
    max-width: 85%; padding: 12px 16px; border-radius: 12px;
    font-size: 14px; line-height: 1.6;
    animation: chatFade 0.3s ease-out;
}
.chat-bubble-user {
    background: var(--red-bright); color: white;
    border-bottom-right-radius: 4px;
}
.chat-bubble-sage {
    background: var(--bg-secondary); border: 1px solid var(--border);
    color: var(--text-secondary); border-bottom-left-radius: 4px;
}
.chat-typing {
    display: flex; align-items: center; gap: 4px;
    padding: 16px 20px;
}
.chat-typing span {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--text-tertiary); animation: typingPulse 1.4s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
.chat-input-bar {
    display: flex; gap: 8px; padding: 12px 16px;
    border-top: 1px solid var(--border);
}
.chat-input-bar input {
    flex: 1; padding: 10px 14px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: 8px;
    color: var(--text-tertiary); font-size: 13px; font-family: 'Inter', sans-serif;
}
.chat-input-bar button {
    padding: 10px 14px; background: var(--red-bright); border: none;
    border-radius: 8px; color: white; cursor: default; opacity: 0.5;
}
.chat-controls {
    text-align: center; margin-top: 16px;
}
.chat-replay {
    background: transparent; border: 1px solid var(--border);
    border-radius: 8px; padding: 10px 20px; color: var(--text-secondary);
    font-size: 13px; font-family: 'Inter', sans-serif; cursor: pointer;
    transition: border-color 0.3s, color 0.3s;
}
.chat-replay:hover { border-color: var(--red-bright); color: var(--text-primary); }
.chat-replay:disabled { opacity: 0.4; cursor: default; }

@keyframes chatFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes typingPulse {
    0%, 60%, 100% { opacity: 0.3; transform: scale(1); }
    30% { opacity: 1; transform: scale(1.2); }
}

@media (max-width: 480px) {
    .chat-messages { height: 320px; }
    .chat-bubble { max-width: 90%; font-size: 13px; }
}


/* -------------------------------------------------------------------
   RADAR CHART
   ------------------------------------------------------------------- */
#radar-chart {
    max-width: 420px; margin: 0 auto;
}
.radar-svg { width: 100%; height: auto; }
.radar-grid {
    fill: none; stroke: var(--border); stroke-width: 0.5;
}
.radar-axis {
    stroke: var(--border); stroke-width: 0.3; stroke-dasharray: 2 4;
}
.radar-data {
    fill: rgba(231, 76, 60, 0.12); stroke: var(--red-bright);
    stroke-width: 2; stroke-linejoin: round;
    transition: all 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}
.radar-data:not(.radar-data-animate) {
    fill: rgba(231, 76, 60, 0); stroke: rgba(231, 76, 60, 0);
}
.radar-data-animate {
    fill: rgba(231, 76, 60, 0.12); stroke: var(--red-bright);
}
.radar-dot {
    fill: var(--red-bright); stroke: var(--bg-primary); stroke-width: 2;
    cursor: pointer; transition: r 0.2s;
}
.radar-dot:hover { r: 7; }
.radar-label {
    fill: var(--text-secondary); font-size: 10px; font-weight: 500;
    font-family: 'Inter', sans-serif;
}
.radar-tooltip-bg {
    fill: var(--bg-card); stroke: var(--border);
}
.radar-tooltip-text {
    fill: var(--text-primary); font-size: 9px; font-family: 'Inter', sans-serif;
    text-anchor: middle; dominant-baseline: middle;
}


/* -------------------------------------------------------------------
   SYSTEM MAP
   ------------------------------------------------------------------- */
.smap-container {
    display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
    align-items: center;
}
.smap-visual { max-width: 400px; margin: 0 auto; }
.system-map-svg { width: 100%; height: auto; }
.smap-line {
    stroke: var(--border); stroke-width: 1; transition: stroke 0.3s, stroke-width 0.3s;
}
.smap-line.active {
    stroke: var(--red-bright); stroke-width: 2;
}
.smap-circle {
    stroke-width: 1.5; transition: stroke-width 0.3s, r 0.3s;
    cursor: pointer;
}
.smap-node:hover .smap-circle { stroke-width: 2.5; }
.smap-node.active .smap-circle { stroke-width: 3; }
.smap-dot {
    pointer-events: none; transition: r 0.3s;
}
.smap-node.active .smap-dot { r: 8; }
.smap-label {
    fill: var(--text-secondary); font-size: 11px; font-weight: 600;
    font-family: 'Inter', sans-serif; pointer-events: none;
}
.smap-node.active .smap-label { fill: var(--text-primary); }

/* System map info panel */
.smap-info {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 28px; min-height: 160px;
    display: flex; align-items: center;
}
.smap-info-hint {
    font-size: 14px; color: var(--text-tertiary); text-align: center; width: 100%;
}
.smap-info-eyebrow {
    font-size: 11px; font-weight: 700; letter-spacing: 3px; margin-bottom: 12px;
}
.smap-info-desc {
    font-size: 15px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 16px;
}
.smap-info-connects {
    font-size: 12px; color: var(--text-tertiary); margin-bottom: 16px;
}
.smap-info-link {
    font-size: 14px; font-weight: 600; color: var(--red-bright);
    text-decoration: none;
}
.smap-info-link:hover { text-decoration: underline; }

@media (max-width: 768px) {
    .smap-container { grid-template-columns: 1fr; }
    .smap-visual { max-width: 320px; }
}
