/* ========================================
   Claude Web UI - Dark Theme Styles
   ======================================== */

/* CSS Variables */
:root {
    --bg-primary: #2b2a27;
    --bg-secondary: #1e1e1c;
    --bg-tertiary: #353430;
    --bg-input: #3a3935;
    --bg-hover: #3e3d39;
    --bg-active: #454440;
    --bg-dropdown: #2f2e2b;
    --bg-tooltip: #1a1917;

    --border-subtle: #4a4843;
    --border-input: #4e4d48;

    --text-primary: #e8e4de;
    --text-secondary: #9b9689;
    --text-tertiary: #716d65;
    --text-muted: #5a5752;
    --text-gold: #c4a35a;
    --text-link: #8fb3e0;

    --accent-orange: #da7756;
    --accent-green: #6bba75;
    --accent-red: #e05c5c;

    --sidebar-width-collapsed: 52px;
    --sidebar-width-expanded: 260px;

    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;

    --shadow-dropdown: 0 4px 24px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-modal: 0 8px 40px rgba(0, 0, 0, 0.5);
}

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

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

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
}

a {
    color: inherit;
    text-decoration: none;
}

textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
    outline: none;
    resize: none;
}

::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ========================================
   App Container
   ======================================== */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ========================================
   Icon Button Base
   ======================================== */
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: background var(--transition-fast), color var(--transition-fast);
}
.icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ========================================
   Sidebar Collapsed
   ======================================== */
.sidebar-collapsed {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width-collapsed);
    min-width: var(--sidebar-width-collapsed);
    background: var(--bg-secondary);
    padding: 10px 8px;
    align-items: center;
    z-index: 10;
    border-right: 1px solid rgba(255,255,255,0.04);
}

.sidebar-collapsed.hidden {
    display: none;
}

.sidebar-col-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.sidebar-col-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: auto;
}

.sidebar-toggle-btn {
    color: var(--text-tertiary);
}
.sidebar-toggle-btn:hover {
    color: var(--text-primary);
}

/* ========================================
   Sidebar Expanded
   ======================================== */
.sidebar-expanded {
    display: none;
    flex-direction: column;
    width: var(--sidebar-width-expanded);
    min-width: var(--sidebar-width-expanded);
    background: var(--bg-secondary);
    z-index: 10;
    border-right: 1px solid rgba(255,255,255,0.04);
    overflow: hidden;
}

.sidebar-expanded.visible {
    display: flex;
}

.sidebar-exp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 12px 8px 16px;
}

.sidebar-logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.sidebar-exp-nav {
    display: flex;
    flex-direction: column;
    padding: 4px 8px;
    gap: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    transition: background var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
}
.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Sidebar Sections */
.sidebar-section {
    padding: 8px 8px 0;
    overflow: hidden;
}

.section-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    padding: 8px 10px 4px;
    text-transform: none;
    letter-spacing: 0;
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.chat-item {
    display: block;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.chat-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Sidebar Footer */
.sidebar-exp-footer {
    margin-top: auto;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    flex: 1;
    min-width: 0;
}
.user-profile-btn:hover {
    background: var(--bg-hover);
}

.user-avatar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}
.user-avatar-btn:hover {
    background: var(--bg-hover);
}

.user-avatar-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: #6b5b3e;
    color: #f5e6c8;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}
.user-plan {
    font-size: 11px;
    color: var(--text-tertiary);
    line-height: 1.3;
}

.download-btn {
    flex-shrink: 0;
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

/* ========================================
   Home View
   ======================================== */
.home-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
}

.home-view.hidden {
    display: none;
}

.home-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 600px;
    margin-top: -60px;
}

/* Greeting */
.greeting {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.sparkle-icon {
    font-size: 36px;
    color: var(--accent-orange);
    line-height: 1;
}

.greeting-text {
    font-size: 30px;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

/* ========================================
   Chat Input
   ======================================== */
.chat-input-container {
    width: 100%;
    max-width: 600px;
}

.chat-input-wrapper {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 14px 18px 10px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.chat-input-wrapper:focus-within {
    border-color: var(--text-tertiary);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.05);
}

.chat-input {
    width: 100%;
    min-height: 24px;
    max-height: 200px;
    line-height: 1.5;
    color: var(--text-primary);
    font-size: 15px;
}
.chat-input::placeholder {
    color: var(--text-tertiary);
}

.input-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.attach-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    color: var(--text-tertiary);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}
.attach-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-tertiary);
    background: var(--bg-hover);
}

.input-right-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-selector-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}
.model-selector-btn:hover {
    background: var(--bg-hover);
}

.model-name {
    font-size: 13px;
    color: var(--text-gold);
    font-weight: 500;
}

.model-selector-btn svg {
    color: var(--text-gold);
}

