/* Ultra-Minimalist AI Chat Interface - ChatGPT/Claude Style */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

/* Root Variables - Premium Design System */
:root {
    /* 3-Tone Surface System - Refined for Visual Harmony */
    --color-bg-base: rgb(12, 18, 27);        /* Base background - deepest navy, main chat area */
    --color-bg-surface: rgb(17, 24, 35);     /* Surface - sidebar, header, panels */
    --color-bg-elevated: rgb(22, 31, 43);    /* Elevated - hover states, buttons, tooltips */
    --color-bg-input: rgb(25, 35, 48);       /* Input fields - slightly lighter for distinction */
    
    /* Legacy aliases for compatibility */
    --color-bg-main: var(--color-bg-base);
    --color-bg-sidebar: var(--color-bg-surface);
    
    /* Borders and Structure - Refined for Subtlety */
    --color-border: rgba(255, 255, 255, 0.05);      /* Ultra-subtle borders */
    --color-border-medium: rgba(255, 255, 255, 0.08); /* Medium borders */
    --color-border-hover: rgba(255, 255, 255, 0.12); /* Hover state borders */
    
    /* Text Colors - Premium Hierarchy */
    --color-text-primary: rgba(255, 255, 255, 0.92);   /* Primary text - soft white, readable */
    --color-text-secondary: rgba(255, 255, 255, 0.60); /* Secondary text - balanced muted */
    --color-text-tertiary: rgba(255, 255, 255, 0.40);  /* Tertiary text - subtle labels */
    --color-text-muted: rgba(255, 255, 255, 0.30);     /* Muted text - placeholders */
    --color-white: #FFFFFF;
    
    /* Accent Colors */
    --color-accent: #00B48C;                    /* Accent from logo */
    --color-accent-hover: #00D4A5;              /* Brighter accent on hover */
    --color-accent-dim: rgba(0, 180, 140, 0.08); /* Subtle accent background */
    
    /* Interactive States - Refined */
    --color-hover-bg: rgba(255, 255, 255, 0.03);    /* Ultra-subtle hover */
    --color-hover-bg-medium: rgba(255, 255, 255, 0.05); /* Medium hover */
    --color-hover-bg-strong: rgba(255, 255, 255, 0.08); /* Strong hover */
    --color-active-bg: rgba(255, 255, 255, 0.06);   /* Active/selected state */
    
    /* Button Colors */
    --color-btn-primary: var(--color-bg-elevated);
    --color-btn-primary-hover: rgb(28, 40, 54);
    --color-btn-secondary-bg: transparent;
    --color-btn-hover-bg: var(--color-hover-bg-medium);
    
    /* Tooltip Colors */
    --color-tooltip-bg: var(--color-bg-elevated);
    --color-tooltip-shadow: rgba(0, 0, 0, 0.6);
    
    /* Shadows - Refined Depth */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.4);
    
    /* Typography - Premium Scale */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Spacing Grid - 4px base */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --spacing-2xl: 24px;
    --spacing-3xl: 32px;
    
    /* Border Radius - Consistent Rounding */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    
    /* Transitions - Refined Timing */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --sidebar-width: 260px;
    
    /* Safe Area Insets for Mobile (notches, home indicators) */
    --safe-area-top: env(safe-area-inset-top);
    --safe-area-bottom: env(safe-area-inset-bottom);
    --safe-area-left: env(safe-area-inset-left);
    --safe-area-right: env(safe-area-inset-right);
}

/* Base Styles */
html, body {
    height: 100%;
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--color-text-primary);
    background: var(--color-bg-main);
    overflow: hidden;
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
    background: var(--color-bg-main);
}

/* Sidebar - Premium Styling */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-bg-sidebar);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    padding: var(--spacing-xl) var(--spacing-md);
    overflow-x: hidden;
    overflow-y: auto;
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: width var(--transition-slow), padding var(--transition-slow), transform var(--transition-slow);
    position: relative;
    z-index: 1001;
    box-shadow: inset -1px 0 0 var(--color-border);
}

/* Collapsed Sidebar State */
.sidebar.collapsed {
    width: 64px;
    padding: 16px 8px;
}

