/* ============================================
   LOCKRA — Retro Pixel 8-bit Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
    --primary: #00e5ff;
    --primary-dark: #00b8d4;
    --neon-green: #00ff41;
    --neon-pink: #ff0080;
    --neon-yellow: #ffff00;
    --neon-purple: #bf00ff;
    --accent: #ff0040;
    --bg-dark: #0a0a0a;
    --bg-card: #111111;
    --bg-card-hover: #1a1a1a;
    --text: #d0d0d0;
    --text-muted: #666666;
    --border: #00e5ff;
    --border-dim: rgba(0, 229, 255, 0.2);
    --glow: rgba(0, 229, 255, 0.4);
    --font-pixel: 'Press Start 2P', monospace;
    --font-main: 'Cairo', 'Tajawal', sans-serif;
    --transition: all 0.15s steps(3);
    --topbar-h: 60px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; }

body {
    font-family: var(--font-main);
    background: var(--bg-dark);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.8;
    height: 100vh;
    overflow-y: auto;
    image-rendering: pixelated;
}

/* Scanline overlay */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

::selection { background: var(--neon-green); color: #000; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #111; border-left: 2px solid var(--border-dim); }
::-webkit-scrollbar-thumb {
    background: var(--border-dim);
    border: 2px solid var(--primary);
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

.gradient-text {
    color: var(--neon-green);
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

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

/* Canvas */
#cyberCanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    background: rgba(0, 0, 0, 0.95);
    border-bottom: 3px solid var(--primary);
    box-shadow: 0 3px 0 0 rgba(0, 229, 255, 0.15), 0 0 20px rgba(0, 229, 255, 0.1);
    z-index: 100;
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.logo-icon {
    width: 34px;
    height: 26px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid var(--primary);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 8px var(--glow), 2px 2px 0 rgba(0, 229, 255, 0.15);
}

.logo-icon::before {
    content: '> scan\A> 443 ✓\A> OK';
    white-space: pre;
    font-family: var(--font-pixel);
    font-size: 3.5px;
    color: var(--neon-green);
    position: absolute;
    top: 2px;
    left: 3px;
    line-height: 1.8;
    text-shadow: 0 0 3px rgba(0, 255, 65, 0.5);
}

.logo-icon::after {
    content: '█';
    position: absolute;
    bottom: 2px;
    left: 3px;
    font-family: var(--font-pixel);
    font-size: 3px;
    color: var(--neon-green);
    animation: pixelBlink 1s steps(2) infinite;
}

.logo-text {
    font-family: var(--font-pixel);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--primary);
    text-shadow: 0 0 10px var(--glow), 0 0 20px rgba(0, 229, 255, 0.3);
}

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

.topbar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: transparent;
    border: 2px solid var(--border-dim);
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.topbar-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 229, 255, 0.05);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.15), inset 0 0 10px rgba(0, 229, 255, 0.05);
    text-shadow: 0 0 5px var(--glow);
}

/* User Profile */
.nav-user {
    position: relative;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px 12px 4px 4px;
    border: 2px solid var(--border-dim);
    background: transparent;
    transition: var(--transition);
}

.user-profile:hover {
    border-color: var(--neon-green);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.15);
}

.user-avatar {
    width: 30px;
    height: 30px;
    background: var(--neon-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #000;
    border: 2px solid #00cc33;
}

.user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--neon-green);
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.3);
}

.user-profile i.fa-chevron-down {
    font-size: 9px;
    color: var(--text-muted);
    transition: var(--transition);
}

.user-profile.open i.fa-chevron-down {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 260px;
    background: rgba(10, 10, 10, 0.98);
    border: 2px solid var(--primary);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: var(--transition);
    z-index: 200;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.15), 4px 4px 0 rgba(0, 229, 255, 0.1);
}

.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-bottom: 1px dashed var(--border-dim);
    margin-bottom: 6px;
}

.dropdown-avatar {
    width: 38px;
    height: 38px;
    background: var(--neon-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #000;
    flex-shrink: 0;
    border: 2px solid #00cc33;
}

.dropdown-name { font-size: 13px; font-weight: 700; margin-bottom: 2px; color: var(--neon-green); }
.dropdown-email { font-size: 11px; color: var(--text-muted); }
.dropdown-divider { height: 1px; background: var(--border-dim); margin: 4px 0; border: none; border-top: 1px dashed var(--border-dim); }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: rgba(0, 229, 255, 0.08);
    color: var(--primary);
    text-shadow: 0 0 5px var(--glow);
}

.dropdown-item i { width: 18px; text-align: center; }
.dropdown-item.logout-item { color: var(--accent); }
.dropdown-item.logout-item:hover { background: rgba(255, 0, 64, 0.08); text-shadow: 0 0 5px rgba(255,0,64,0.4); }

