/* ═══════════════════════════════════════════════════════════════
   KnowFlow AI — Premium Chatbot UI
   Design System: Dark mode with violet-indigo accents
   ═══════════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ─────────────────────────────────── */
:root {
    /* Theme Light (Default) */
    --lt-bg-primary: #f8faff;
    --lt-bg-secondary: #ffffff;
    --lt-bg-tertiary: #f0f4ff;
    --lt-bg-surface: #ffffff;
    --lt-bg-hover: #f1f5f9;
    --lt-bg-input: #f8fafc;
    --lt-text-primary: #0f172a;
    --lt-text-secondary: #475569;
    --lt-text-muted: #94a3b8;
    --lt-border-color: rgba(0, 0, 0, 0.08);
    --lt-bot-bubble: #ffffff;
    --lt-sidebar-bg: rgba(255, 255, 255, 0.9);
    --lt-topbar-bg: rgba(255, 255, 255, 0.8);

    /* Theme Dark */
    --dt-bg-primary: #0a0a0f;
    --dt-bg-secondary: #12121a;
    --dt-bg-tertiary: #1a1a2e;
    --dt-bg-surface: #16162a;
    --dt-bg-hover: #1e1e38;
    --dt-bg-input: #13131f;
    --dt-text-primary: #e8e8f0;
    --dt-text-secondary: #9898b0;
    --dt-text-muted: #6868808c;
    --dt-border-color: rgba(255, 255, 255, 0.06);
    --dt-bot-bubble: #1a1a35;
    --dt-sidebar-bg: rgba(12, 12, 20, 0.85);
    --dt-topbar-bg: rgba(12, 12, 20, 0.6);

    /* Default Theme Variables (Light) */
    --bg-primary: var(--lt-bg-primary);
    --bg-secondary: var(--lt-bg-secondary);
    --bg-tertiary: var(--lt-bg-tertiary);
    --bg-surface: var(--lt-bg-surface);
    --bg-hover: var(--lt-bg-hover);
    --bg-input: var(--lt-bg-input);
    --text-primary: var(--lt-text-primary);
    --text-secondary: var(--lt-text-secondary);
    --text-muted: var(--lt-text-muted);
    --border-color: var(--lt-border-color);
    --bot-bubble: var(--lt-bot-bubble);
    --sidebar-bg: var(--lt-sidebar-bg);
    --topbar-bg: var(--lt-topbar-bg);

    /* Constant Accents */
    --text-accent: #a78bfa;
    --accent-primary: #818cf8;
    --accent-secondary: #c084fc;
    --accent-gradient: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #f472b6 100%);
    --accent-gradient-soft: linear-gradient(135deg, rgba(129, 140, 248, 0.15), rgba(192, 132, 252, 0.15));
    --border-accent: rgba(129, 140, 248, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 30px rgba(129, 140, 248, 0.15);
    --user-bubble-gradient: linear-gradient(135deg, #4338ca 0%, #7c3aed 100%);

    /* Sizing & Transitions */
    --sidebar-width: 280px;
    --top-bar-height: 60px;
    --input-area-height: 120px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --bg-primary: var(--dt-bg-primary);
    --bg-secondary: var(--dt-bg-secondary);
    --bg-tertiary: var(--dt-bg-tertiary);
    --bg-surface: var(--dt-bg-surface);
    --bg-hover: var(--dt-bg-hover);
    --bg-input: var(--dt-bg-input);
    --text-primary: var(--dt-text-primary);
    --text-secondary: var(--dt-text-secondary);
    --text-muted: var(--dt-text-muted);
    --border-color: var(--dt-border-color);
    --bot-bubble: var(--dt-bot-bubble);
    --sidebar-bg: var(--dt-sidebar-bg);
    --topbar-bg: var(--dt-topbar-bg);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
}

/* ─── Reset & Base ──────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* ─── Animated Background Orbs ──────────────────────────────── */
.bg-animation {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

.bg-orb-1 {
    width: 600px;
    height: 600px;
    background: #818cf8;
    top: -10%;
    left: -5%;
    animation-delay: 0s;
}

.bg-orb-2 {
    width: 500px;
    height: 500px;
    background: #c084fc;
    bottom: -10%;
    right: -5%;
    animation-delay: -7s;
}

.bg-orb-3 {
    width: 400px;
    height: 400px;
    background: #f472b6;
    top: 40%;
    left: 50%;
    animation-delay: -14s;
}

[data-theme="dark"] .bg-orb {
    opacity: 0.15;
}

[data-theme="light"] .bg-orb {
    opacity: 0.1;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -50px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 30px) scale(0.95);
    }

    75% {
        transform: translate(40px, 20px) scale(1.02);
    }
}

/* ─── App Container ─────────────────────────────────────────── */
.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    transition: transform var(--transition-normal), background var(--transition-normal);
    z-index: 100;
}

