:root {
    --bg: #000;
    --text: aqua;
    --dim: #0b610b;
    --header: #111;
    --border: #333;
    --error: #ff4444;
    --warning: #ffaa00;
    --info: #4488ff;
    --success: #44ff44;
    font-family: "Menlo", "Consolas", "Courier New", monospace;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.terminal-container {
    width: 95%;
    max-width: 1200px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.8);
    border: 2px solid var(--border);
}

.terminal-header {
    background: var(--header);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
}

.close { background: #ff5f56; }
.minimize { background: #ffbd2e; }
.maximize { background: #27c93f; }

.terminal-title {
    color: var(--dim);
    font-size: 0.9rem;
    flex: 1;
    text-align: center;
}

.terminal-status {
    display: flex;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--dim);
}

#system-status {
    color: var(--success);
}

.terminal-body {
    background: var(--bg);
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.terminal-output {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    white-space: pre-wrap;
    font-size: 14px;
}

.terminal-input-line {
    padding: 6px 12px;
    display: flex;
    gap: 6px;
    border-top: 1px solid var(--border);
}

.prompt {
    user-select: none;
    color: var(--success);
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    outline: none;
    font: inherit;
}

/* Error/Success/Warning Colors */
.error { color: var(--error); }
.success { color: var(--success); }
.warning { color: var(--warning); }
.info { color: var(--info); }

/* File Editor Styles */
.editor-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
}

.editor-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.editor-container {
    width: 90%;
    height: 80%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
}

.editor-header {
    background: var(--header);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.editor-title {
    color: var(--text);
    font-weight: bold;
}

.editor-controls {
    display: flex;
    gap: 8px;
}

.editor-btn {
    background: var(--border);
    color: var(--text);
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
}

.editor-btn:hover {
    background: var(--dim);
}

.editor-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.line-numbers {
    background: var(--header);
    color: var(--dim);
    padding: 10px 8px;
    text-align: right;
    min-width: 50px;
    font-size: 12px;
    border-right: 1px solid var(--border);
    user-select: none;
}

.editor-content {
    flex: 1;
    background: var(--bg);
    color: var(--text);
    border: none;
    outline: none;
    font: inherit;
    padding: 10px;
    resize: none;
    font-size: 14px;
    line-height: 1.4;
}

.editor-footer {
    background: var(--header);
    padding: 4px 12px;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--dim);
}

/* Password Modal */
.password-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1001;
}

.password-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.password-container {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 20px;
    min-width: 300px;
    text-align: center;
}

.password-container h3 {
    margin-top: 0;
    color: var(--text);
}

#password-input {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
    background: var(--header);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 3px;
    font: inherit;
}

.password-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.password-buttons button {
    background: var(--border);
    color: var(--text);
    border: none;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
}

.password-buttons button:hover {
    background: var(--dim);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-track { background: #111; }

/* Responsive */
@media (max-width: 768px) {
    .terminal-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    
    .editor-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}
/* ==== Voice UI Styling (Additive) ==== */
.voice-controls {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 10px 15px;
    border: 1px solid var(--primary, #3498db);
}
.voice-btn:hover {
    transform: scale(1.1);
    background: var(--primary, #3498db) !important;
    color: var(--background, #fff) !important;
}
.voice-btn:active {
    transform: scale(0.95);
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255,193,7,0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255,193,7,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,193,7,0); }
}
@media (max-width: 480px) {
    .terminal-input-line {
        padding: 4px 8px;
    }
    .terminal-input {
        font-size: 12px;
    }
    .terminal-title {
        font-size: 0.8rem;
    }
    .editor-container {
        padding: 10px;
    }
    .terminal-header {
        flex-wrap: wrap;
        gap: 4px;
    }
    .terminal-controls {
        order: 2;
        width: 100%;
        justify-content: center;
    }
    .terminal-title {
        order: 1;
        flex-basis: 100%;
        text-align: center;
        margin-bottom: 4px;
    }
}
/* Instead of height: 80vh, use min-height with flex-grow behavior */
.terminal-body {
    min-height: 60vh;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

/* Natural Language Input Styles */
.nl-input-container {
    position: fixed;
    bottom: 500px;
    right: 180px;
    left: auto;
    transform: none;
    z-index: 1000;
    width: 400px;   /* Or your preferred width */
    max-width: 90vw;
}


.nl-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--background);
    border: 2px solid var(--primary);
    border-radius: 25px;
    padding: 5px;
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.2);
    backdrop-filter: blur(10px);
}

#nl-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--primary);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    padding: 12px 16px;
    outline: none;
}

#nl-input::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

#nl-submit-btn {
    background: var(--primary);
    color: var(--background);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#nl-submit-btn:hover {
    background: var(--accent);
    transform: scale(1.1);
}

.nl-status {
    text-align: center;
    font-size: 12px;
    color: var(--success);
    margin-top: 8px;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nl-input-container {
        bottom: 80px; /* Move up on mobile to avoid keyboard overlap */
        width: 95%;
    }
    
    #nl-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Animation for successful conversion */
.nl-success-animation {
    animation: nlPulse 0.6s ease-in-out;
}

@keyframes nlPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Collapsible trigger button */
.nl-toggle-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    background: var(--primary);
    color: var(--background);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 22px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.2s;
}
.nl-toggle-btn.active {
    filter: brightness(1.2);
    box-shadow: 0 8px 32px rgba(0,255,0,0.2);
}
/* Optionally hide toggle button when input is open (optional) */
.nl-toggle-btn.hide {
    display: none;
}