/* Hide text labels when collapsed */
.sidebar.collapsed .new-chat-label,
.sidebar.collapsed .search-label,
.sidebar.collapsed .tools-title,
.sidebar.collapsed .tool-name,
.sidebar.collapsed .conversation-title,
.sidebar.collapsed .history-header {
    display: none;
}

/* Center icons when collapsed */
.sidebar.collapsed .sidebar-new-chat-btn,
.sidebar.collapsed .sidebar-search-btn,
.sidebar.collapsed .tool-item,
.sidebar.collapsed .conversation-item {
    justify-content: center;
    padding-left: 8px;
    padding-right: 8px;
}

/* Adjust tools header when collapsed */
.sidebar.collapsed .tools-header {
    justify-content: center;
}

.sidebar.collapsed .tools-title-wrapper {
    justify-content: center;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden; /* Prevent scrolling on the container */
}

/* Sidebar Icons Header */
.sidebar-icons-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 4px;
    overflow: hidden; /* Prevent icon overflow */
}

.sidebar-icon-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    opacity: 0.75;
}

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

.sidebar-icon-btn:active {
    transform: scale(0.96);
}

.sidebar-icon-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    transition: transform 0.3s ease;
}

/* Rotate toggle icon when sidebar is collapsed */
.sidebar.collapsed #toggle-sidebar-btn svg {
    transform: rotate(180deg);
}

/* Tooltip for sidebar icons */
.sidebar-icon-btn {
    position: relative;
}

/* Default tooltip (right side) - for settings icon */
.sidebar-icon-btn::after {
    content: attr(data-tooltip) !important;
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    background: #131C26 !important;
    color: #FFFFFF !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif !important;
    line-height: 1.4 !important;
    padding: 6px 10px !important;
    border-radius: 6px;
    white-space: nowrap !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    z-index: 10000 !important;
    min-width: max-content;
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

/* Disable CSS tooltips - using JavaScript tooltips instead */
.sidebar-icon-btn::after,
.sidebar-new-chat-btn::after,
.tools-header::after,
.tool-item::after {
    display: none !important;
}

/* Hide tooltips when sidebar is open (text labels are visible) */
/* Temporarily disabled for debugging
.sidebar:not(.collapsed) .sidebar-icon-btn::after {
    display: none;
}
*/

/* Tooltip below icon - for toggle sidebar icon */
#toggle-sidebar-btn::after {
    left: 50%;
    top: calc(100% + 6px);
    transform: translateX(-50%) translateY(-4px);
}

/* Toggle button tooltip shows on hover (for debugging - always visible) */
#toggle-sidebar-btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Toggle button tooltip only shows when collapsed */
.sidebar.collapsed #toggle-sidebar-btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Hide toggle button tooltip when sidebar is open */
/* Temporarily disabled for debugging
.sidebar:not(.collapsed) #toggle-sidebar-btn::after {
    display: none;
}
*/

/* Settings Icon PNG */
.sidebar-settings-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    filter: brightness(0) invert(1);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.sidebar-settings-btn:hover img {
    opacity: 1;
}

/* Open Sidebar Button (visible when collapsed) */
.sidebar-open-btn {
    transition: all 0.2s ease;
}

.sidebar-open-btn svg {
    transition: transform 0.2s ease;
}

.sidebar-open-btn:hover svg {
    transform: translateX(2px);
}

/* Hide/Show buttons based on sidebar state */
.sidebar.collapsed .sidebar-settings-btn {
    display: none;
}

.sidebar.collapsed #toggle-sidebar-btn {
    display: none;
}

.sidebar.collapsed .sidebar-open-btn {
    display: flex !important;
}

.sidebar:not(.collapsed) .sidebar-open-btn {
    display: none !important;
}

/* New Chat Button - Premium Styling */
.sidebar-new-chat-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    width: 100%;
    padding: 10px var(--spacing-md);
    margin-top: 0;
    margin-bottom: var(--spacing-sm);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
    position: relative;
}

/* Tooltip for New Chat button */
.sidebar-new-chat-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    background: #131C26;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    line-height: 1.4;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    min-width: max-content;
    display: block;
}

