/* AI Chat - Open WebUI Style */
:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-sidebar: #171717;
    --bg-hover: #262626;
    --bg-active: #303030;
    --bg-input: #2a2a2a;
    --text-primary: #e5e5e5;
    --text-secondary: #a3a3a3;
    --text-muted: #737373;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --border-color: #2a2a2a;
    --success: #22c55e;
    --error: #ef4444;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --sidebar-width: 260px;
    --transition: 200ms ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
}

/* App Layout */
.app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    transition: width var(--transition), transform var(--transition);
}

.sidebar.collapsed {
    width: 0;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.1rem;
}

.logo-icon {
    font-size: 1.4rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.new-chat-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
}

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

.sidebar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 12px 12px;
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
}

.sidebar-search:focus-within {
    border-color: var(--accent);
}

.sidebar-search input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
}

.sidebar-search input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    font-size: 0.875rem;
    opacity: 0.6;
}

.sidebar-nav {
    padding: 0 12px;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 4px;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px;
}

.history-group {
    margin-bottom: 16px;
}

.history-group-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 8px;
    font-weight: 500;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: all var(--transition);
    position: relative;
}

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

.history-item.active {
    background: var(--bg-active);
    color: var(--text-primary);
}

.history-item-icon {
    font-size: 1rem;
    opacity: 0.7;
}

.history-item-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-delete {
    opacity: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 0.75rem;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    color: var(--error);
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
}

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

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.user-menu:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-name {
    font-size: 0.875rem;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-primary);
}

/* Top Bar */
.top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
}

.model-selector {
    position: relative;
}

.model-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.model-btn:hover {
    border-color: var(--accent);
}

.dropdown-arrow {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.model-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 240px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    z-index: 100;
    overflow: hidden;
}

.model-dropdown.hidden {
    display: none;
}

.dropdown-header {
    padding: 10px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

.model-list {
    max-height: 300px;
    overflow-y: auto;
}

.model-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background var(--transition);
}

.model-option:hover {
    background: var(--bg-hover);
}

.model-option.selected {
    background: var(--bg-active);
}

.model-option-icon {
    font-size: 1.1rem;
}

.model-option-name {
    font-size: 0.875rem;
}

.top-bar-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
}

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

/* Chat Settings Dropdown */
.chat-settings {
    position: relative;
}

.chat-settings-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    z-index: 100;
}

.chat-settings-dropdown.hidden {
    display: none;
}

.settings-content {
    padding: 12px 14px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.setting-value {
    font-size: 0.875rem;
    color: var(--accent);
    font-weight: 500;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-hover);
    border-radius: 22px;
    transition: 0.3s;
}

.toggle-switch .toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--accent);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(18px);
}

/* Temperature Slider */
.temp-slider {
    width: 100%;
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    appearance: none;
    cursor: pointer;
}

.temp-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: grab;
    transition: transform 0.2s;
}

.temp-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Welcome Screen */
.welcome-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.welcome-screen.hidden {
    display: none;
}

.welcome-logo {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

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

    50% {
        transform: scale(1.05);
    }
}

.welcome-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.welcome-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.suggestions {
    max-width: 700px;
    width: 100%;
}

.suggestions-title {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.suggestion-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.suggestion-card {
    text-align: left;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}

.suggestion-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.suggestion-title {
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.suggestion-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Messages */
.messages {
    flex: 1;
    padding: 20px;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

.messages.hidden {
    display: none;
}

.message {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #10b981, #059669);
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, var(--accent), #a855f7);
}

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

.message-role {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.message-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition);
}

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

.message-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

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

.message-action-btn.copied {
    color: var(--success);
}

.message-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-primary);
}

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

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

.message-text code {
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85em;
}

.message-text pre {
    background: var(--bg-input);
    padding: 16px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 12px 0;
}

.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

@keyframes typing {

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

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

/* Input Area */
.input-area {
    padding: 16px 20px 24px;
    background: var(--bg-primary);
}

/* System Prompt */
.system-prompt-bar {
    max-width: 900px;
    margin: 0 auto 8px;
}

.system-prompt-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
}

.system-prompt-toggle:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.system-prompt-toggle.active {
    background: var(--bg-input);
    border-color: var(--accent);
    color: var(--accent);
}

.system-prompt-panel {
    margin-top: 8px;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.system-prompt-panel.hidden {
    display: none;
}

#systemPromptInput {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    padding: 10px 12px;
    resize: vertical;
    min-height: 60px;
    max-height: 150px;
}

#systemPromptInput:focus {
    outline: none;
    border-color: var(--accent);
}

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

/* File Preview */
.file-preview {
    max-width: 900px;
    margin: 0 auto 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
}

.file-preview.hidden {
    display: none;
}

.file-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.file-clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.file-clear-btn:hover {
    background: var(--bg-hover);
    color: var(--error);
}

.file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.file-item-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    font-size: 0.7rem;
    line-height: 1;
}

.file-item-remove:hover {
    color: var(--error);
}

.input-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    transition: border-color var(--transition);
}

.input-container:focus-within {
    border-color: var(--accent);
}

.input-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

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

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

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

.input-actions {
    display: flex;
    gap: 4px;
}

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

.send-btn:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* Config Sections */
.config-section {
    margin-bottom: 28px;
}

.config-section:last-child {
    margin-bottom: 0;
}

.config-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.section-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: -8px 0 16px;
}

.config-group {
    margin-bottom: 16px;
}

.config-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.config-group input,
.config-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.config-group input:focus,
.config-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.input-with-toggle {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-toggle input {
    padding-right: 40px;
}

.toggle-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;
}

.toggle-btn:hover {
    opacity: 1;
}

.test-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
}

.test-btn:hover {
    border-color: var(--accent);
}

.test-result {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    display: none;
}

.test-result.success {
    display: block;
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.test-result.error {
    display: block;
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

/* Model Config List */
.model-config-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.model-config-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

.model-config-group {
    margin-bottom: 16px;
}

.model-config-group-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
    padding-left: 4px;
}

.model-group-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 14px 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.model-config-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.model-toggle {
    position: relative;
    width: 44px;
    height: 24px;
}

.model-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.model-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-hover);
    border-radius: 24px;
    transition: 0.3s;
}

.model-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.model-toggle input:checked+.model-toggle-slider {
    background: var(--accent);
}

.model-toggle input:checked+.model-toggle-slider::before {
    transform: translateX(20px);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-primary {
    background: var(--accent);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--error);
}

.toast-message {
    font-size: 0.875rem;
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

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

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

    .mobile-menu-btn {
        display: block;
    }

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

/* Logout Button */
.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    margin-left: auto;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.logout-btn:hover {
    background: var(--bg-hover);
    color: var(--error);
}

/* Auth Modal */
.auth-modal {
    width: 360px;
    max-width: 90vw;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.auth-header {
    text-align: center;
    padding: 32px 24px 24px;
}

.auth-logo {
    font-size: 3rem;
    margin-bottom: 12px;
}

.auth-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.auth-body {
    padding: 0 24px 32px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-form label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-form input {
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.auth-error {
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: 0.875rem;
}

.auth-error.hidden {
    display: none;
}

.auth-submit {
    padding: 12px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
}

.auth-submit:hover {
    background: var(--accent-hover);
}

.auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-switch-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-switch-btn:hover {
    text-decoration: underline;
}