:root {
    --panel-bg: #1c1e24;
    --panel-border: #434956;
    --screen-bg: #09120b;
    --amber-glow: #ffb000;
    --green-glow: #33ff33;
    --btn-dark: #2a2e39;
    --btn-highlight: #3a4150;
    --text-muted: #8a9ba8;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: #0d0e12;
    color: #e1e4ea;
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.spacecraft-panel {
    background: var(--panel-bg);
    border: 5px solid var(--panel-border);
    border-radius: 12px;
    padding: 25px;
    width: 100%;
    max-width: 960px;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.9), 0 15px 40px rgba(0,0,0,0.8);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px dashed var(--panel-border);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.panel-header h1 {
    font-size: 1.4rem;
    letter-spacing: 3px;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.subtitle {
    font-size: 0.75rem;
    color: var(--amber-glow);
    margin: 4px 0 0 0;
    letter-spacing: 1.5px;
}

.status-block {
    text-align: right;
}

.status-indicator {
    color: var(--green-glow);
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.secure-badge {
    font-size: 0.65rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 5px;
    display: inline-block;
    border: 1px solid var(--panel-border);
}

.blink {
    width: 8px;
    height: 8px;
    background-color: var(--green-glow);
    display: inline-block;
    border-radius: 50%;
    margin-right: 6px;
    animation: blinker 1.2s linear infinite;
    box-shadow: 0 0 8px var(--green-glow);
}

@keyframes blinker {
    50% { opacity: 0; }
}

.main-interface {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 25px;
}

@media (max-width: 800px) {
    .main-interface {
        grid-template-columns: 1fr;
    }
}

.calculator-module, .ai-module {
    border: 2px solid var(--panel-border);
    padding: 20px;
    background: #12141a;
    border-radius: 8px;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
}

.module-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: bold;
    border-left: 3px solid var(--amber-glow);
    padding-left: 6px;
}

.calc-screen {
    background: var(--screen-bg);
    border: 3px solid #1a221b;
    color: var(--green-glow);
    font-size: 2.2rem;
    text-align: right;
    padding: 12px;
    font-family: monospace;
    box-shadow: inset 0 0 15px rgba(0,255,0,0.2);
    margin-bottom: 15px;
    text-shadow: 0 0 6px var(--green-glow);
    border-radius: 4px;
    overflow-x: auto;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.btn {
    background: var(--btn-dark);
    border: 1px solid var(--panel-border);
    color: #ffffff;
    padding: 16px 10px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
    font-family: monospace;
    border-radius: 4px;
    box-shadow: 0 3px 0 #000000;
    transition: all 0.1s ease;
}

.btn:active {
    transform: translateY(3px);
    box-shadow: none;
}

.btn-mode { 
    color: var(--amber-glow); 
    border-color: rgba(255,176,0,0.4); 
    font-size: 0.85rem;
}
.btn-op { color: #50fa7b; }
.btn-clear { color: #ff5555; border-color: rgba(255,85,85,0.4); }
.btn-equal { background: var(--amber-glow); color: #000000; }

/* MONITOR IA */
.ai-monitor {
    background: #060a08;
    border: 3px solid #252a33;
    height: 280px;
    position: relative;
    overflow: hidden;
    margin-bottom: 12px;
    border-radius: 6px;
    box-shadow: inset 0 0 20px rgba(0,0,0,1);
}

.crt-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 4px, 6px 100%;
    z-index: 10;
    pointer-events: none;
}

.ai-output {
    padding: 15px;
    color: var(--amber-glow);
    font-size: 0.85rem;
    height: 100%;
    overflow-y: auto;
    text-shadow: 0 0 4px var(--amber-glow);
    line-height: 1.4;
}

.system-msg { color: #8be9fd; }
.user-msg { color: #ffffff; margin-top: 8px; font-weight: bold;}
.ia-msg { color: var(--amber-glow); margin-bottom: 8px;}

.api-key-container {
    margin-bottom: 12px;
}

.api-key-container input {
    width: 100%;
    background: #000000;
    border: 1px solid var(--panel-border);
    color: #ffffff;
    padding: 8px;
    font-size: 0.75rem;
    font-family: monospace;
    border-radius: 4px;
}

.ai-input-zone {
    display: flex;
    gap: 8px;
}

.ai-input-zone input {
    flex-grow: 1;
    background: #000000;
    border: 1px solid var(--amber-glow);
    color: var(--amber-glow);
    padding: 12px;
    font-family: monospace;
    border-radius: 4px;
}

.ai-input-zone button {
    background: var(--amber-glow);
    color: #000000;
    border: none;
    font-weight: bold;
    padding: 0 20px;
    cursor: pointer;
    border-radius: 4px;
    font-family: monospace;
    box-shadow: 0 3px 0 #b37b00;
}

.ai-input-zone button:active {
    transform: translateY(3px);
    box-shadow: none;
}

.panel-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid var(--panel-border);
    font-size: 0.65rem;
    color: var(--text-muted);
}