/* Show New Chat tooltip on hover (for debugging - always visible) */
.sidebar-new-chat-btn:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Only show New Chat tooltip when sidebar is collapsed */
.sidebar.collapsed .sidebar-new-chat-btn:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Hide New Chat tooltip when sidebar is open */
/* Temporarily disabled for debugging
.sidebar:not(.collapsed) .sidebar-new-chat-btn::after {
    display: none;
}
*/

.sidebar-new-chat-btn:hover {
    background: var(--color-hover-bg-medium);
}

.new-chat-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--color-text-secondary);
    stroke-width: 2;
    opacity: 0.8;
    transition: opacity var(--transition-fast), color var(--transition-fast);
}

.sidebar-new-chat-btn:hover .new-chat-icon {
    opacity: 1;
    color: var(--color-text-primary);
}

/* Primary Item Typography (Level 2) - Inter Font */
.new-chat-label {
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    letter-spacing: -0.01em;
    line-height: 1.4;
    transition: color var(--transition-fast);
    user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.sidebar-new-chat-btn:hover .new-chat-label {
    color: var(--color-text-primary);
}

/* Search Chats Button - matches New Chat styling */
.sidebar-search-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    margin-top: 0;
    margin-bottom: 8px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    position: relative;
}

.sidebar-search-btn:hover {
    background: rgba(255, 255, 255, 0.04);
}

.search-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--color-text-secondary);
    stroke-width: 2;
    opacity: 0.75;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.sidebar-search-btn:hover .search-icon {
    opacity: 1;
    color: var(--color-text-primary);
}

.search-label {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    letter-spacing: -0.01em;
    line-height: 1.4;
    transition: color 0.15s ease;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.sidebar-search-btn:hover .search-label {
    color: var(--color-text-primary);
}

/* New Chat Button */
.new-chat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--color-btn-primary);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text-primary);
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 16px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.05);
}

.new-chat-btn:hover {
    background: var(--color-btn-primary-hover);
    border-color: var(--color-border-hover);
}

.context-selector {
    margin-bottom: 20px;
}

.context-selector select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-btn-primary);
    color: var(--color-text-primary);
    font-family: var(--font-family);
    font-size: 12px;
    cursor: pointer;
}

.context-selector select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px var(--color-accent);
}

/* Tools Section */
.tools-section {
    margin-top: 0;
    margin-bottom: 32px;
}

.tools-header {
    cursor: pointer;
    user-select: none;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    transition: all 0.15s ease;
    background: transparent;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    position: relative;
}

/* Tooltip for Tools header */
.tools-header::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    background: #131C26;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    line-height: 1.4;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    min-width: max-content;
    display: block;
}

/* Show Tools tooltip on hover (for debugging - always visible) */
.tools-header:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Only show Tools tooltip when sidebar is collapsed */
.sidebar.collapsed .tools-header:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Hide Tools tooltip when sidebar is open */
/* Temporarily disabled for debugging
.sidebar:not(.collapsed) .tools-header::after {
    display: none;
}
*/

.tools-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.tools-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Tools Section Title - Premium Typography */
.tools-title {
    font-family: var(--font-family);
    text-transform: none !important;
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    letter-spacing: -0.01em;
    line-height: 1.5;
    transition: color var(--transition-fast);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.tools-header:hover .tools-title {
    color: var(--color-text-primary);
}

.tools-icon-container {
    position: relative;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.tools-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    color: var(--color-text-secondary);
    stroke-width: 2;
    transition: opacity 0.15s ease-in-out, transform 0.15s ease-in-out, color 0.15s ease;
}

.tools-header:hover .tools-icon {
    color: var(--color-text-primary);
}

/* Default state: show wrench */
.wrench-icon {
    opacity: 0.75;
}

.chevron-right-icon {
    opacity: 0;
}

.chevron-down-icon {
    opacity: 0;
}

/* Hover state: show chevron right */
.tools-header:hover .wrench-icon {
    opacity: 0;
}

.tools-header:hover .chevron-right-icon {
    opacity: 0.75;
}

/* Open state: show chevron down */
.tools-header.open .wrench-icon {
    opacity: 0;
}

.tools-header.open .chevron-right-icon {
    opacity: 0;
}

.tools-header.open .chevron-down-icon {
    opacity: 0.75;
}

/* When open, don't show wrench on hover */
.tools-header.open:hover .wrench-icon {
    opacity: 0;
}

.tools-header.open:hover .chevron-right-icon {
    opacity: 0;
}

.tools-header.open:hover .chevron-down-icon {
    opacity: 1;
}

.tool-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, margin-top 0.3s ease-in-out;
    margin-top: 8px;
}