.voice-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}
.voice-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent-orange);
    color: #fff;
    transition: all var(--transition-fast);
}
.send-btn:hover {
    background: #c4694b;
}

/* Stop button style */
.send-btn.stop-btn {
    background: var(--text-primary);
    color: var(--bg-primary);
}
.send-btn.stop-btn svg {
    display: none;
}
.send-btn.stop-btn::after {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    background: var(--bg-primary);
    border-radius: 2px;
}

/* Quick actions hidden when typing */
.quick-actions.hidden {
    display: none;
}

/* ========================================
   Quick Actions
   ======================================== */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.action-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 13px;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.action-pill:hover {
    background: var(--bg-hover);
    border-color: var(--text-tertiary);
    color: var(--text-primary);
}
.action-pill svg {
    flex-shrink: 0;
}

/* ========================================
   Chat View
   ======================================== */
.chat-view {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.chat-view.active {
    display: flex;
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: color var(--transition-fast);
}
.chat-header-left:hover {
    color: var(--text-primary);
}

.chat-title {
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-btn {
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.08);
    transition: all var(--transition-fast);
}
.share-btn:hover {
    background: var(--bg-hover);
    border-color: rgba(255,255,255,0.15);
}

/* Chat Footer Disclaimer */
.chat-footer-disclaimer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    padding: 6px 20px 10px;
    flex-shrink: 0;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.message {
    max-width: 720px;
    margin: 0 auto;
    padding: 12px 40px;
}

.message-user {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.message-user .message-avatar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: #6b5b3e;
    color: #f5e6c8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-top: 2px;
}

.message-user .message-content {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

.message-assistant {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.message-assistant .message-avatar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--accent-orange);
    margin-top: 2px;
}

.message-assistant .message-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.message-assistant .message-content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
}

/* Markdown Content Styles */
.message-content h1, .message-content h2, .message-content h3,
.message-content h4, .message-content h5, .message-content h6 {
    margin: 20px 0 10px;
    font-weight: 600;
    color: var(--text-primary);
}
.message-content h1 { font-size: 1.5em; }
.message-content h2 { font-size: 1.3em; }
.message-content h3 { font-size: 1.15em; }

.message-content p {
    margin: 8px 0;
}
.message-content p:first-child {
    margin-top: 0;
}

.message-content ul, .message-content ol {
    margin: 8px 0;
    padding-left: 24px;
}
.message-content li {
    margin: 4px 0;
}

.message-content blockquote {
    border-left: 3px solid var(--border-subtle);
    padding-left: 16px;
    margin: 12px 0;
    color: var(--text-secondary);
}

.message-content a {
    color: var(--text-link);
    text-decoration: underline;
    text-decoration-color: rgba(143, 179, 224, 0.3);
}
.message-content a:hover {
    text-decoration-color: var(--text-link);
}

.message-content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.88em;
}

.message-content pre {
    background: #1a1a18;
    border-radius: var(--radius-md);
    margin: 12px 0;
    overflow: hidden;
    position: relative;
}

.message-content pre .code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 12px;
    color: var(--text-tertiary);
}

.message-content pre .copy-code-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}
.message-content pre .copy-code-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.message-content pre code {
    display: block;
    padding: 14px 18px;
    overflow-x: auto;
    background: transparent;
    font-size: 13px;
    line-height: 1.6;
    border-radius: 0;
}

.message-content table {
    border-collapse: collapse;
    margin: 12px 0;
    width: 100%;
}
.message-content th, .message-content td {
    border: 1px solid var(--border-subtle);
    padding: 8px 12px;
    text-align: left;
}
.message-content th {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.message-content hr {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 20px 0;
}

.message-content strong {
    font-weight: 600;
}

.message-content em {
    font-style: italic;
}

/* Message Action Buttons */
.message-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 12px;
}

.message-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}
.message-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* Sparkle Separator */
.message-sparkle-separator {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px 40px 8px;
}
.message-sparkle-separator .sparkle-icon {
    font-size: 24px;
    color: var(--accent-orange);
}

/* Typing indicator */
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: var(--text-primary);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

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

/* Chat Input Bottom */
.chat-input-bottom {
    padding: 0 20px 20px;
    margin: 0 auto;
    width: 100%;
    max-width: 800px;
}

/* ========================================
   Model Dropdown
   ======================================== */
.dropdown-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
}
.dropdown-overlay.active {
    display: block;
}

.model-dropdown {
    position: fixed;
    background: var(--bg-dropdown);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    padding: 6px;
    min-width: 280px;
    box-shadow: var(--shadow-dropdown);
    z-index: 101;
    animation: dropdownIn 150ms ease;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.model-option {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    gap: 12px;
    transition: background var(--transition-fast);
}
.model-option:hover {
    background: var(--bg-hover);
}

.model-option-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.model-option-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.model-option-desc {
    font-size: 12px;
    color: var(--text-tertiary);
}

.model-option-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.check-icon {
    display: none;
    color: var(--text-primary);
}

.model-option.selected .check-icon {
    display: block;
}

.model-note {
    font-size: 11px;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1.4;
    max-width: 160px;
    display: none;
}
.model-option.selected .model-note {
    display: block;
}

.model-dropdown-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 4px 6px;
}