/* ============================================
   CHAT PAGE LAYOUT
   ============================================ */
.chat-page {
    position: relative;
    z-index: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: var(--topbar-h);
}

/* ============================================
   WELCOME SCREEN
   ============================================ */
.welcome-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 20px 140px;
    animation: pixelFadeIn 0.5s steps(5);
    overflow-y: auto;
}

.welcome-screen.hidden {
    display: none;
}

.welcome-icon {
    margin-bottom: 24px;
}

/* Welcome Monitor — Terminal screen icon */
.welcome-monitor {
    width: 150px;
    height: 110px;
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid var(--primary);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 30px var(--glow), 0 0 60px rgba(0, 229, 255, 0.15), 6px 6px 0 rgba(0, 229, 255, 0.15);
    animation: pixelPulse 2s steps(4) infinite;
}

.welcome-monitor::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--neon-green);
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
}

.welcome-monitor::after {
    content: '[ LOCKRA ]';
    position: absolute;
    top: 5px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: var(--font-pixel);
    font-size: 5px;
    color: var(--primary);
    opacity: 0.4;
    letter-spacing: 2px;
}

.monitor-lines {
    padding: 18px 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.monitor-lines span {
    font-family: var(--font-pixel);
    font-size: 7px;
    color: var(--neon-green);
    text-shadow: 0 0 4px rgba(0, 255, 65, 0.5);
    direction: ltr;
    text-align: left;
    opacity: 0;
    animation: lineAppear 4s steps(1) infinite;
}

.monitor-lines span:nth-child(1) { animation-delay: 0s; }
.monitor-lines span:nth-child(2) { animation-delay: 0.7s; }
.monitor-lines span:nth-child(3) { animation-delay: 1.4s; }
.monitor-lines span:nth-child(4) { animation-delay: 2.1s; }
.monitor-lines span:nth-child(5) { animation-delay: 2.8s; }

.monitor-lines span.warn {
    color: var(--neon-yellow);
    text-shadow: 0 0 4px rgba(255, 255, 0, 0.5);
}

.monitor-lines span.ok {
    color: var(--primary);
    text-shadow: 0 0 4px var(--glow);
}

.welcome-screen h1 {
    font-family: var(--font-pixel);
    font-size: clamp(12px, 2.5vw, 18px);
    font-weight: 400;
    margin-bottom: 16px;
    color: var(--primary);
    text-shadow: 0 0 10px var(--glow), 0 0 30px rgba(0, 229, 255, 0.2);
    letter-spacing: 2px;
}

.welcome-screen > p {
    color: var(--text-muted);
    font-size: 13px;
    max-width: 500px;
    margin-bottom: 36px;
    border: 1px dashed var(--border-dim);
    padding: 12px 20px;
    background: rgba(0, 229, 255, 0.02);
}

/* Suggestions */
.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 8px;
    max-width: 720px;
    width: 100%;
}

.suggestion-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--border-dim);
    cursor: pointer;
    transition: var(--transition);
    text-align: right;
    font-family: var(--font-main);
    color: var(--text);
    position: relative;
}

.suggestion-card::before {
    content: '>>';
    position: absolute;
    left: 14px;
    font-family: var(--font-pixel);
    font-size: 8px;
    color: var(--text-muted);
    opacity: 0;
    transition: var(--transition);
}

.suggestion-card:hover {
    border-color: var(--primary);
    background: rgba(0, 229, 255, 0.04);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.1), 3px 3px 0 rgba(0, 229, 255, 0.15);
}

.suggestion-card:hover::before {
    opacity: 1;
    color: var(--primary);
}

.suggestion-icon {
    width: 40px;
    height: 40px;
    background: rgba(0, 229, 255, 0.08);
    border: 2px solid var(--border-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 15px;
    flex-shrink: 0;
}

.suggestion-text {
    flex: 1;
    min-width: 0;
}

.suggestion-text strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--primary);
    text-shadow: 0 0 5px rgba(0, 229, 255, 0.2);
}

.suggestion-text span {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   CHAT MESSAGES
   ============================================ */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 140px;
    display: none;
    scroll-behavior: smooth;
}

.chat-messages.active {
    display: flex;
    flex-direction: column;
}

.chat-messages-inner {
    max-width: 800px;
    margin: 0 auto;
}

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
    animation: pixelFadeIn 0.3s steps(4);
    width: 100%;
}

.message-avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    border: 2px solid;
}