.tool-list.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

/* Sub-items Typography (Level 3) with Hover Background */
.tool-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px 8px 32px; /* pl-8 for clear indent hierarchy */
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    user-select: none;
    position: relative;
}

/* Tooltip for tool items */
.tool-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    background: #131C26;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    line-height: 1.4;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    min-width: max-content;
    display: block;
}

/* Show tool item tooltips on hover (for debugging - always visible) */
.tool-item:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Only show tool item tooltips when sidebar is collapsed */
.sidebar.collapsed .tool-item:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Hide tool item tooltips when sidebar is open */
/* Temporarily disabled for debugging
.sidebar:not(.collapsed) .tool-item::after {
    display: none;
}
*/

.tool-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.tool-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--color-text-secondary);
    stroke-width: 2;
    opacity: 0.65;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.tool-item:hover .tool-icon {
    color: var(--color-text-secondary);
    opacity: 0.9;
}

/* Sub-item Text - Inter Font */
.tool-name {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: rgba(163, 177, 192, 0.85); /* Slightly muted */
    letter-spacing: -0.005em;
    transition: color 0.15s ease;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.tool-item:hover .tool-name {
    color: var(--color-text-secondary);
}

/* Conversation History */
.conversation-history {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Allow flex item to shrink below content size */
    overflow: hidden; /* Prevent overflow on container */
}

.history-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0; /* Allow flex item to shrink */
    overflow: hidden; /* Prevent overflow on container */
}

/* Section Headings (Chats) - Premium Typography */
.history-header {
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    text-transform: none;
    letter-spacing: -0.01em;
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-2xl) var(--spacing-md) 0 var(--spacing-md);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    flex-shrink: 0;
    position: relative;
}

/* Scroll indicator - subtle shadow that appears when list is scrolled */
.history-header::after {
    content: '';
    position: absolute;
    bottom: -12px; /* Position at bottom of header (where margin-bottom ends) */
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.08), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

/* Show scroll indicator when chat list is scrolled */
.history-header.scrolled::after {
    opacity: 1;
}

.conversation-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow-y: auto; /* Make the list scrollable */
    overflow-x: visible; /* Allow tooltips to extend beyond list */
    padding-bottom: 16px; /* Add padding at bottom for spacing */
}

/* Chat Items - Sub-item Typography (Level 3) with Hover Background - Inter Font */
.conversation-item {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 13px;
    color: rgba(163, 177, 192, 0.85);
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 2px solid transparent;
    border-right: 1px solid transparent;
    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
    position: relative; /* For tooltip positioning */
    overflow: visible; /* Allow tooltips to extend beyond item */
    user-select: none;
    background: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.conversation-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-text-secondary);
}

.conversation-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-primary);
    border-left-color: var(--color-accent);
    box-shadow: 0 0 0 1px rgba(0, 180, 140, 0.1);
}

.conversation-title-wrapper {
    flex: 1;
    overflow: hidden; /* Keep hidden for text ellipsis */
    margin-right: 8px;
    position: relative;
    z-index: 1; /* Lower than tooltips */
}

.conversation-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
    letter-spacing: 0;
    transition: all 0.15s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.conversation-title-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--color-accent);
    outline: none;
    color: #F3F4F6; /* gray-100 */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
    padding: 2px 0;
    transition: border-color 0.15s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.conversation-title-input:focus {
    border-bottom-color: var(--color-accent-hover);
}

.conversation-title-input.hidden {
    display: none;
}

.conversation-actions {
    opacity: 0;
    display: flex;
    gap: 4px;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
    position: relative; /* For tooltip positioning */
    overflow: visible; /* Allow tooltips to extend beyond container */
    z-index: 100; /* Ensure actions are above other elements but below tooltips */
}

