/* Disco Elysium meets Sci-Fi - Core Styles */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap');

:root {
    --bg-dark: #0a0a0f;
    --bg-panel: #12121a;
    --bg-panel-alt: #1a1a25;
    --border-color: #2a2a3a;
    --text-primary: #e0e0e8;
    --text-secondary: #8888a0;
    --text-dim: #555568;

    /* Voice Colors */
    --psi-color: #9b59b6;
    --psi-glow: #8e44ad;
    --cpu-color: #3498db;
    --cpu-glow: #2980b9;
    --social-color: #e74c3c;
    --social-glow: #c0392b;
    --admiral-color: #f1c40f;
    --admiral-glow: #f39c12;

    /* UI Colors */
    --accent-primary: #00d4ff;
    --accent-secondary: #ff6b6b;
    --success-color: #2ecc71;
    --failure-color: #e74c3c;
    --neutral-color: #95a5a6;
}

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

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
}

#game-container {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    height: 100vh;
    gap: 2px;
    background: var(--border-color);
}

/* ============ LEFT PANEL ============ */
#left-panel {
    background: var(--bg-panel);
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
}

#character-portrait {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

#portrait-frame {
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
    position: relative;
    overflow: hidden;
}

#portrait-frame::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, rgba(0, 212, 255, 0.1), transparent 30%);
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

#portrait-image {
    font-family: 'Share Tech Mono', monospace;
    font-size: 24px;
    color: var(--accent-primary);
    z-index: 1;
}

#character-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

#character-class {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'Share Tech Mono', monospace;
}

/* Stats Panel */
#stats-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.stat {
    display: grid;
    grid-template-columns: 50px 1fr;
    grid-template-rows: auto auto;
    gap: 4px 10px;
    align-items: center;
}

.stat-name {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.stat-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: var(--text-dim);
    text-align: right;
}

.stat-bar {
    grid-column: span 2;
    height: 4px;
    background: var(--bg-dark);
    border-radius: 2px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.psi-fill { background: linear-gradient(90deg, var(--psi-color), var(--psi-glow)); width: 95%; }
.cpu-fill { background: linear-gradient(90deg, var(--cpu-color), var(--cpu-glow)); width: 80%; }
.str-fill { background: linear-gradient(90deg, #e67e22, #d35400); width: 30%; }
.agi-fill { background: linear-gradient(90deg, #1abc9c, #16a085); width: 25%; }
.con-fill { background: linear-gradient(90deg, #27ae60, #229954); width: 60%; }

/* Inner Voices Panel */
#inner-voices-panel {
    flex: 1;
}

.panel-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.voice-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: var(--bg-panel-alt);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    opacity: 0.5;
    transition: all 0.3s ease;
    cursor: default;
}

.voice-indicator.active {
    opacity: 1;
}

.voice-indicator[data-voice="psi-voice"] { border-left: 3px solid var(--psi-color); }
.voice-indicator[data-voice="cpu-voice"] { border-left: 3px solid var(--cpu-color); }
.voice-indicator[data-voice="social-voice"] { border-left: 3px solid var(--social-color); }
.voice-indicator[data-voice="admiral-voice"] { border-left: 3px solid var(--admiral-color); }

.voice-indicator.active[data-voice="psi-voice"] { box-shadow: 0 0 15px rgba(155, 89, 182, 0.3); }
.voice-indicator.active[data-voice="cpu-voice"] { box-shadow: 0 0 15px rgba(52, 152, 219, 0.3); }
.voice-indicator.active[data-voice="social-voice"] { box-shadow: 0 0 15px rgba(231, 76, 60, 0.3); }
.voice-indicator.active[data-voice="admiral-voice"] { box-shadow: 0 0 15px rgba(241, 196, 15, 0.3); }

.voice-icon {
    font-size: 10px;
}

/* ============ CENTER PANEL ============ */
#center-panel {
    background: var(--bg-panel);
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100vh;
    overflow: hidden;
}

#location-header {
    background: linear-gradient(90deg, var(--bg-panel-alt) 0%, transparent 100%);
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

#location-name {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    color: var(--accent-primary);
    letter-spacing: 3px;
}

#dialogue-container {
    flex: 1;
    padding: 25px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#dialogue-history {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    overflow-y: auto;
    min-height: 0;
    padding-bottom: 20px;
}

.dialogue-entry {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dialogue-speaker {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dialogue-speaker.narrator { color: var(--text-dim); }
.dialogue-speaker.vivi { color: var(--accent-primary); }
.dialogue-speaker.npc { color: var(--accent-secondary); }

.dialogue-text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
}

.dialogue-text.narrator-text {
    color: var(--text-secondary);
    font-style: italic;
}

/* Inner Voice Interjections */
.inner-voice {
    padding: 12px 16px;
    margin: 10px 0;
    border-radius: 4px;
    position: relative;
}

.inner-voice::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 4px 0 0 4px;
}

.inner-voice.psi-voice {
    background: rgba(155, 89, 182, 0.1);
    border: 1px solid rgba(155, 89, 182, 0.3);
}
.inner-voice.psi-voice::before { background: var(--psi-color); }
.inner-voice.psi-voice .voice-label { color: var(--psi-color); }

.inner-voice.cpu-voice {
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.3);
}
.inner-voice.cpu-voice::before { background: var(--cpu-color); }
.inner-voice.cpu-voice .voice-label { color: var(--cpu-color); }

.inner-voice.social-voice {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
}
.inner-voice.social-voice::before { background: var(--social-color); }
.inner-voice.social-voice .voice-label { color: var(--social-color); }

.inner-voice.admiral-voice {
    background: rgba(241, 196, 15, 0.1);
    border: 1px solid rgba(241, 196, 15, 0.3);
}
.inner-voice.admiral-voice::before { background: var(--admiral-color); }
.inner-voice.admiral-voice .voice-label { color: var(--admiral-color); }

.voice-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

.voice-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Skill Check Display */
.skill-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    margin-left: 10px;
}

