/* Beetwoaye Terminal CSS - Dark Mode Redesign */

:root {
    /* Dark Mode Colors */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --bg-tertiary: #3a3a3a;
    --bg-sidebar: #242424;
    --bg-input: #333333;
    
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #707070;
    
    --accent-primary: #ffffff;
    --accent-green: #4ade80;
    --accent-red: #ef4444;
    --accent-yellow: #facc15;
    --accent-blue: #60a5fa;
    
    --border-color: #404040;
    --border-light: #505050;
    
    /* Spacing */
    --sidebar-width: 240px;
    --input-height: 80px;
    --header-height: 60px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
}

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

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

body {
    background-color: var(--bg-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   LOGIN SCREEN
   ============================================================================ */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: var(--bg-primary);
    padding: 20px;
}

.login-box {
    background: var(--bg-secondary);
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 380px;
    width: 100%;
    text-align: center;
}

.login-logo {
    margin-bottom: 24px;
}

.bee-icon {
    display: inline-flex;
    gap: 2px;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-radius: 12px;
}

.bee-icon .stripe {
    width: 12px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.bee-icon .stripe.light {
    background: var(--text-primary);
}

.login-box h1 {
    font-family: 'Headland One', serif;
    font-size: 28px;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-box .tagline {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 32px;
}

.login-box .hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 16px;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#password-input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px;
    transition: border-color var(--transition-fast);
}

#password-input:focus {
    outline: none;
    border-color: var(--text-primary);
}

#password-input::placeholder {
    color: var(--text-muted);
}

#login-form button {
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

#login-form button:hover {
    opacity: 0.9;
}

#login-form button:active {
    opacity: 0.8;
}

/* ============================================================================
   APP LAYOUT
   ============================================================================ */

#app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}

/* ============================================================================
   SIDEBAR
   ============================================================================ */

.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.visible {
    display: block;
    opacity: 1;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
    font-family: 'Headland One', serif;
    font-size: 20px;
    font-weight: 400;
    color: var(--text-primary);
}

.sidebar-nav {
    padding: 16px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 12px;
    font-size: 14px;
    transition: background var(--transition-fast);
}

.nav-item:hover {
    background: var(--bg-tertiary);
}

.nav-item.active {
    background: var(--bg-tertiary);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-section {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.section-title {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recent-item {
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recent-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.recent-item.active {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent-yellow);
    padding-left: 9px;
}

.chat-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-meta {
    font-size: 10px;
    color: var(--text-muted);
}

.view-all {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 12px 0;
    transition: color var(--transition-fast);
}

.view-all:hover {
    color: var(--text-secondary);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.3);
    transition: all var(--transition-fast);
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);
}

.user-name {
    font-size: 12px;
    color: var(--text-primary);
}

/* ============================================================================
   MAIN CONTENT
   ============================================================================ */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    background: var(--bg-secondary);
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    position: relative;
    transition: transform var(--transition-normal);
}

.sidebar.open ~ .main-content {
    transform: translateX(var(--sidebar-width));
}

/* Menu Toggle Button */
.menu-toggle {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.3);
    transition: all var(--transition-fast);
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.4);
}

.menu-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
}

/* ============================================================================
   TERMINAL OUTPUT
   ============================================================================ */

.terminal-output {
    flex: 1;
    padding: 70px 20px 20px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Welcome/System Messages */
.system-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
}

.system-message .bee-icon-large {
    display: inline-flex;
    gap: 3px;
    padding: 16px 20px;
    background: var(--bg-primary);
    border-radius: 16px;
    margin-bottom: 20px;
}

.system-message .bee-icon-large .stripe {
    width: 10px;
    height: 36px;
    background: var(--bg-tertiary);
    border-radius: 5px;
}

.system-message .bee-icon-large .stripe.light {
    background: var(--text-primary);
}

