/* ═══════════════════════════════════════════════════════════════
   AI Hindi 1 — Gemini-Style Design System
   ═══════════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
    /* Dark Mode (default) */
    --bg: #131314;
    --surface: #1e1f20;
    --surface-2: #282a2c;
    --border: rgba(255, 255, 255, 0.08);
    --text-1: #e3e3e3;
    --text-2: #9aa0a6;
    --text-3: #5f6368;
    --accent: #8ab4f8;
    --accent-hover: #aecbfa;
    --chip-bg: #282a2c;
    --chip-hover: #323436;
    --user-bubble: #282a2c;
    --send-active: #c4e7ff;
    --input-bg: #1e1f20;
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
    --font: 'Google Sans', 'Google Sans Text', 'Helvetica Neue', sans-serif;
    --radius-pill: 24px;
    --radius-lg: 18px;
    --radius-md: 12px;
    --sidebar-w: 270px;
    --transition: 0.2s ease;
}

[data-theme="light"] {
    --bg: #ffffff;
    --surface: #f0f4f9;
    --surface-2: #e8eaed;
    --border: rgba(0, 0, 0, 0.08);
    --text-1: #1f1f1f;
    --text-2: #444746;
    --text-3: #9aa0a6;
    --accent: #1a73e8;
    --accent-hover: #1557b0;
    --chip-bg: #f0f4f9;
    --chip-hover: #e8eaed;
    --user-bubble: #e8eaed;
    --send-active: #1a73e8;
    --input-bg: #f0f4f9;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

/* ── Reset ─────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-1);
    height: 100dvh;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

button {
    font-family: var(--font);
    cursor: pointer;
}

a {
    color: var(--accent);
    text-decoration: none;
}

/* ── Layout ────────────────────────────────────────────────────── */
.app-container {
    display: flex;
    height: 100dvh;
    overflow: hidden;
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    padding: 12px 8px 16px;
    height: 100dvh;
    flex-shrink: 0;
    transition: width var(--transition), padding var(--transition);
    overflow: hidden;
    border-right: 1px solid var(--border);
}

/* Collapsed sidebar */
.sidebar.collapsed {
    width: 72px;
    padding: 12px 8px;
    align-items: center;
}

.sidebar.collapsed .new-chat-label,
.sidebar.collapsed .recent-chats-section,
.sidebar.collapsed .settings-label,
.sidebar.collapsed .section-label,
.sidebar.collapsed .edit-btn {
    display: none;
}

.sidebar.collapsed .new-chat-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
}

/* ── Sidebar Top Row ─────────────────────────────────────── */
.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-top {
    justify-content: center;
}

/* ── Sidebar Top Search ─────────────────────────────────── */
.sidebar-search-container {
    padding: 12px 16px 8px 16px;
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.sidebar.collapsed .sidebar-search-container {
    display: none;
}

.search-icon {
    position: absolute;
    left: 28px;
    color: var(--text-2);
    font-size: 20px;
    pointer-events: none;
}

.sidebar-search-input {
    width: 100%;
    flex: 1;
    padding: 14px 16px 14px 44px;
    border-radius: 20px;
    border: none;
    background: var(--surface-2);
    color: var(--text-color);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: background-color 0.2s;
}

.sidebar-search-input:focus {
    background: var(--surface-hover);
}

/* ── Icon Button (shared) ───────────────────────────────── */
.icon-btn {
    background: none;
    border: none;
    color: var(--text-2);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
}

.icon-btn:hover {
    background: var(--surface-2);
    color: var(--text-1);
}

.icon-btn .material-symbols-outlined {
    font-size: 22px;
}

/* ── New Chat Button ─────────────────────────────────────── */
.new-chat-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-2);
    color: var(--text-1);
    border: none;
    border-radius: var(--radius-pill);
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    transition: background var(--transition);
    white-space: nowrap;
    overflow: hidden;
}