.conversation-item:hover .conversation-actions {
    opacity: 1;
}

.conversation-item.active .conversation-actions {
    opacity: 0.7;
}

.conversation-item.active:hover .conversation-actions {
    opacity: 1;
}

.conversation-action {
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    position: relative;
}

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

/* Rename button: neutral hover (no color change) */
.conversation-action.rename-btn:hover {
    color: var(--color-text-primary);
}

/* Recycle button: green accent hover */
.conversation-action.delete-btn:hover {
    color: var(--color-accent);
}

/* Tooltip for conversation action buttons - DISABLED (using JavaScript portal tooltips instead) */
.conversation-action {
    position: relative;
}

/* CSS tooltips disabled - using JavaScript TooltipManager for portal-based tooltips */
/*
.conversation-action::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    background: #131C26;
    color: #FFFFFF;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    z-index: 99999;
    will-change: opacity, transform;
}

.conversation-action:hover::after,
.conversation-action:focus::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}
*/

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    background: var(--color-bg-main);
}

/* Top Bar Header - Premium Styling */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-2xl);
    background: var(--color-bg-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 56px;
    flex-shrink: 0;
    animation: fadeInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.top-bar-left {
    display: flex;
    align-items: center;
}

.top-bar-brand {
    font-family: var(--font-family);
    font-size: 18px;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--color-text-primary);
    margin: 0;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.top-bar-right {
    display: flex;
    align-items: center;
}

.share-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 7px 14px;
    background: transparent;
    border: 1px solid var(--color-border-medium);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.share-button:hover {
    background: var(--color-hover-bg-medium);
    border-color: var(--color-border-hover);
    color: var(--color-text-primary);
}

.share-button:active {
    transform: scale(0.97);
    background: var(--color-hover-bg);
}

.share-button.share-success {
    background: var(--color-hover-bg-medium);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.share-button.share-success .share-icon {
    opacity: 1;
    stroke: var(--color-accent);
}

.share-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke-width: 2;
    opacity: 0.9;
    transition: opacity var(--transition-fast);
}

.share-button:hover .share-icon {
    opacity: 1;
}

.share-label {
    user-select: none;
    line-height: 1;
    position: relative;
}

.share-label::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.share-button:hover .share-label::after {
    transform: scaleX(1);
}

/* Welcome State - Responsive Positioning */
.welcome-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgb(18, 26, 35);
    overflow: hidden; /* Prevent layout shift during animation */
}

.welcome-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    position: relative; /* Create positioning context for logo */
}

/* Desktop: Centered vertically and horizontally */
.welcome-logo {
    width: 45vw; /* Visually dominant hero element */
    max-width: 650px; /* Allow significant size on large screens */
    height: auto;
    object-fit: contain;
    display: block;
    opacity: 0.9;
    animation: fadeInLogo 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform: scale(1.8); /* 10% smaller: 2.0 * 0.9 = 1.8 */
    transform-origin: center center; /* Scale from center */
    will-change: transform, opacity; /* Optimize animation performance */
    backface-visibility: hidden; /* Prevent animation flicker */
    position: relative; /* Isolate from layout flow */
}


/* Chat Content */
.chat-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 10%; /* 10% horizontal padding on each side */
    background: var(--color-bg-main);
}

.messages-container {
    max-width: 70ch; /* ~65-75% width, optimal for reading */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px; /* Slightly increased spacing between messages */
}

/* Messages */
.message {
    display: flex;
    align-items: flex-start;
}

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

.message-content {
    flex: 1;
    min-width: 0;
}

.message.user-message .message-content {
    max-width: 75%; /* Allow slightly wider bubbles */
    background: var(--color-bg-sidebar);
    padding: 12px 16px;
    border-radius: 18px;
    border-bottom-right-radius: 4px;
}

.message-text {
    line-height: 1.6; /* Comfortable line height for readability */
    font-size: 14px;
    font-weight: 400;
    color: #D1D9E2; /* Softer than primary text, more integrated */
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* User messages - slightly brighter for distinction */
.message.user-message .message-text {
    color: #E0E6ED;
    font-weight: 400;
}

.message-text p {
    margin-bottom: 12px;
}

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

.message-text h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 16px 0 8px 0;
    color: #E0E6ED; /* Slightly brighter for headings */
}