.skill-check.success {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.skill-check.failure {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid var(--failure-color);
    color: var(--failure-color);
}

/* Choices */
#choices-container {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: linear-gradient(0deg, var(--bg-panel-alt) 0%, var(--bg-panel) 100%);
    flex-shrink: 0;
    max-height: 250px;
    overflow-y: auto;
}

.choice-button {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.choice-button:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.05);
    transform: translateX(5px);
}

.choice-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--bg-panel-alt);
    border-radius: 4px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    color: var(--accent-primary);
}

.choice-text {
    flex: 1;
}

.choice-check {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    background: var(--bg-panel-alt);
}

.choice-check.psi { color: var(--psi-color); border: 1px solid var(--psi-color); }
.choice-check.cpu { color: var(--cpu-color); border: 1px solid var(--cpu-color); }
.choice-check.social { color: var(--social-color); border: 1px solid var(--social-color); }
.choice-check.admiral { color: var(--admiral-color); border: 1px solid var(--admiral-color); }

/* Protocol Selection - Inline with choices */
#protocol-container {
    padding: 20px 25px;
    border-top: 1px solid var(--psi-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: linear-gradient(0deg, rgba(155, 89, 182, 0.15) 0%, var(--bg-panel) 100%);
    flex-shrink: 0;
    max-height: 300px;
    overflow-y: auto;
    animation: protocolSlideIn 0.3s ease;
}

@keyframes protocolSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

#protocol-container.hidden {
    display: none;
}

.protocol-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    color: var(--psi-color);
    text-align: left;
    margin-bottom: 10px;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.protocol-title::before {
    content: '◈';
    font-size: 10px;
    letter-spacing: 3px;
}

#protocol-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.protocol-button {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 14px 18px;
    background: var(--bg-dark);
    border: 1px solid var(--psi-color);
    border-left: 3px solid var(--psi-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.protocol-button:hover {
    border-color: var(--psi-color);
    background: rgba(155, 89, 182, 0.2);
    transform: translateX(5px);
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.3);
}

.protocol-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.protocol-name {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: var(--psi-color);
    font-weight: 600;
}

.protocol-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============ RIGHT PANEL ============ */
#right-panel {
    background: var(--bg-panel);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#scene-image {
    height: 200px;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
}

#scene-visual {
    width: 100%;
    height: 100%;
}

.data-fortress-visual {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0a0a1a 0%, #1a1a2e 50%, #0f0f20 100%);
    position: relative;
}

.terminal-glow {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 40%;
    background: radial-gradient(ellipse, rgba(0, 212, 255, 0.2) 0%, transparent 70%);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.hologram-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 212, 255, 0.03) 2px,
        rgba(0, 212, 255, 0.03) 4px
    );
    pointer-events: none;
}

#context-panel {
    padding: 20px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
}

#context-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

#thought-cabinet {
    flex: 1;
    padding: 20px;
    background: var(--bg-panel);
}

#thoughts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.thought {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: var(--bg-panel-alt);
    border-radius: 4px;
    border-left: 3px solid var(--accent-primary);
}

.thought-name {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: var(--accent-primary);
}

.thought-status {
    font-size: 12px;
    color: var(--text-dim);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* Utility */
.hidden {
    display: none !important;
}

/* Protocol Execution Animation */
.protocol-executing {
    animation: protocolGlow 0.5s ease;
}

@keyframes protocolGlow {
    0% { box-shadow: 0 0 0 rgba(155, 89, 182, 0); }
    50% { box-shadow: 0 0 40px rgba(155, 89, 182, 0.8); }
    100% { box-shadow: 0 0 0 rgba(155, 89, 182, 0); }
}