.new-chat-btn:hover {
    background: var(--chip-hover);
}

.new-chat-btn .material-symbols-outlined {
    font-size: 20px;
    flex-shrink: 0;
}

.prompt-gen-item {
    background: transparent;
}

.prompt-gen-item:hover {
    background: var(--surface-2);
}

/* ── Section Label ──────────────────────────────────────── */
.section-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    padding: 12px 12px 6px;
    letter-spacing: 0.3px;
}

/* ── Recent Chats ───────────────────────────────────────── */
.recent-chats-section {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.recent-chats-section::-webkit-scrollbar {
    width: 4px;
}

.recent-chats-section::-webkit-scrollbar-thumb {
    background: var(--surface-2);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-3);
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-lg);
    color: var(--text-1);
    font-size: 14px;
    transition: background var(--transition);
    cursor: pointer;
    position: relative;
}

.chat-item:hover,
.chat-item.active {
    background: var(--surface-2);
}

.chat-item .material-symbols-outlined {
    font-size: 18px;
    color: var(--text-2);
    flex-shrink: 0;
}

.chat-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.chat-timestamp {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-3);
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Dropdown */
.chat-options-dropdown {
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    z-index: 1000;
    width: 200px;
    display: none;
    flex-direction: column;
    padding: 6px;
    overflow: hidden;
}

.chat-options-dropdown.show {
    display: flex;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    color: var(--text-1);
    font-size: 14px;
    border-radius: var(--radius-md);
    transition: background var(--transition);
}

.dropdown-item:hover {
    background: var(--surface-2);
}

.dropdown-item .material-symbols-outlined {
    font-size: 18px;
    color: var(--text-2);
}

/* ── Sidebar Footer ─────────────────────────────────────── */
.sidebar-footer-settings {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    position: relative;
    flex-shrink: 0;
}

.settings-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: none;
    border: none;
    color: var(--text-2);
    padding: 10px 12px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    transition: background var(--transition), color var(--transition);
}

.settings-btn:hover {
    background: var(--surface-2);
    color: var(--text-1);
}

.settings-btn .material-symbols-outlined {
    font-size: 22px;
}

/* Settings Panel */
.settings-panel {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    display: none;
    animation: slideUp 0.2s cubic-bezier(0.2, 0, 0, 1);
    z-index: 1000;
}

.sidebar.collapsed .settings-panel {
    left: 8px;
    /* Offset to not clip when sidebar is collapsed */
}

.settings-panel.open {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-panel-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-2);
    margin-bottom: 12px;
}

.theme-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.theme-option-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
}

.theme-option-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-option-content .material-symbols-outlined {
    font-size: 20px;
}

.theme-option-btn .check-icon {
    opacity: 0;
    font-size: 18px;
    color: var(--accent);
    transition: opacity var(--transition);
}

.theme-option-btn:hover {
    color: var(--text-1);
    background: var(--surface-2);
}

.theme-option-btn.active {
    color: var(--accent);
    background: rgba(138, 180, 248, 0.08);
}

.theme-option-btn.active .check-icon {
    opacity: 1;
}

[data-theme="light"] .theme-option-btn.active {
    background: rgba(26, 115, 232, 0.08);
}

/* ══════════════════════════════════════════════════════════
   MAIN CHAT INTERFACE
══════════════════════════════════════════════════════════ */
.chat-interface {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
    position: relative;
    background: var(--bg);
}

/* ── Top Bar ─────────────────────────────────────────────── */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    flex-shrink: 0;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-menu-btn {
    display: none;
}

.model-name-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border-radius: 0;
    padding: 0;
    cursor: pointer;
    transition: opacity var(--transition);
    user-select: none;
}

.model-name-chip:hover {
    opacity: 0.8;
}

.model-name-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-1);
}

.model-arrow {
    font-size: 20px;
    color: var(--text-2);
}