.message-text ul {
    margin: 12px 0 12px 20px;
}

.message-text li {
    margin-bottom: 6px;
}

.message-text strong {
    font-weight: 600;
    color: #E0E6ED; /* Slightly brighter for emphasis */
}

/* Input Area - Fixed at Bottom like ChatGPT */
.input-area {
    position: sticky;
    bottom: 0;
    background: var(--color-bg-surface);
    padding: var(--spacing-2xl) 10%;
    border-top: 1px solid var(--color-border);
}

.input-container {
    max-width: 70ch;
    margin: 0 auto;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: var(--spacing-sm);
    background: var(--color-bg-input);
    border: 1px solid var(--color-border-medium);
    border-radius: 24px;
    padding: var(--spacing-md) var(--spacing-lg);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.input-wrapper:focus-within {
    border-color: var(--color-border-hover);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.02);
}

#user-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-family);
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-white);
    resize: none;
    min-height: 22px;
    max-height: 120px;
    overflow-y: auto;
    font-weight: 400;
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#user-input::placeholder {
    color: var(--color-text-muted);
    font-size: 13px;
    opacity: 1;
    transition: opacity var(--transition-normal);
    font-weight: 400;
    letter-spacing: -0.005em;
}

#user-input:focus::placeholder {
    opacity: 0.6;
}

/* Fade-in animation for placeholder when input is cleared */
@keyframes placeholderFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 0.6;
    }
}

#user-input.input-cleared::placeholder {
    animation: placeholderFadeIn 0.25s ease-in-out;
}

/* Add Files Button */
.add-files-button {
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--color-text-secondary);
    flex-shrink: 0;
    margin-right: 8px;
    position: relative;
}

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

.add-files-button:active {
    transform: scale(0.95);
}

/* Tooltip handled by JavaScript TooltipManager */

/* Send Button - Hidden on Desktop, Visible on Mobile */
.send-button {
    display: flex; /* Visible on both desktop and mobile */
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-accent) 0%, #00c896 100%);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    flex-shrink: 0;
    margin-left: 10px;
    box-shadow: 0 2px 8px rgba(0, 180, 140, 0.25),
                0 4px 16px rgba(0, 180, 140, 0.15);
    position: relative;
    overflow: hidden;
}

.send-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.send-button:hover:not(:disabled)::before {
    width: 100%;
    height: 100%;
}

.send-button:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--color-accent-hover) 0%, #00dba8 100%);
    box-shadow: 0 4px 12px rgba(0, 180, 140, 0.35),
                0 6px 20px rgba(0, 180, 140, 0.2);
    transform: translateY(-2px);
}

.send-button:active:not(:disabled) {
    transform: translateY(0) scale(0.96);
    box-shadow: 0 2px 6px rgba(0, 180, 140, 0.3);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    background: var(--color-bg-input);
}

.send-button svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.send-button:hover:not(:disabled) svg {
    transform: translateX(2px) translateY(-2px) rotate(-5deg);
}

.send-button:active:not(:disabled) svg {
    transform: translateX(1px) translateY(-1px) rotate(-3deg);
}

/* Loading Indicator */
.loading-indicator {
    align-self: center;
    width: fit-content;
    background: var(--color-bg-sidebar);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 2px 6px var(--color-tooltip-shadow);
}

.loading-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
    animation: loading-pulse 1.4s ease-in-out infinite both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }
.dot:nth-child(3) { animation-delay: 0s; }

