/* ==========================================================================
   THEME VARIABLES & DESIGN TOKENS
   ========================================================================== */
:root {
    --bg-space: #07090e;
    --bg-window: rgba(13, 17, 26, 0.88);
    --bg-window-solid: #0d111a;
    --bg-card: rgba(21, 28, 43, 0.65);
    --border-card: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(0, 242, 254, 0.35);
    
    --primary: #00f2fe;
    --primary-rgb: 0, 242, 254;
    --primary-glow: rgba(0, 242, 254, 0.25);
    --primary-dark: #0396a6;
    
    --secondary: #4facfe;
    --secondary-rgb: 79, 172, 254;
    
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --font-mono: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    --font-sans: 'Space Grotesk', system-ui, sans-serif;
}

/* Theme: Matrix Green */
[data-theme="matrix"] {
    --bg-space: #050a06;
    --bg-window: rgba(8, 18, 11, 0.9);
    --bg-card: rgba(14, 28, 18, 0.65);
    --primary: #10b981;
    --primary-rgb: 16, 185, 129;
    --primary-glow: rgba(16, 185, 129, 0.3);
    --secondary: #34d399;
    --secondary-rgb: 52, 211, 153;
    --border-accent: rgba(16, 185, 129, 0.4);
    --text-main: #ecfdf5;
    --text-muted: #a7f3d0;
    --text-dim: #059669;
}

/* Theme: Amber CRT */
[data-theme="amber"] {
    --bg-space: #0a0805;
    --bg-window: rgba(20, 16, 10, 0.9);
    --bg-card: rgba(33, 25, 14, 0.65);
    --primary: #f59e0b;
    --primary-rgb: 245, 158, 11;
    --primary-glow: rgba(245, 158, 11, 0.3);
    --secondary: #fbbf24;
    --secondary-rgb: 251, 191, 36;
    --border-accent: rgba(245, 158, 11, 0.4);
    --text-main: #fffbeb;
    --text-muted: #fde68a;
    --text-dim: #b45309;
}

/* Theme: Synthwave Pink */
[data-theme="synthwave"] {
    --bg-space: #0c0714;
    --bg-window: rgba(21, 12, 33, 0.9);
    --bg-card: rgba(36, 18, 56, 0.65);
    --primary: #ec4899;
    --primary-rgb: 236, 72, 153;
    --primary-glow: rgba(236, 72, 153, 0.35);
    --secondary: #a855f7;
    --secondary-rgb: 168, 85, 247;
    --border-accent: rgba(236, 72, 153, 0.4);
    --text-main: #fdf2f8;
    --text-muted: #f5d0fe;
    --text-dim: #c084fc;
}

/* ==========================================================================
   RESET & GLOBAL STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-space);
    color: var(--text-main);
    font-family: var(--font-mono);
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 24px 16px;
    line-height: 1.5;
}

/* ==========================================================================
   BACKGROUND VISUAL EFFECTS
   ========================================================================== */
.ambient-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    opacity: 0.55;
    transition: opacity 0.3s ease, background 0.5s ease;
}

.grid-overlay {
    position: fixed;
    inset: 0;
    background-size: 32px 32px;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    pointer-events: none;
    z-index: 1;
}

.scanlines {
    position: fixed;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.2)
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 20;
    opacity: 0.6;
}

/* ==========================================================================
   TERMINAL WINDOW CONTAINER
   ========================================================================== */