.bot-message .message-avatar {
    background: rgba(0, 229, 255, 0.1);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

.user-message .message-avatar {
    background: rgba(255, 0, 128, 0.1);
    color: var(--neon-pink);
    border-color: var(--neon-pink);
    box-shadow: 0 0 8px rgba(255, 0, 128, 0.2);
}

.message-content {
    flex: 1;
    max-width: calc(100% - 48px);
}

.message-text {
    font-size: 13px;
    line-height: 1.9;
    color: var(--text);
}

.user-message .message-text {
    background: rgba(255, 0, 128, 0.05);
    border: 2px solid rgba(255, 0, 128, 0.2);
    padding: 14px 18px;
}

.bot-message .message-text {
    padding: 4px 0;
}

.message-text ul, .message-text ol {
    padding-right: 20px;
    margin: 8px 0;
}

.message-text li { padding: 3px 0; }

.message-text strong {
    color: var(--neon-green);
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.3);
}

.message-text code {
    background: rgba(0, 255, 65, 0.08);
    padding: 2px 8px;
    font-size: 12px;
    color: var(--neon-green);
    border: 1px solid rgba(0, 255, 65, 0.2);
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
}

.message-text pre {
    background: rgba(0, 0, 0, 0.6);
    padding: 16px;
    overflow-x: auto;
    margin: 12px 0;
    border: 2px solid var(--border-dim);
    border-left: 4px solid var(--neon-green);
}

.message-text pre code {
    background: none;
    padding: 0;
    border: none;
    font-size: 10px;
}

/* Code block copy button */
.code-block-wrapper {
    position: relative;
    margin: 12px 0;
}

.code-block-wrapper pre {
    margin: 0;
}

.copy-code-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 28px;
    height: 28px;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.25);
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 2;
    opacity: 0;
}

.code-block-wrapper:hover .copy-code-btn {
    opacity: 1;
}

.copy-code-btn:hover {
    background: rgba(0, 229, 255, 0.2);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

.copy-code-btn.copied {
    background: rgba(0, 255, 65, 0.15);
    border-color: var(--neon-green);
    color: var(--neon-green);
}

/* Copy full response button */
.copy-response-wrapper {
    margin-top: 8px;
    display: flex;
    justify-content: flex-start;
}

.copy-response-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: transparent;
    border: 1px solid var(--border-dim);
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
}

.copy-response-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 229, 255, 0.05);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.1);
}

.copy-response-btn.copied {
    border-color: var(--neon-green);
    color: var(--neon-green);
    background: rgba(0, 255, 65, 0.05);
}

.message-text h3, .message-text h4 {
    color: var(--neon-yellow);
    text-shadow: 0 0 8px rgba(255, 255, 0, 0.3);
    margin: 16px 0 8px;
    border-bottom: 1px dashed rgba(255, 255, 0, 0.2);
    padding-bottom: 6px;
}

/* Typing */
.typing-indicator {
    display: flex;
    gap: 8px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    animation: pixelBlink 1s steps(2) infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.3s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.6s; }

/* ============================================
   CHAT INPUT AREA
   ============================================ */
.chat-input-area {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 0 20px 16px;
    background: linear-gradient(to top, var(--bg-dark) 70%, transparent);
    pointer-events: none;
}

.chat-input-container {
    max-width: 860px;
    margin: 0 auto;
    pointer-events: all;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: rgba(10, 10, 10, 0.95);
    border: 2px solid var(--border-dim);
    padding: 8px 12px;
    transition: var(--transition);
}

.chat-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.1), 0 0 30px rgba(0, 229, 255, 0.05);
}

#chatInput {
    flex: 1;
    background: none;
    border: none;
    color: var(--neon-green);
    font-family: var(--font-main);
    font-size: 14px;
    padding: 8px;
    resize: none;
    max-height: 140px;
    outline: none;
}

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

.send-btn {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border: 2px solid var(--primary);
    color: #000;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.send-btn:hover {
    background: var(--neon-green);
    border-color: var(--neon-green);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

.send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: var(--text-muted);
    border-color: var(--text-muted);
}

.stop-btn {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border: 2px solid var(--accent);
    color: #000;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
    animation: pixelPulse 1s steps(4) infinite;
}

.stop-btn:hover {
    background: #ff3366;
    border-color: #ff3366;
    box-shadow: 0 0 15px rgba(255, 0, 64, 0.4);
}

.chat-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 10px;
    color: var(--text-muted);
    padding: 0 4px;
    font-family: var(--font-pixel);
    letter-spacing: 0.5px;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 3px solid var(--primary);
    padding: 28px;
    max-width: 440px;
    width: 90%;
    transform: scale(0.95);
    transition: var(--transition);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.15), 6px 6px 0 rgba(0, 229, 255, 0.1);
}

.modal-overlay.active .modal { transform: scale(1); }

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

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: var(--primary);
    text-shadow: 0 0 8px var(--glow);
}