/* ── Chat Container (scroll area) ───────────────────────── */
.chat-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px 20px;
    scroll-behavior: smooth;
    min-height: 0;
}

.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--surface-2);
    border-radius: 4px;
}

/* ── Backdrop overlay (mobile sidebar) ─────────────────── */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 199;
    backdrop-filter: blur(1px);
}

.sidebar-backdrop.visible {
    display: block;
}

/* ══════════════════════════════════════════════════════════
   WELCOME / EMPTY STATE
══════════════════════════════════════════════════════════ */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 750px;
    width: 100%;
    padding: 0 24px;
    /* Take all available space to stay perfectly centered */
    flex: 1;
    margin: auto;
}

.greeting-title {
    font-size: 42px;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 4px;
    background: linear-gradient(90deg, #4285f4, #9b72cb, #d96570, #e37400);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .greeting-title {
    background: linear-gradient(90deg, #1a73e8, #9b72cb, #d93025);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.greeting-subtitle {
    font-size: 38px;
    font-weight: 500;
    color: var(--text-2);
    line-height: 1.2;
    margin-bottom: 0;
}

/* Hide welcome screen once chat starts */
.chat-started .welcome-screen {
    display: none;
}

/* ══════════════════════════════════════════════════════════
   MESSAGES
══════════════════════════════════════════════════════════ */
.messages-list {
    max-width: 750px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding-top: 12px;
    padding-bottom: 20px;
}

.message {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* User message — right side bubble */
.message.user {
    align-items: flex-end;
}

.message.user .message-content {
    background: var(--user-bubble);
    border-radius: 20px 20px 4px 20px;
    padding: 12px 18px;
    max-width: 80%;
    font-size: 15px;
    color: var(--text-1);
    position: relative;
    word-break: break-word;
}

.message.user .message-actions {
    justify-content: flex-end;
    margin-top: 4px;
    padding-right: 8px;
}

/* AI message — left aligned, no bubble */
.message.ai {
    align-items: flex-start;
}

.message.ai .message-content {
    background: transparent;
    padding: 0;
    max-width: 100%;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-1);
}

/* Markdown inside AI messages */
.message.ai .message-content h1,
.message.ai .message-content h2,
.message.ai .message-content h3 {
    margin: 16px 0 8px;
    font-weight: 600;
    line-height: 1.3;
}

.message.ai .message-content h1 {
    font-size: 22px;
}

.message.ai .message-content h2 {
    font-size: 18px;
}

.message.ai .message-content h3 {
    font-size: 16px;
}

.message.ai .message-content p {
    margin-bottom: 10px;
}

.message.ai .message-content ul,
.message.ai .message-content ol {
    padding-left: 22px;
    margin-bottom: 10px;
}

.message.ai .message-content li {
    margin-bottom: 4px;
}

.message.ai .message-content strong {
    font-weight: 600;
}

.message.ai .message-content em {
    font-style: italic;
}

.message.ai .message-content pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    overflow-x: auto;
    margin: 10px 0;
    font-size: 13px;
}

.message.ai .message-content code {
    background: var(--surface);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 13px;
    font-family: 'Fira Code', 'Courier New', monospace;
}

.message.ai .message-content pre code {
    background: none;
    padding: 0;
}

.message.ai .message-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 16px;
    color: var(--text-2);
    margin: 10px 0;
}

.message.ai .message-content a {
    color: var(--accent);
}

.message.ai .message-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
}

.message.ai .message-content th,
.message.ai .message-content td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
    font-size: 14px;
}

.message.ai .message-content th {
    background: var(--surface);
    font-weight: 600;
}

/* ── Message Action Row ─────────────────────────────────── */
.message-actions {
    display: flex;
    flex-direction: row;
    gap: 4px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity var(--transition);
}

.message.ai:hover .message-actions,
.message.user:hover .message-actions,
.message.show-actions .message-actions {
    opacity: 1;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-2);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition), background var(--transition);
}