.terminal-container {
    width: 100%;
    max-width: 940px;
    min-height: 620px;
    background: var(--bg-window);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-accent);
    border-radius: 14px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.85),
        0 0 35px var(--primary-glow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.terminal-container.fullscreen {
    position: fixed;
    inset: 0;
    max-width: 100%;
    min-height: 100vh;
    border-radius: 0;
    border: none;
    z-index: 999;
}

/* ==========================================================================
   HEADER / TITLE BAR
   ========================================================================== */
.terminal-header {
    height: 44px;
    background: rgba(10, 14, 23, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    user-select: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.window-dots {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.dot:hover {
    transform: scale(1.15);
}

.dot-close { background-color: #ff5f56; }
.dot-min   { background-color: #ffbd2e; }
.dot-max   { background-color: #27c93f; }

.terminal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.host-pill {
    background: rgba(255, 255, 255, 0.06);
    color: var(--primary);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.session-path {
    color: var(--text-dim);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Theme Picker */
.theme-picker {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.theme-btn {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    outline: none;
}

.theme-btn:hover {
    transform: scale(1.2);
}

.theme-btn.active {
    border-color: #ffffff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.7);
}

.theme-btn[data-set-theme="cyan"]      { background-color: #00f2fe; }
.theme-btn[data-set-theme="matrix"]    { background-color: #10b981; }
.theme-btn[data-set-theme="amber"]     { background-color: #f59e0b; }
.theme-btn[data-set-theme="synthwave"] { background-color: #ec4899; }

.ctrl-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 13px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-color: var(--primary);
}

/* ==========================================================================
   SCREEN / WORKSPACE BODY
   ========================================================================== */
.terminal-screen {
    flex: 1;
    padding: 24px 28px;
    overflow-y: auto;
    font-size: 14.5px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Status Bar Inside Screen */
.system-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 6px;
    border-left: 3px solid var(--primary);
    font-size: 11.5px;
    letter-spacing: 0.5px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 600;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.system-meta {
    display: flex;
    gap: 10px;
}

.badge {
    color: var(--text-dim);
}

.badge.latency {
    color: var(--success);
}

/* ASCII Banner */
.ascii-banner {
    font-family: var(--font-mono);
    font-size: clamp(8px, 1.4vw, 12px);
    line-height: 1.15;
    color: var(--primary);
    text-shadow: 0 0 12px var(--primary-glow);
    white-space: pre;
    overflow-x: auto;
    user-select: none;
    margin: 4px 0;
}

/* ==========================================================================
   HERO CARD
   ========================================================================== */
.hero-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 10px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.hero-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar-box {
    width: 54px;
    height: 54px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border-accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 0 15px var(--primary-glow);
    flex-shrink: 0;
}

.avatar-brackets { color: var(--text-dim); }
.avatar-slash    { color: var(--primary); }

.hero-title-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hero-name {
    font-family: var(--font-sans);
    font-size: clamp(24px, 3.5vw, 32px);
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.hero-role-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 500;
}

.role-chevron {
    color: var(--primary);
    font-weight: bold;
}

.hero-role {
    color: var(--primary);
    text-shadow: 0 0 8px var(--primary-glow);
}

.typing-cursor {
    color: var(--primary);
    animation: blink 1s step-end infinite;
    font-weight: bold;
}

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

.hero-bio {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    max-width: 680px;
}

/* ==========================================================================
   CONTACT CARDS GRID
   ========================================================================== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 6px;
}

.contact-card {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.contact-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 15px var(--primary-glow);
}

.contact-icon {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--primary);
    flex-shrink: 0;
}

.contact-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.contact-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: 0.8px;
}

.contact-value {
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

.contact-value:hover {
    color: var(--primary);
}

.contact-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 5px 9px;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: all 0.15s ease;
}

.action-btn:hover {
    background: var(--primary);
    color: #000000;
    border-color: var(--primary);
    font-weight: 600;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* ==========================================================================
   COMMAND CHIPS
   ========================================================================== */
.command-chips-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12.5px;
}

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

.chips-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 4px 10px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chip::before {
    content: "$ ";
    color: var(--primary);
    font-weight: bold;
}

.chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--primary-glow);
}

/* ==========================================================================
   INTERACTIVE CLI HISTORY & PROMPT
   ========================================================================== */
.cli-history {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cli-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cli-cmd-echo {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ffffff;
}

.cli-out {
    padding-left: 14px;
    color: var(--text-muted);
    white-space: pre-wrap;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    font-size: 13.5px;
    line-height: 1.6;
}

.cli-out.highlight {
    color: var(--primary);
    border-left-color: var(--primary);
}

.cli-prompt-line {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cli-prompt-line:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.cli-user { color: var(--primary); font-weight: 600; }
.cli-at   { color: var(--text-dim); }
.cli-host { color: var(--secondary); font-weight: 600; }
.cli-colon{ color: var(--text-dim); }
.cli-path { color: #fbbf24; }
.cli-symbol{ color: #ffffff; font-weight: bold; margin-right: 4px; }

#cli-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    caret-color: var(--primary);
}

#cli-input::placeholder {
    color: var(--text-dim);
    font-size: 12.5px;
}

/* ==========================================================================
   TERMINAL STATUS BAR / VIM FOOTER
   ========================================================================== */
.terminal-statusbar {
    height: 28px;
    background: rgba(10, 14, 23, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    font-size: 11px;
    color: var(--text-dim);
    user-select: none;
}

.status-left, .status-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mode-badge {
    background: var(--primary);
    color: #000000;
    padding: 1px 6px;
    font-weight: 700;
    font-size: 9.5px;
    border-radius: 2px;
    letter-spacing: 0.5px;
}

.shortcut-tip kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 9.5px;
    color: var(--text-main);
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(50px);
    background: var(--bg-card);
    border: 1px solid var(--primary);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 15px var(--primary-glow);
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 768px) {
    body {
        padding: 0;
        align-items: flex-start;
    }

    .terminal-container {
        min-height: 100vh;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
    }

    .terminal-screen {
        padding: 16px;
        gap: 16px;
    }

    .hero-card {
        padding: 16px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .shortcut-tip {
        display: none;
    }

    .session-path {
        display: none;
    }
}

@media (max-width: 520px) {
    .ascii-banner {
        font-size: 6.5px;
        line-height: 1.05;
    }

    .hero-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .contact-card {
        padding: 10px 12px;
    }
}
