/* ===================================================================
   OMBEE AI - CHAT INTERFACE STYLES
   =================================================================== */

body {
    height: 100vh;
    overflow: hidden;
}

/* ===================================================================
   DARK THEME OVERRIDES
   =================================================================== */

[data-theme="dark"] .message.assistant .message-content {
    background: transparent;
    color: var(--text-primary);
    border: none;
}

[data-theme="dark"] .message.user .message-content {
    background: rgba(236, 199, 25, 0.2);
    color: #ffffff;
}

[data-theme="dark"] .chat-item {
    background: rgba(50, 50, 50, 0.5);
    border: 2px solid transparent;
}

[data-theme="dark"] .chat-item.active {
    background: rgba(236, 199, 25, 0.2);
    border-color: var(--accent-primary);
}

[data-theme="dark"] .settings-toggle-btn {
    background: rgba(50, 50, 50, 0.5);
}

[data-theme="dark"] .settings-toggle-btn:hover {
    background: rgba(60, 60, 60, 0.7);
}

[data-theme="dark"] .sidebar {
    background: rgba(30, 30, 30, 1);
}

[data-theme="dark"] .sidebar-popup-actions {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .sidebar-popup-actions .sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .sidebar-close:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .sidebar.collapsed .sidebar-logo:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .sidebar.collapsed .sidebar-logo::after {
    color: #ccc;
}

[data-theme="dark"] .sidebar-toggle-logo {
    background: rgba(50, 50, 50, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .sidebar-toggle-logo:hover {
    background: rgba(60, 60, 60, 0.7);
}

[data-theme="dark"] .theme-toggle {
    background: rgba(50, 50, 50, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .theme-toggle:hover {
    background: rgba(60, 60, 60, 0.7);
}

[data-theme="dark"] .message-details-dropdown {
    background: rgba(40, 40, 40, 0.8);
}

[data-theme="dark"] .action-btn {
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .action-btn:hover {
    background: rgba(236, 199, 25, 0.15);
}

[data-theme="dark"] .input-wrapper {
    background: rgba(50, 50, 50, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .input-wrapper:focus-within {
    background: rgba(60, 60, 60, 0.7);
    border-color: var(--accent-primary);
}

/* ===================================================================
   APP LAYOUT
   =================================================================== */

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===================================================================
   SIDEBAR - LEFT PANEL WITH CHAT HISTORY
   =================================================================== */

.sidebar {
    width: 300px;
    background: var(--bg-card);
    border-right: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
}

/* Collapsed sidebar - narrow width showing only icons */
.sidebar.collapsed {
    width: 60px;
}

/* --- Sidebar Header --- */
.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow: hidden;
}

/* Center content when collapsed */
.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    cursor: pointer;
}

/* --- Sidebar Logo --- */
.sidebar-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s;
}

.sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Collapsed sidebar logo - clickable with hover effect */
.sidebar.collapsed .sidebar-logo {
    cursor: pointer;
    padding: 0;
    border-radius: 8px;
    width: 28px;
    height: 28px;
}

.sidebar.collapsed .sidebar-logo:hover {
    background: rgba(236, 199, 25, 0.1);
}

.sidebar.collapsed .sidebar-logo img {
    display: block;
    transition: opacity 0.2s;
    width: 100%;
    height: 100%;
}

/* Hover effect: fade out logo, fade in sidebar icon handled in app.js */

.sidebar.collapsed .sidebar-logo:hover::after {
    opacity: 1;
}

.sidebar.collapsed .sidebar-logo:hover img {
    opacity: 0;
}

/* --- Sidebar Title --- */
.sidebar-title {
    color: var(--accent-primary);
    font-size: 1.25rem;
    font-weight: bold;
}

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

/* --- Close Sidebar Button (right side of header when open) --- */
.sidebar-close {
    width: 28px;
    height: 28px;
    background: transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: auto;
    color: var(--text-secondary);
    padding: 0;
}

.sidebar-close:hover {
    background: rgba(236, 199, 25, 0.1);
    color: var(--text-primary);
}

.sidebar-close svg {
    width: 24px;
    height: 24px
}

/* Hide close button when collapsed */
.sidebar.collapsed .sidebar-close {
    display: none;
}

/* --- Upload Button --- */
.upload-btn {
    width: calc(100% - 2rem);
    padding: 0.875rem;
    margin: 1rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    overflow: hidden;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(236, 199, 25, 0.4);
}

/* Collapsed state: circular button with icon */
.sidebar.collapsed .upload-btn {
    width: calc(60px - 2rem);
    height: calc(60px - 2rem);
    padding: 0;
    font-size: 1.5rem;
    line-height: 1;
    border-radius: 50%;
    text-indent: -9999px;
    position: relative;
}

.sidebar.collapsed .upload-btn::before {
    content: '📤';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-indent: 0;
}

/* --- New Chat Button --- */
.new-chat-btn {
    width: calc(100% - 2rem);
    padding: 0.875rem;
    margin: 1rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    overflow: hidden;
}

.new-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(236, 199, 25, 0.4);
}

/* Collapsed state: circular button with + icon */
.sidebar.collapsed .new-chat-btn {
    width: calc(60px - 2rem);
    height: calc(60px - 2rem);
    padding: 0;
    font-size: 1.5rem;
    line-height: 1;
    border-radius: 50%;
    text-indent: -9999px;
    position: relative;
}

.sidebar.collapsed .new-chat-btn::before {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-indent: 0;
}

/* --- Chat History List --- */
.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 0 1rem;
    padding-bottom: 70px;
}

.sidebar.collapsed .chat-history {
    display: none;
}

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

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

.chat-history::-webkit-scrollbar-thumb {
    background: rgba(236, 199, 25, 0.3);
    border-radius: 3px;
}

.chat-history::-webkit-scrollbar-thumb:hover {
    background: rgba(236, 199, 25, 0.5);
}

/* Individual chat item */
.chat-item {
    padding: 0.875rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #ffffff;
    border: 1px solid rgba(236, 199, 25, 0.3);
}

.chat-item:hover {
    border-color: var(--accent-primary);
    background: rgba(236, 199, 25, 0.05);
}

.chat-item.active {
    background: rgba(236, 199, 25, 0.1);
    border: 1px solid var(--accent-primary);
}

.chat-item-title {
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-item-meta {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* --- Sidebar Footer (User Settings) --- */
.sidebar-footer {
    padding: 1rem;
    border-top: 2px solid var(--border-color);
    position: relative;
}

.sidebar.collapsed .sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0.5rem;
    border-top: none;
    background: transparent;
}

.settings-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    border: none;
}

.settings-toggle-btn:hover {
    background: rgba(236, 199, 25, 0.1);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    color: #1a1a1a;
    flex-shrink: 0;
}

.user-details-wrapper {
    display: flex;
    flex: 1;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-email {
    color: var(--text-secondary);
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.popup-icon {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-left: auto;
}

/* Collapsed footer - only show avatar */
.sidebar.collapsed .user-info,
.sidebar.collapsed .user-details-wrapper,
.sidebar.collapsed .popup-icon {
    display: none;
}

.sidebar.collapsed .settings-toggle-btn {
    justify-content: center;
    padding: 0.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0;
}

.sidebar.collapsed .user-avatar {
    margin: 0;
}

/* --- Sidebar Popup Actions (Settings/Logout) --- */
.sidebar-popup-actions {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 10px;
    width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    z-index: 100;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-popup-actions.visible {
    display: flex;
}

.sidebar.collapsed .sidebar-popup-actions {
    left: calc(60px + 10px);
    right: auto;
    bottom: 1rem;
}

.sidebar-popup-actions .sidebar-btn {
    flex: none;
    text-align: left;
    background: transparent;
    border: none;
    font-size: 1rem;
    padding: 0.75rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-popup-actions .sidebar-btn:hover {
    background: rgba(236, 199, 25, 0.1);
}

.sidebar-popup-actions .logout-btn {
    color: #ff6b6b;
}

.sidebar-popup-actions .logout-btn:hover {
    background: rgba(255, 50, 50, 0.1);
}

/* ===================================================================
   MAIN CONTENT AREA
   =================================================================== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

/* --- Header (Top Bar) --- */
.header {
    background: var(--bg-card);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.header-title {
    flex: 1;
    color: var(--accent-primary);
    font-size: 1.25rem;
    font-weight: bold;
}

/* --- Logo Toggle (only shows on mobile when sidebar collapsed) --- */
.sidebar-toggle-logo {
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    overflow: hidden;
    padding: 6px;
}

.sidebar-toggle-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-toggle-logo:hover {
    background: rgba(236, 199, 25, 0.1);
    border-color: var(--accent-primary);
}

/* --- Theme Toggle Button --- */
.theme-toggle {
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: rgba(236, 199, 25, 0.1);
    border-color: var(--accent-primary);
}

/* ===================================================================
   CHAT CONTAINER
   =================================================================== */

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- Messages Area --- */
.messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem 1rem;
}

.messages::-webkit-scrollbar {
    width: 8px;
}

.messages::-webkit-scrollbar-track {
    background: transparent;
}

.messages::-webkit-scrollbar-thumb {
    background: rgba(236, 199, 25, 0.3);
    border-radius: 4px;
}

.messages::-webkit-scrollbar-thumb:hover {
    background: rgba(236, 199, 25, 0.5);
}

/* Welcome screen (shown when no messages) */
.welcome-message {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 700px;
    margin: 0 auto;
}

.welcome-message h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.welcome-message p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* --- Individual Message Bubbles --- */
.message {
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    animation: fadeIn 0.3s ease;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* User messages align to the right */
.message.user {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.message.user .message-wrapper {
    max-width: 70%;
}

/* Assistant messages take full width */
.message.assistant .message-wrapper {
    flex: 1;
    max-width: 100%;
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.message-content {
    padding: 1rem 1.5rem;
    border-radius: 18px;
    line-height: 1.6;
    font-size: 0.95rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
}

/* Streaming indicator (blinking cursor) */
.message-content.streaming::after {
    content: '▋';
    animation: blink 1s infinite;
    margin-left: 2px;
    opacity: 0.6;
}

@keyframes blink {
    0%, 49% { opacity: 0.6; }
    50%, 100% { opacity: 0; }
}

.message-content:not(.streaming)::after {
    content: none;
}

/* User message styling */
.message.user .message-content {
    background: rgba(236, 199, 25, 0.2);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

[data-theme="light"] .message.user .message-content {
    background: rgba(236, 199, 25, 0.2);
    color: #1a1a1a;
}

/* Assistant message styling */
.message.assistant .message-content {
    background: transparent;
    color: var(--text-primary);
    border: none;
    padding-left: 0;
    padding-right: 0;
}

/* --- Message Action Buttons --- */
.message-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 8px;
    transition: opacity 0.2s;
}

/* User message actions - hidden by default, show on hover */
.message.user .message-actions {
    opacity: 0;
    justify-content: flex-end;
}

.message.user .message-wrapper:hover .message-actions {
    opacity: 1;
}

/* Assistant message actions - semi-visible, full opacity on hover */
.message.assistant .message-actions {
    opacity: 0.7;
}

.message.assistant .message-wrapper:hover .message-actions {
    opacity: 1;
}

.action-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.4rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.action-btn:hover {
    background: rgba(236, 199, 25, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.action-btn.success {
    color: #51cf66;
    border-color: #51cf66;
}

.action-btn svg {
    width: 100%;
    height: 100%;
}

.action-btn.details-btn.active {
    background: var(--accent-primary);
    color: #1a1a1a;
    border-color: var(--accent-primary);
}

.action-btn.details-btn.active svg {
    stroke: #1a1a1a;
}

.feedback-btn.active-up {
    color: #51cf66;
    border-color: #51cf66;
    background: rgba(81, 207, 102, 0.1);
}

.feedback-btn.active-down {
    color: #ff6b6b;
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

/* --- Message Details Dropdown --- */
.message-details-dropdown {
    display: none;
    margin-top: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.875rem;
}

.message-details-dropdown.visible {
    display: block;
    animation: slideDown 0.2s ease-out;
}

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

.detail-row {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--text-secondary);
    display: inline-block;
    min-width: 100px;
}

.detail-value {
    color: var(--text-primary);
}

.domain-badge {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(236, 199, 25, 0.15);
    border-radius: 6px;
    font-size: 0.875rem;
}

.sources-list {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.source-item {
    margin: 4px 0;
    color: var(--text-secondary);
}

/* --- Message Editing Mode --- */
.message.user.editing .message-wrapper {
    max-width: 100% !important;
    width: 100%;
}

.message.user.editing .message-content {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
}

.message.user.editing .message-actions {
    display: none;
}

.edit-container {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--accent-primary);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.edit-textarea {
    width: 100%;
    min-height: 120px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    margin-bottom: 1rem;
}

.edit-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

.edit-cancel-btn, .edit-save-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
}

.edit-cancel-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.edit-save-btn {
    background: var(--accent-primary);
    border: none;
    color: #1a1a1a;
}

.edit-save-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* ===================================================================
   INPUT AREA (Bottom of Chat)
   =================================================================== */

.input-container {
    padding: 1.5rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.input-wrapper {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 24px;
    transition: all 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(236, 199, 25, 0.1);
}

#messageInput {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    resize: none;
    font-family: inherit;
    max-height: 200px;
    line-height: 1.5;
    padding: 0.5rem 0;
}

#messageInput::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

#messageInput::-webkit-scrollbar {
    width: 4px;
}

#messageInput::-webkit-scrollbar-thumb {
    background: rgba(236, 199, 25, 0.3);
    border-radius: 2px;
}

#sendButton {
    background: var(--accent-primary);
    border: none;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#sendButton:hover:not(:disabled) {
    background: var(--accent-secondary);
    transform: scale(1.05);
}

#sendButton:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#sendButton svg {
    width: 16px;
    height: 16px;
}

/* --- Typing Indicator --- */
.typing-indicator {
    display: none;
    max-width: 800px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
}

.typing-indicator.active {
    display: block;
}

.typing-dots span {
    animation: blink 1.4s infinite;
}

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

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

/* AI Disclaimer */
.ai-disclaimer {
    text-align: center;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    opacity: 0.7;
    max-width: 800px;
    margin: 0 auto;
}

/* ===================================================================
SETTINGS MODAL
=================================================================== */
.settings-section {
    margin-bottom: 2rem;
}

.settings-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.stat-item {
    background: rgba(236, 199, 25, 0.1);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(236, 199, 25, 0.2);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    color: var(--accent-primary);
    font-size: 1.5rem;
    font-weight: bold;
}

.settings-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.settings-actions button {
    flex: 1;
}

/* ===================================================================
RESPONSIVE DESIGN
=================================================================== */
/* Mobile - Sidebar as overlay */
@media (max-width: 768px) {
    .sidebar {
    position: absolute;
    z-index: 1000;
    height: 100%;
    background: var(--bg-card);
    }

    [data-theme="dark"] .sidebar {
        background: rgba(30, 30, 30, 1);
    }

    /* Collapse = slide off screen */
    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    /* Show logo button in header on mobile */
    .sidebar-toggle-logo {
        display: flex !important;
    }

    .message {
        max-width: 100%;
    }

    .message.user .message-wrapper {
        max-width: 85%;
    }

    .message.assistant .message-wrapper {
        max-width: 95%;
    }

    .input-wrapper {
        border-radius: 20px;
    }

    .messages {
        padding: 1rem 0.5rem;
    }

    .input-container {
        padding: 1rem;
    }
}
/* Desktop - Sidebar always visible, never show header logo */
@media (min-width: 769px) {
    .sidebar-toggle-logo {
    display: none !important;
    }
}