.sidebar-header {
    margin-bottom: 20px;
}

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

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(129, 140, 248, 0.3);
}

.logo-text h1 {
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.logo-text span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* New Chat Button */
.new-chat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border: 1px dashed var(--border-accent);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--accent-primary);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    margin-bottom: 24px;
}

.new-chat-btn:hover {
    background: rgba(129, 140, 248, 0.1);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

/* Sidebar Sections */
.sidebar-section {
    flex: 1;
}

.sidebar-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 600;
}

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

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    cursor: default;
}

.feature-item.clickable {
    cursor: pointer;
}

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

.feature-icon {
    font-size: 1.1rem;
}

/* Chat History */
.history-section {
    margin-top: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-history-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    max-height: 250px;
    padding-right: 4px;
}

.chat-history-list::-webkit-scrollbar {
    width: 4px;
}

.chat-history-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all var(--transition-fast);
}

.history-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateX(4px);
}

.history-item svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.history-empty {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 12px;
    font-style: italic;
    text-align: center;
}

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

.sidebar-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* ─── Top Bar ───────────────────────────────────────────────── */
.top-bar {
    height: var(--top-bar-height);
    min-height: var(--top-bar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--topbar-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    z-index: 10;
    transition: background var(--transition-normal);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.menu-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.top-bar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
    }

    50% {
        opacity: 0.6;
        box-shadow: 0 0 16px rgba(52, 211, 153, 0.3);
    }
}

.clear-chat-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.clear-chat-btn:hover {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

/* ─── Theme Switcher ────────────────────────────────────────── */
.theme-switch-container {
    display: flex;
    align-items: center;
    background: var(--bg-hover);
    padding: 4px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

.theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-muted);
    transition: all var(--transition-normal);
}

.theme-btn:hover {
    color: var(--text-primary);
}

.theme-btn.active {
    background: var(--bg-surface);
    color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════════════════════════
   CHAT BOX
   ═══════════════════════════════════════════════════════════════ */
.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.chat-box::-webkit-scrollbar {
    width: 6px;
}

.chat-box::-webkit-scrollbar-track {
    background: transparent;
}

.chat-box::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

.chat-box::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ─── Welcome Screen ────────────────────────────────────────── */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    padding: 40px 20px;
    animation: fadeInUp 0.8s ease-out;
}

.welcome-icon {
    margin-bottom: 20px;
    animation: float-gentle 4s ease-in-out infinite;
}

@keyframes float-gentle {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.welcome-screen h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-screen p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 520px;
    line-height: 1.7;
    margin-bottom: 36px;
}

/* Suggestion Grid */
.suggestion-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 560px;
    width: 100%;
}

.suggestion-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
}

