:root {
    /* --- DARK MODE (Default) --- */
    --bg-color: #0d1117;
    --sidebar-bg: #010409;
    --input-bg: transparent;
    
    --text-main: #c9d1d9;
    --text-dim: #8b949e;
    --text-success: #56d364;
    --text-error: #f85149;
    
    --accent-primary: #58a6ff;
    --accent-secondary: #3fb950;
    --accent-highlight: #d2a8ff;
    
    --border-color: #30363d;
    --font-stack: 'JetBrains Mono', 'Fira Code', monospace;
}

[data-theme="light"] {
    /* --- LIGHT MODE --- */
    --bg-color: #ffffff;
    --sidebar-bg: #f6f8fa;
    --text-main: #24292f;
    --text-dim: #57606a;
    --text-success: #1a7f37;
    --text-error: #cf222e;
    
    --accent-primary: #0969da;
    --accent-secondary: #1a7f37;
    --accent-highlight: #8250df;
    
    --border-color: #d0d7de;
}

/* --- RESET & BASE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-stack);
    font-size: 15px;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- LAYOUT --- */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* --- TERMINAL WINDOW --- */
.terminal-window {
    flex: 1;
    padding: 20px;
    padding-bottom: 140px;
    overflow-y: auto;
    width: 100%;
}

.terminal-window::-webkit-scrollbar { width: 8px; }
.terminal-window::-webkit-scrollbar-track { background: var(--bg-color); }
.terminal-window::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

/* --- HEADER & SYSTEM INFO --- */
.ascii-header {
    font-size: 10px;
    line-height: 1.1;
    white-space: pre;
    color: var(--accent-primary);
    margin-bottom: 20px;
    font-weight: bold;
}

@media (min-width: 768px) { .ascii-header { font-size: 14px; } }

.info-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
}

.ascii-art-animated {
    font-size: 12px;
    line-height: 1.1;
    color: var(--accent-secondary);
    white-space: pre;
    font-weight: bold;
    min-width: 80px;
}

.system-status {
    color: var(--text-dim);
    margin-bottom: 20px;
    font-size: 0.9em;
}

/* --- INPUT & CURSOR --- */
.input-line { display: flex; align-items: center; width: 100%; }
.prompt-user { color: var(--accent-secondary); font-weight: bold; }
.prompt-path { color: var(--accent-primary); font-weight: bold; }

.input-wrapper {
    position: relative;
    flex: 1;
    margin-left: 8px;
    height: 1.5em;
    display: flex;
    align-items: center;
}

#command-input {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; z-index: 2; cursor: default;
}

.input-display { color: var(--text-main); white-space: pre; z-index: 1; }

.cursor-block {
    display: inline-block;
    width: 0.6em;
    height: 1.1em;
    background-color: var(--accent-secondary);
    margin-left: 1px;
    animation: blink 1s step-end infinite;
}

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

/* --- DYNAMIC OUTPUT --- */
#terminal-output { margin-bottom: 10px; }
.command-line { margin-top: 10px; margin-bottom: 5px; }

.response-block {
    margin-bottom: 20px;
    animation: fadeIn 0.2s ease-in-out;
}

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

/* --- SIDEBAR / BOTTOM COMMANDS --- */
.sidebar {
    background-color: var(--sidebar-bg);
    border-top: 1px solid var(--border-color);
    padding: 10px;
    z-index: 10;
}

.sidebar-hint {
    color: var(--accent-secondary);
    font-size: 0.85em;
    font-style: italic;
    text-align: center;
    margin-bottom: 8px;
    opacity: 0.7;
}

.command-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    list-style: none;
}

.command-list li {
    font-size: 0.9em;
    color: var(--text-dim);
    cursor: pointer;
    font-weight: bold;
}

.command-list li:hover {
    color: var(--accent-secondary);
    text-shadow: 0 0 5px var(--accent-secondary);
}

/* --- GUI MODE & TOASTS --- */
.gui-mode-container {
    position: fixed;
    top: 25px;
    right: 30px;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 15px; /* Space for the arrow */
    pointer-events: none; /* Let clicks pass through container areas */
}

.gui-toggle-btn {
    pointer-events: auto; /* Re-enable clicks on button */
    /* ... keep your existing button styles below ... */
    font-family: var(--font-stack);
    font-size: 0.9rem;
    color: var(--text-dim);
    text-decoration: none;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    background-color: rgba(13, 17, 23, 0.9);
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

/* --- THE NEW "BROWSER TOOLTIP" BUBBLE --- */
.gui-hint-bubble {
    background-color: #ffffff; /* High contrast white */
    color: #222; /* Sharp dark text */
    padding: 8px 12px;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; /* System font triggers "UI" feel */
    font-size: 13px;
    font-weight: 500;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4); /* Strong shadow for depth */
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #ccc;
    pointer-events: auto;
    
    /* Animation: Bobbing left/right to grab attention */
    animation: attention-bounce 2s infinite ease-in-out;
}

/* The "Arrow" pointing to the button */
.gui-hint-bubble::after {
    content: '';
    position: absolute;
    right: -6px; /* Stick out the right side */
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid #ffffff; /* The arrow color matching bg */
}

/* The Orange Warning Icon */
.hint-icon {
    background-color: #f59e0b; /* Warning Orange */
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 3px; /* Slightly rounded square like reference */
    text-align: center;
    line-height: 16px;
    font-weight: bold;
    font-size: 11px;
    display: inline-block;
}

@keyframes attention-bounce {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-5px); } /* Nudge left */
}

/* Button Hover Effects */
.gui-toggle-btn:hover {
    color: var(--text-main);
    border-color: var(--accent-secondary);
    box-shadow: 0 0 10px rgba(63, 185, 80, 0.15);
}

.gui-toggle-btn:hover .toggle-brackets {
    color: var(--accent-secondary);
}
.toggle-brackets {
    color: var(--accent-primary);
    font-weight: bold;
}

/* Mobile Tweak: Hide the bubble if screen is too small */
@media (max-width: 600px) {
    .gui-hint-bubble {
        display: none;
    }
    .gui-mode-container {
        top: 10px;
        right: 10px;
    }
}

#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: auto;
}


.toast-notification {
    background-color: #107c10; /* The specific "Success Green" */
    color: #ffffff;
    padding: 0; /* Padding handled by flex children */
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    min-width: 300px;
    height: 48px;
    overflow: hidden;
    
    /* Animation States */
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy pop-in */
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* 1. The Icon Section */
.toast-icon-box {
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* 2. The Text Message */
.toast-message {
    flex-grow: 1;
    padding: 12px 0;
    font-weight: 500;
    white-space: nowrap;
}

/* 3. The Separator Line */
.toast-separator {
    width: 1px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.3);
    margin: 0 12px;
}

/* 4. The Close Button */
.toast-close {
    padding: 0 16px 0 4px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    opacity: 0.9;
}
.toast-close:hover {
    opacity: 1;
}

.hint-icon {
    background-color: #f59e0b; /* Warning Orange */
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 3px; /* Slightly rounded square like reference */
    text-align: center;
    line-height: 16px;
    font-weight: bold;
    font-size: 11px;
    display: inline-block;
}

/* --- SCANLINES & MISC --- */
.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 999;
    opacity: 0.3;
}

a { color: var(--accent-primary); text-decoration: none; border-bottom: 1px dotted var(--accent-primary); }
a:hover { background-color: var(--accent-primary); color: var(--bg-color); }