.modal-close {
    background: none;
    border: 2px solid var(--accent);
    color: var(--accent);
    font-size: 18px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover { background: var(--accent); color: #000; }

.modal-body { margin-bottom: 20px; }
.modal-body p { color: var(--text-muted); font-size: 13px; margin-bottom: 14px; }
.modal-body small { color: var(--text-muted); font-size: 11px; display: block; margin-top: 10px; }
.modal-footer { display: flex; justify-content: flex-end; }

.form-group { position: relative; }

.form-group input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--border-dim);
    color: var(--neon-green);
    font-family: var(--font-main);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

.form-group i {
    position: absolute;
    top: 15px;
    left: 16px;
    color: var(--text-muted);
    font-size: 13px;
}

/* BTN */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
}

.btn-primary:hover {
    background: var(--neon-green);
    border-color: var(--neon-green);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3), 3px 3px 0 rgba(0, 255, 65, 0.2);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes pixelFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pixelPulse {
    0%, 100% { box-shadow: 0 0 20px var(--glow), 4px 4px 0 rgba(0, 229, 255, 0.2); }
    50% { box-shadow: 0 0 40px var(--glow), 0 0 60px rgba(0, 229, 255, 0.1), 4px 4px 0 rgba(0, 229, 255, 0.3); }
}

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

@keyframes cursorBlink {
    0%, 100% { border-color: var(--primary); }
    50% { border-color: transparent; }
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(-1px, -1px); }
    80% { transform: translate(1px, 1px); }
}

@keyframes squareChomp {
    0%, 100% {
        clip-path: polygon(0 0, 100% 0, 100% 35%, 55% 50%, 100% 65%, 100% 100%, 0 100%);
    }
    50% {
        clip-path: polygon(0 0, 100% 0, 100% 48%, 90% 50%, 100% 52%, 100% 100%, 0 100%);
    }
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.5); opacity: 0.2; }
}

@keyframes lineAppear {
    0% { opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { opacity: 0; }
}

/* ============================================
   FILE UPLOAD
   ============================================ */
.upload-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: 2px solid var(--border-dim);
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.upload-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

.file-preview {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0, 229, 255, 0.05);
    border: 2px solid var(--border-dim);
    border-bottom: none;
}

.file-preview.active {
    display: flex;
}

.file-preview-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--primary);
}

.file-preview-content img {
    max-height: 60px;
    max-width: 120px;
    border: 2px solid var(--border-dim);
}

.file-preview-content i {
    font-size: 18px;
}

.file-preview-close {
    background: none;
    border: 2px solid var(--accent);
    color: var(--accent);
    font-size: 14px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.file-preview-close:hover {
    background: var(--accent);
    color: #000;
}

.chat-image {
    max-width: 300px;
    max-height: 250px;
    border: 2px solid var(--border-dim);
    margin: 8px 0;
    cursor: pointer;
    transition: var(--transition);
}

.chat-image:hover {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.15);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .topbar-btn span { display: none; }
    .topbar-btn { padding: 8px 10px; min-width: 38px; justify-content: center; }
    .user-name { display: none; }
    .user-profile i.fa-chevron-down { display: none; }
    .user-profile { padding: 4px; border: none; background: none; }
    .user-dropdown { left: auto; right: 0; width: 220px; }

    .suggestions-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
        padding: 0 4px;
    }

    .welcome-screen { padding: 20px 12px 140px; }
    .welcome-screen h1 { font-size: 11px; }
    .welcome-screen > p { font-size: 12px; padding: 10px 14px; }

    .chat-messages { padding: 16px 8px 140px; }

    .chat-input-area { padding: 0 8px 12px; }
    .chat-input-wrapper { padding: 6px 8px; gap: 6px; }

    .message { gap: 8px; }
    .message-avatar { width: 30px; height: 30px; font-size: 12px; }
    .message-content { max-width: calc(100% - 38px); }
    .user-message .message-text { padding: 10px 12px; }

    .chat-footer { font-size: 7px; }

    .upload-btn { width: 36px; height: 36px; font-size: 13px; }
    .send-btn, .stop-btn { width: 36px; height: 36px; font-size: 13px; }
}

@media (max-width: 480px) {
    .topbar-inner { padding: 0 10px; }
    .topbar-actions { gap: 4px; }
    .logo-text { font-size: 12px; letter-spacing: 1px; }

    .suggestions-grid { gap: 6px; }
    .suggestion-card { padding: 10px 12px; }
    .suggestion-icon { width: 32px; height: 32px; font-size: 12px; }
    .suggestion-text strong { font-size: 12px; }
    .suggestion-text span { font-size: 10px; }

    #chatInput { font-size: 13px; padding: 6px; }
}