.action-btn:hover {
    background: var(--surface-2);
    color: var(--text-1);
}

.action-btn .material-symbols-outlined {
    font-size: 18px;
}

.action-btn.active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.action-btn.like-btn.active {
    color: #4caf50;
}

.action-btn.dislike-btn.active {
    color: #f44336;
}

/* ── User Message Edit Inline ─────────────────────────────── */
.message-content.editing {
    outline: none;
    border: 1px solid var(--border);
    box-shadow: 0 0 0 1px var(--accent);
    background: var(--input-bg);
    color: var(--text-1);
    border-radius: var(--radius-lg);
    padding: 12px 16px !important;
    min-width: 100px;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
    resize: none;
    overflow-y: hidden;
}

.user-edit-textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-1);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    resize: none;
    outline: none;
    overflow: hidden;
}

.inline-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.inline-edit-send {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    color: var(--text-2);
    border: none;
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 14px;
    transition: background var(--transition), color var(--transition);
    cursor: default;
}

.inline-edit-send.active {
    background: #0a56d0;
    color: #ffffff;
    cursor: pointer;
}

.inline-edit-send.active:hover {
    background: #0842a0;
}

.inline-edit-cancel {
    background: transparent;
    color: var(--accent);
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    transition: background var(--transition);
    cursor: pointer;
}

.inline-edit-cancel:hover {
    background: var(--chip-hover);
    color: var(--accent-hover);
}

/* ── Loading Wave ─────────────────────────────────────────── */
.loading-wave {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 20px;
    padding: 4px 0;
}

.loading-wave .bar {
    width: 4px;
    height: 10px;
    background: var(--text-2);
    border-radius: 4px;
    animation: wave 1.2s ease-in-out infinite;
}

.loading-wave .bar:nth-child(2) {
    animation-delay: 0.15s;
}

.loading-wave .bar:nth-child(3) {
    animation-delay: 0.30s;
}

@keyframes wave {

    0%,
    100% {
        height: 6px;
        opacity: 0.4;
    }

    50% {
        height: 18px;
        opacity: 1;
    }
}

/* ══════════════════════════════════════════════════════════
   INPUT AREA (fixed bottom)
══════════════════════════════════════════════════════════ */
.input-area {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px 14px;
    background: var(--bg);
    width: 100%;
    gap: 8px;
}

/* ── Suggestion Chips — hidden by default ─────────────── */
.suggestion-chips {
    display: none;
}

.chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--chip-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-1);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    transition: background var(--transition), border-color var(--transition), transform 0.15s;
    cursor: pointer;
    white-space: nowrap;
}

.chip:hover {
    background: var(--chip-hover);
    border-color: var(--text-3);
    transform: translateY(-1px);
}

.chip .material-symbols-outlined {
    font-size: 16px;
    color: var(--text-2);
}



/* ── Input Wrapper ─────────────────────────────────────── */
.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 10px 12px 10px 16px;
    width: 100%;
    max-width: 750px;
    box-shadow: var(--shadow);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), var(--shadow);
}


/* Textarea */
#userInput {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-1);
    font-size: 15px;
    font-family: var(--font);
    resize: none;
    outline: none;
    max-height: 180px;
    line-height: 1.6;
    align-self: center;
}

#userInput::placeholder {
    color: var(--text-3);
}

/* Mic Button */
.mic-btn {
    color: var(--text-2);
    flex-shrink: 0;
}

.mic-btn:hover {
    color: var(--text-1);
}

.mic-btn.listening {
    color: #ff4444;
    animation: mic-pulse 1.2s infinite ease-in-out;
}

@keyframes mic-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.7;
    }
}

/* Send Button */
.send-btn {
    background: none;
    border: none;
    color: var(--text-3);
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition);
}

.send-btn.active {
    background: var(--send-active);
    color: var(--bg);
}