.suggestion-card:hover {
    background: rgba(129, 140, 248, 0.08);
    border-color: var(--border-accent);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.suggestion-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.suggestion-text {
    font-size: 0.82rem;
    line-height: 1.4;
    font-weight: 500;
}

/* ─── Chat Messages ─────────────────────────────────────────── */
.message-row {
    display: flex;
    gap: 12px;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    animation: fadeInUp 0.4s ease-out;
    padding: 8px 0;
}

.message-row.user {
    flex-direction: row-reverse;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Avatar */
.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 2px;
}

.message-row.bot .message-avatar {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 10px rgba(129, 140, 248, 0.25);
}

.message-row.user .message-avatar {
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    color: white;
    box-shadow: 0 2px 10px rgba(14, 165, 233, 0.25);
}

/* Bubble */
.message-bubble {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message-row.bot .message-bubble {
    background: var(--bot-bubble);
    border: 1px solid var(--border-color);
    border-top-left-radius: 6px;
    color: var(--text-primary);
}

.message-row.user .message-bubble {
    background: var(--user-bubble-gradient);
    color: white;
    border-top-right-radius: 6px;
    box-shadow: 0 4px 15px rgba(67, 56, 202, 0.3);
}

/* Thinking Animation */
.thinking-dots {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 0;
}

.thinking-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-primary);
    animation: bounce-dot 1.4s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce-dot {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* ─── Message Content Formatting ────────────────────────────── */
.message-bubble p {
    margin-bottom: 8px;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble strong {
    color: var(--accent-primary);
    font-weight: 600;
}

.message-row.user .message-bubble strong {
    color: #e0e7ff;
}

.message-bubble code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 0.82rem;
}

.message-bubble pre {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin: 10px 0;
    overflow-x: auto;
    font-size: 0.82rem;
}

.message-bubble pre code {
    background: none;
    padding: 0;
    font-size: inherit;
}

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

.message-bubble li {
    margin-bottom: 4px;
}

.message-bubble h1,
.message-bubble h2,
.message-bubble h3,
.message-bubble h4 {
    margin: 12px 0 6px;
    font-weight: 600;
}

.message-bubble h1 {
    font-size: 1.2rem;
}

.message-bubble h2 {
    font-size: 1.1rem;
}

.message-bubble h3 {
    font-size: 1rem;
}

.message-bubble blockquote {
    border-left: 3px solid var(--accent-primary);
    padding-left: 12px;
    margin: 10px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.message-bubble hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 12px 0;
}

.message-bubble a {
    color: var(--accent-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.message-bubble table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 0.82rem;
}

.message-bubble th,
.message-bubble td {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.message-bubble th {
    background: rgba(129, 140, 248, 0.1);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   INPUT AREA
   ═══════════════════════════════════════════════════════════════ */
.input-area {
    padding: 12px 24px 20px;
    background: var(--topbar-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    transition: background var(--transition-normal);
}

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

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 6px;
    padding-left: 12px;
    transition: all var(--transition-normal);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.icon-btn.recording {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

#user-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    padding: 10px 4px;
    caret-color: var(--accent-primary);
}

.file-preview-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-accent);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-primary);
    max-width: 150px;
    position: relative;
    animation: fadeIn 0.3s ease;
}

.remove-file {
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.remove-file:hover {
    color: #ef4444;
}

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

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

.send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--accent-gradient);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    flex-shrink: 0;
    opacity: 0.4;
}

.send-btn:not(:disabled) {
    opacity: 1;
}

.send-btn:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(129, 140, 248, 0.4);
}

.send-btn:not(:disabled):active {
    transform: scale(0.95);
}

.input-hint {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR OVERLAY (MOBILE)
   ═══════════════════════════════════════════════════════════════ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE (Mobile & Tablet)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        z-index: 100;
    }

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

    .menu-toggle {
        display: flex;
    }

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

    .welcome-screen h2 {
        font-size: 1.4rem;
    }

    .message-bubble {
        max-width: 88%;
    }

    .chat-box {
        padding: 16px;
    }

    .input-area {
        padding: 10px 16px 16px;
    }
}

@media (max-width: 480px) {
    .top-bar {
        padding: 0 16px;
    }

    .message-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .message-bubble {
        padding: 12px 14px;
        font-size: 0.85rem;
    }
}