@keyframes loading-pulse {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Message Animation */
.message {
    animation: fadeIn 0.3s ease;
}

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

/* Logo Fade-in Animation - Enhanced (works with scale transforms) */
@keyframes fadeInLogo {
    0% {
        opacity: 0;
        transform: scale(1.656) translateY(10px); /* 0.92 * 1.8 = 1.656 */
    }
    60% {
        opacity: 0.95;
    }
    100% {
        opacity: 0.9;
        transform: scale(1.8) translateY(0); /* Desktop: ends at 1.8x scale (10% smaller) */
    }
}

/* Mobile-specific animation override */
@media (max-width: 767px) {
    @keyframes fadeInLogo {
        0% {
            opacity: 0;
            transform: scale(2.116) translateY(10px); /* 0.92 * 2.3 = 2.116 */
        }
        60% {
            opacity: 0.95;
        }
        100% {
            opacity: 0.9;
            transform: scale(2.3) translateY(0); /* Mobile: ends at 2.3x scale */
        }
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* ============================================================================
   RESPONSIVE DESIGN - Mobile-First Optimizations
   ============================================================================ */

/* Tablet: 768px - 1023px */
@media (max-width: 1023px) {
    .sidebar {
        display: none; /* Hide sidebar completely on tablet and mobile */
    }
    
    .main-content {
        width: 100%;
        margin-left: 0;
    }
}

/* Tablet: 768px - 1199px */
@media (max-width: 1199px) and (min-width: 768px) {
    .welcome-state {
        align-items: flex-start;
        padding-top: 30vh; /* Smooth progression between mobile and desktop */
    }
    
    .welcome-logo {
        width: 42vw; /* Larger for tablet visibility */
        max-width: 500px; /* Removed restrictive cap */
        transform: scale(1.8); /* 10% smaller to match desktop */
        transform-origin: center center;
        will-change: transform, opacity;
        backface-visibility: hidden;
        position: relative;
    }
}

/* Mobile: Below 768px - Full Mobile Optimizations */
@media (max-width: 767px) {
    /* === Safe Area Support for Notches === */
    body {
        padding-top: var(--safe-area-top);
        padding-left: var(--safe-area-left);
        padding-right: var(--safe-area-right);
    }
    
    /* === Top Bar Mobile Optimization === */
    .top-bar {
        padding: max(10px, var(--safe-area-top)) 16px 10px 16px;
        min-height: 52px;
    }
    
    .top-bar-brand {
        font-size: 17px;
    }
    
    /* Hide share button on mobile */
    .share-button {
        display: flex; /* Show on mobile */
        padding: 6px 12px; /* Slightly smaller on mobile */
        font-size: 12px; /* Slightly smaller text */
    }
    
    .share-label {
        display: inline; /* Ensure label shows on mobile too */
    }
    
    /* === Welcome State - Mobile Logo Positioning === */
    .welcome-state {
        align-items: center !important;
        justify-content: center !important;
    }
    
    .welcome-content {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        transform: translateY(-10vh) !important; /* Shift logo UP by 10vh (moved down 15% from -25vh) */
    }
    
    .welcome-logo {
        width: 52vw; /* Bold size - clearly readable without zoom */
        max-width: 450px; /* Removed restrictive 280px cap */
        transform: scale(2.53) !important; /* 2.3 * 1.1 = 10% larger */
        transform-origin: center center;
        will-change: transform, opacity;
        backface-visibility: hidden;
        position: relative;
    }
    
    /* === Chat Content === */
    .chat-content {
        padding: 20px 6% 220px 6%; /* Extra large bottom padding to fully clear fixed input */
        -webkit-overflow-scrolling: touch; /* Smooth iOS scrolling */
        min-height: calc(100vh - 52px); /* Full height minus top bar */
        max-height: calc(100vh - 52px); /* Prevent overflow beyond viewport */
        overflow-y: auto; /* Enable scrolling */
        flex: 1; /* Take remaining space */
        position: relative; /* Establish positioning context */
    }
    
    .messages-container {
        gap: 20px;
        max-width: 100%;
    }
    
    .message.user-message .message-content {
        max-width: 85%;
    }
    
    .message-text {
        font-size: 14px;
        line-height: 1.6;
    }
    
    /* === Fixed Input Area for Mobile === */
    .input-area {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 12px 6% max(16px, var(--safe-area-bottom)) 6%;
        background: var(--color-bg-surface);
        border-top: 1px solid var(--color-border);
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .input-wrapper {
        padding: 12px 14px; /* Increased vertical padding for better text visibility */
        border-radius: 20px;
        min-height: 48px; /* Ensure adequate height for content */
    }
    
    /* === Input Field - Prevent iOS Zoom === */
    #user-input {
        font-size: 16px !important;
        line-height: 1.6 !important;
        height: auto !important; /* Let content determine height */
        min-height: 50px !important; /* Ensure adequate space for placeholder */
        max-height: 120px !important;
        padding: 12px 0 !important; /* More vertical padding */
        overflow-y: auto !important;
        box-sizing: border-box !important;
    }
    
    #user-input::placeholder {
        font-size: 15px !important; /* Slightly smaller for better fit */
        line-height: 1.5 !important;
        white-space: normal !important;
        display: block !important;
    }
    
    /* === Mobile Button Visibility === */
    /* Hide upload button on mobile */
    .add-files-button {
        display: none !important;
    }
    
    /* Send button already visible - enhance for mobile */
    .send-button {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
    }
}

/* Small Mobile: Below 480px - Ultra-Compact Layout */
@media (max-width: 480px) {
    /* === Top Bar === */
    .top-bar {
        padding: max(8px, var(--safe-area-top)) 12px 8px 12px;
        min-height: 48px;
    }
    
    .top-bar-brand {
        font-size: 16px;
    }
    
    /* === Welcome State - Small Mobile === */
    .welcome-logo {
        width: 55vw; /* Extra large for legibility on tiny screens */
        max-width: 400px;
        transform: scale(2.53); /* 10% larger than base mobile (2.3 * 1.1) */
        transform-origin: center center;
        will-change: transform, opacity;
        backface-visibility: hidden;
        position: relative;
    }
    
    /* === Chat Content === */
    .chat-content {
        padding: 16px 4% 220px 4%; /* Match main mobile padding */
        min-height: calc(100vh - 48px); /* Full height minus smaller top bar */
        max-height: calc(100vh - 48px);
        overflow-y: auto;
        flex: 1;
        position: relative;
    }
    
    .messages-container {
        gap: 16px;
        max-width: 100%;
    }
    
    .message.user-message .message-content {
        max-width: 90%;
        padding: 12px 14px;
    }
    
    .message-text {
        font-size: 14px;
    }
    
    /* === Input Area === */
    .input-area {
        padding: 10px 4% max(12px, var(--safe-area-bottom)) 4%;
    }
    
    .input-wrapper {
        padding: 10px 12px;
    }
    
    #user-input {
        font-size: 16px !important;
        line-height: 1.6 !important;
        height: auto !important;
        min-height: 50px !important;
        max-height: 120px !important;
        padding: 12px 0 !important;
        overflow-y: auto !important;
        box-sizing: border-box !important;
    }
    
    #user-input::placeholder {
        font-size: 15px !important;
        line-height: 1.5 !important;
        white-space: normal !important;
        display: block !important;
    }
    
    .add-files-button {
        width: 34px;
        height: 34px;
    }
}

/* === Landscape Mode on Mobile === */
@media (max-width: 768px) and (orientation: landscape) {
    .top-bar {
        padding: 8px 16px;
        min-height: 44px;
    }
    
    .top-bar-brand {
        font-size: 15px;
    }
    
    /* Welcome logo in landscape - compact positioning */
    .welcome-state {
        padding-top: 20vh; /* Balanced use of limited vertical space */
    }
    
    .welcome-logo {
        width: 40vw; /* Assertive size for horizontal space */
        max-width: 350px; /* Removed restrictive 240px cap */
        transform: scale(2.0); /* Force 2x visual size */
        transform-origin: center center;
        will-change: transform, opacity;
        backface-visibility: hidden;
        position: relative;
    }
    
    .chat-content {
        padding: 12px 6% 80px 6%;
    }
    
    .input-area {
        padding: 8px 6% max(8px, var(--safe-area-bottom)) 6%;
    }
    
    .input-wrapper {
        padding: 8px 12px;
    }
}

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

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

.chat-content::-webkit-scrollbar-thumb {
    background: var(--color-text-secondary);
    border-radius: 3px;
}

.chat-content::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-primary);
}

/* Focus States */
button:focus-visible,
select:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .welcome-logo {
        animation: none !important;
    }
}