[data-theme="light"] .send-btn.active {
    background: var(--accent);
    color: #fff;
}

.send-btn .material-symbols-outlined {
    font-size: 20px;
}

/* ── Input Disclaimer ───────────────────────────────────── */
.input-disclaimer {
    font-size: 12px;
    color: var(--text-3);
    text-align: center;
    max-width: 750px;
    width: 100%;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media(max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100dvh;
        z-index: 200;
        /* Use transform for smooth GPU-accelerated slide */
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        /* Keep width fixed on mobile — no collapse */
        width: var(--sidebar-w) !important;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .top-bar {
        position: relative;
    }

    .mobile-menu-btn {
        display: flex !important;
    }

    .model-name-chip {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        max-width: calc(100% - 90px);
        justify-content: center;
    }

    .edit-btn-mobile {
        display: flex !important;
    }

    .model-name-text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .input-area {
        padding: 0 8px 12px;
    }

    .input-wrapper {
        border-radius: 20px;
    }

    .chat-options-btn {
        opacity: 1;
    }

    .user-msg-options-btn {
        display: none !important;
    }

    .edit-btn-mobile {
        display: flex;
    }
}

/* ── Footer / Disclaimer ────────────────────────────────── */
.footer-text {
    font-size: 10px;
    letter-spacing: 0.2px;
    color: var(--text-3);
    text-align: center;
    max-width: 750px;
    width: 100%;
    margin-top: 8px;
}

.edit-btn-mobile {
    display: none;
}

/* ══════════════════════════════════════════════════════════
   UTILITY / MISC
══════════════════════════════════════════════════════════ */
/* Sidebar collapsed: icons-only mode */
.sidebar.collapsed .sidebar-menu-btn {
    margin: 0 auto;
}

.sidebar.collapsed .new-chat-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    padding: 0;
}

/* Tech greeting gradient override for light mode */
.tech-greeting {
    background: linear-gradient(90deg, #4285f4, #9b72cb, #d96570);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .tech-greeting {
    background: linear-gradient(135deg, #1a8c3a, #0077cc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Mobile: show always-visible options btn */
@media(max-width: 768px) {
    .message-actions {
        opacity: 1;
    }
}

/* Scrollbar global */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--surface-2);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-3);
}

/* ── Bottom Sheet Menu ──────────────────────────────────── */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    z-index: 999;
    transition: opacity 0.3s ease;
}

.bottom-sheet-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    background: var(--surface);
    border-radius: 24px 24px 0 0;
    padding: 24px 16px 32px 16px;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
    .bottom-sheet {
        width: 360px;
        left: 50%;
        bottom: 50%;
        transform: translate(-50%, 100%) scale(0.9);
        opacity: 0;
        border-radius: 24px;
        padding: 16px 0;
    }

    .bottom-sheet.open {
        transform: translate(-50%, 50%) scale(1);
        opacity: 1;
    }
}

.bottom-sheet.open {
    transform: translateY(0);
}

.bottom-sheet-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: transparent;
    border: none;
    color: var(--text-1);
    font-size: 16px;
    text-align: left;
    width: 100%;
    transition: background-color 0.2s;
    border-radius: 0;
    cursor: pointer;
}

.bottom-sheet-item:hover {
    background-color: var(--chip-hover);
}

.bottom-sheet-item.danger {
    color: #ff6b6b;
}

.bottom-sheet-item.danger .material-symbols-outlined {
    color: #ff6b6b;
}

.bottom-sheet-item .material-symbols-outlined {
    color: var(--text-2);
    font-size: 24px;
}

/* ── Mobile Search Overlay ──────────────────────────────── */
.mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background: var(--bg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mobile-search-overlay.open {
    transform: translateY(0);
}

.mobile-search-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.mobile-search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-1);
    font-size: 16px;
    outline: none;
}

.mobile-search-input::placeholder {
    color: var(--text-3);
}

.mobile-search-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}