.system-message .greeting {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.system-message .hint-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.system-message .status-info {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.system-message .mood-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Command Output */
.output-block {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 16px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-secondary);
}

.output-block.error {
    border-left: 3px solid var(--accent-red);
}

.output-block.success {
    border-left: 3px solid var(--accent-green);
}

/* Command echo */
.command-echo {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.command-echo .cmd {
    color: var(--accent-blue);
}

/* ============================================================================
   INPUT AREA
   ============================================================================ */

.input-container {
    padding: 12px 16px 24px 16px;
    background: var(--bg-secondary);
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all var(--transition-fast);
}

.input-wrapper:focus-within {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

.prompt-bee {
    font-family: 'SF Mono', 'Courier New', monospace;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    letter-spacing: 0px;
}

.bee-stripe {
    display: inline-block;
    width: 0.6em;
    text-align: center;
}

/* 4-frame bounce: 1->2->3->2->1... */
.bee-stripe.s1 { animation: chase-s1 1.2s steps(1) infinite; }
.bee-stripe.s2 { animation: chase-s2 1.2s steps(1) infinite; }
.bee-stripe.s3 { animation: chase-s3 1.2s steps(1) infinite; }

/* Frame 1: █░░ (0-25%), Frame 2: ░█░ (25-50%), Frame 3: ░░█ (50-75%), Frame 4: ░█░ (75-100%) */
@keyframes chase-s1 {
    0%, 100% { opacity: 1; } /* Frame 1: lit */
    25% { opacity: 0.3; }    /* Frame 2: dim */
    50% { opacity: 0.3; }    /* Frame 3: dim */
    75% { opacity: 0.3; }    /* Frame 4: dim */
}

@keyframes chase-s2 {
    0% { opacity: 0.3; }     /* Frame 1: dim */
    25% { opacity: 1; }      /* Frame 2: lit */
    50% { opacity: 0.3; }    /* Frame 3: dim */
    75% { opacity: 1; }      /* Frame 4: lit */
    100% { opacity: 0.3; }   /* Back to frame 1 */
}

@keyframes chase-s3 {
    0% { opacity: 0.3; }     /* Frame 1: dim */
    25% { opacity: 0.3; }    /* Frame 2: dim */
    50% { opacity: 1; }      /* Frame 3: lit */
    75% { opacity: 0.3; }    /* Frame 4: dim */
    100% { opacity: 0.3; }   /* Back to frame 1 */
}

.bee-face {
    margin-left: -1px;
}

/* Mood colors for bee */
.prompt-bee.mood-drill .bee-stripe,
.prompt-bee.mood-drill .bee-face { color: var(--accent-red); }

.prompt-bee.mood-disappointed .bee-stripe,
.prompt-bee.mood-disappointed .bee-face { color: var(--text-muted); }

.prompt-bee.mood-suspicious .bee-stripe,
.prompt-bee.mood-suspicious .bee-face { color: var(--accent-yellow); }

.prompt-bee.mood-encouraging .bee-stripe,
.prompt-bee.mood-encouraging .bee-face { color: var(--accent-green); }

.prompt-bee.mood-proud .bee-stripe,
.prompt-bee.mood-proud .bee-face { color: #fbbf24; }

/* Default yellow teaching bee */
.prompt-bee .bee-stripe,
.prompt-bee .bee-face { color: var(--accent-yellow); }

.prompt-arrow {
    color: var(--text-muted);
    font-size: 14px;
}

.command-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.command-input::placeholder {
    color: var(--text-muted);
}

.input-action {
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.input-action:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.input-action svg {
    width: 20px;
    height: 20px;
}

/* ============================================================================
   SCROLLBAR
   ============================================================================ */

.terminal-output::-webkit-scrollbar {
    width: 8px;
}

.terminal-output::-webkit-scrollbar-track {
    background: transparent;
}

.terminal-output::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.terminal-output::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ============================================================================
   RESPONSIVE / MOBILE
   ============================================================================ */

@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
    }
    
    .main-content {
        border-radius: 0;
    }
    
    .sidebar.open ~ .main-content {
        transform: translateX(0);
    }
    
    .terminal-output {
        padding: 70px 16px 16px 16px;
    }
    
    .input-container {
        padding: 12px 12px 20px 12px;
    }
}

/* Desktop - sidebar always visible option */
@media (min-width: 1024px) {
    .sidebar {
        transform: translateX(0);
        position: relative;
    }
    
    .sidebar-overlay {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        border-radius: 24px;
        margin: 12px 12px 12px 0;
        height: calc(100vh - 24px);
    }
    
    .sidebar.open ~ .main-content {
        transform: none;
    }
    
    .menu-toggle {
        display: none;
    }
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

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

.output-block {
    animation: fadeIn 0.2s ease-out;
}

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

.loading .prompt-bee {
    animation: pulse 1s ease-in-out infinite;
}

/* ============================================================================
   PAGER MODE
   ============================================================================ */

.pager-container {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 200;
    display: flex;
    flex-direction: column;
}

.pager-header {
    padding: 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pager-title {
    font-size: 14px;
    font-weight: 600;
}

.pager-info {
    font-size: 12px;
    color: var(--text-muted);
}

.pager-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    font-family: 'SF Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.pager-footer {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}
    }
}