/* Toggle Switch */
.toggle-option {
    align-items: center;
}

.toggle-switch {
    width: 40px;
    height: 22px;
    border-radius: 11px;
    background: var(--text-muted);
    position: relative;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.toggle-switch.active {
    background: var(--accent-orange);
}
.toggle-knob {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: #fff;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform var(--transition-fast);
}
.toggle-switch.active .toggle-knob {
    transform: translateX(18px);
}

/* More Models */
.more-models-option {
    align-items: center;
}

.more-models-panel {
    display: none;
}
.more-models-panel.visible {
    display: block;
}

.more-models-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    transition: background var(--transition-fast);
}
.more-models-back:hover {
    background: var(--bg-hover);
}

.model-dropdown .main-models {
    display: block;
}
.model-dropdown .main-models.hidden {
    display: none;
}

/* ========================================
   User Menu
   ======================================== */
.user-menu {
    position: fixed;
    background: var(--bg-dropdown);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    padding: 6px;
    min-width: 240px;
    box-shadow: var(--shadow-dropdown);
    z-index: 101;
    animation: dropdownIn 150ms ease;
}

.user-menu-email {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.user-menu-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 4px 6px;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
    transition: background var(--transition-fast), color var(--transition-fast);
    cursor: pointer;
    width: 100%;
    text-align: left;
}
.user-menu-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.user-menu-item svg {
    flex-shrink: 0;
}

.menu-shortcut {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
}

.submenu-arrow {
    margin-left: auto;
}

.has-submenu {
    position: relative;
}

.logout-item {
    color: var(--text-secondary);
}

/* ========================================
   Language Menu
   ======================================== */
.language-menu {
    position: fixed;
    background: var(--bg-dropdown);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    padding: 6px;
    min-width: 220px;
    box-shadow: var(--shadow-dropdown);
    z-index: 102;
    max-height: 400px;
    overflow-y: auto;
    animation: dropdownIn 150ms ease;
}

.lang-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.lang-option:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.lang-option.selected {
    color: var(--text-primary);
}
.lang-option .check-icon {
    display: none;
}
.lang-option.selected .check-icon {
    display: block;
}

/* ========================================
   Search Modal
   ======================================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    backdrop-filter: blur(4px);
}
.modal-overlay.active {
    display: flex;
}

.search-modal {
    background: var(--bg-dropdown);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    box-shadow: var(--shadow-modal);
    overflow: hidden;
    animation: modalIn 200ms ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.search-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: var(--text-tertiary);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 15px;
    color: var(--text-primary);
    font-family: var(--font-sans);
}
.search-input::placeholder {
    color: var(--text-muted);
}

.search-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}
.search-close-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.search-results {
    padding: 12px 18px;
    min-height: 60px;
    max-height: 400px;
    overflow-y: auto;
}

.search-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 20px 0;
    font-size: 14px;
}

.search-result-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.search-result-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ========================================
   Toast Notification
   ======================================== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-tooltip);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    box-shadow: var(--shadow-dropdown);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-normal);
    z-index: 300;
    border: 1px solid rgba(255,255,255,0.1);
}
.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .sidebar-collapsed {
        width: 44px;
        min-width: 44px;
        padding: 8px 4px;
    }
    .sidebar-expanded {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 50;
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
    .greeting-text {
        font-size: 22px;
    }
    .sparkle-icon {
        font-size: 28px;
    }
    .home-center {
        padding: 0 12px;
    }
    .message {
        padding: 10px 16px;
    }
    .chat-input-bottom {
        padding: 0 12px 12px;
    }
    .quick-actions {
        gap: 6px;
    }
    .action-pill {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ========================================
   Thinking Block
   ======================================== */
.thinking-block {
    margin: 8px 0;
    border-left: 3px solid var(--accent-orange);
    padding: 8px 14px;
    background: rgba(218, 119, 86, 0.06);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.thinking-header {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--accent-orange);
    font-size: 13px;
    font-weight: 500;
    user-select: none;
}

.thinking-header .thinking-chevron {
    transition: transform var(--transition-fast);
}
.thinking-header.expanded .thinking-chevron {
    transform: rotate(90deg);
}

.thinking-content {
    display: none;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.thinking-content.visible {
    display: block;
}

/* ========================================
   Loading dots animation
   ======================================== */
.loading-dots {
    display: inline-flex;
    gap: 4px;
    padding: 4px 0;
}
.loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-tertiary);
    animation: loadingDot 1.4s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}
