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

:root {
    --bg-primary: #0d0d1a;
    --bg-secondary: #151528;
    --bg-tertiary: #1a1a2e;
    --bg-hover: #252540;
    --bg-active: #2d1f3d;
    --border: #2a2a45;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    --accent: #e91e8c;
    --accent-light: #ff6b9d;
    --accent-gradient: linear-gradient(135deg, #ff6b9d 0%, #c44ed2 100%);
    --success: #10b981;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
}

.app {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: 0;
    transform: translateX(-100%);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.logo-icon img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-tagline {
    font-size: 12px;
    color: var(--text-secondary);
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

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

.new-chat-btn {
    margin: 16px 20px;
    padding: 14px 20px;
    background: transparent;
    border: 2px solid #ED318A;
    border-radius: 12px;
    color: #ED318A;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
    min-width: 120px;
}

.new-chat-btn:hover {
    background: rgba(237, 49, 138, 0.1);
    transform: translateY(-1px);
}

.search-box {
    margin: 0 20px 16px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-box svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

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

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px;
}

.chat-section {
    margin-bottom: 16px;
}

.section-header {
    padding: 8px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-item {
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    position: relative;
}

.chat-item:hover {
    background: var(--bg-hover);
}

.chat-item.active {
    background: var(--bg-active);
}

.chat-title {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-time {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.pin-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s;
}

.chat-item:hover .pin-btn {
    opacity: 1;
}

.pin-btn.active {
    opacity: 1;
    color: var(--accent-light);
}

.pin-btn:hover {
    color: var(--accent-light);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

/* Storage Indicator */
.storage-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin-bottom: 12px;
}

.storage-icon {
    color: var(--success);
    flex-shrink: 0;
}

.storage-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.storage-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.storage-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.storage-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

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

.storage-indicator.cloud .storage-icon {
    color: var(--accent-light);
}

.memory-indicator {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    position: relative;
}

.memory-icon {
    flex-shrink: 0;
}

.memory-text {
    flex: 1;
}

.memory-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.memory-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    display: inline-block;
}

.memory-desc {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
    margin-top: 4px;
    line-height: 1.4;
}

.memory-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: var(--accent-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-plan {
    font-size: 12px;
    color: var(--text-secondary);
}

.plan-badge {
    font-size: 10px;
}

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

.chat-header {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.header-avatar svg {
    width: 44px;
    height: 44px;
}

.header-info {
    display: flex;
    flex-direction: column;
}

.header-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pro-badge {
    background: var(--accent-gradient);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.header-status {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    display: inline-block;
}

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

.header-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.2s;
}

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

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

.messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

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

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

.message.user {
    justify-content: flex-end;
}

.message-avatar {
    flex-shrink: 0;
}

.message-avatar svg {
    width: 36px;
    height: 36px;
}

.message-avatar.user-avatar-msg {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.message-content {
    max-width: 70%;
}

.message.user .message-content {
    order: -1;
}

.message-bubble {
    padding: 16px 20px;
    border-radius: 16px;
    line-height: 1.6;
    font-size: 15px;
}

.message.assistant .message-bubble {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
}

.message.user .message-bubble {
    background: var(--accent-gradient);
    color: white;
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.message.user .message-time {
    justify-content: flex-end;
}

.message-time svg {
    color: var(--success);
}

.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.msg-action-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

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

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 0;
}

.action-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    min-width: 180px;
    max-width: 220px;
}

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

.action-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-icon.coding {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
}

.action-icon.brainstorm {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
}

.action-icon.write {
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
}

.action-icon.research {
    background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
}

.action-icon.summarize {
    background: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
}

.action-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.action-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.action-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.3;
}

.action-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
}

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

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

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

.input-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    font-size: 13px;
    font-weight: 500;
}

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

.input-container input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    padding: 8px 12px;
    outline: none;
    min-width: 0;
}

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

.send-btn {
    background: var(--accent-gradient);
    border: none;
    color: white;
    cursor: pointer;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.send-btn:hover {
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.input-disclaimer {
    max-width: 900px;
    margin: 12px auto 0;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.input-disclaimer a {
    color: var(--accent-light);
    text-decoration: none;
}

.input-disclaimer a:hover {
    text-decoration: underline;
}

.powered-by {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

.powered-by a {
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 500;
}

.powered-by a:hover {
    text-decoration: underline;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

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

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

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

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

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

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

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

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

    .quick-actions {
        flex-direction: column;
    }

    .action-card {
        max-width: none;
    }

    .header-actions {
        display: none;
    }

    .message-content {
        max-width: 85%;
    }
}

/* Code blocks */
.message-bubble pre,
.message-bubble .code-block {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    overflow-x: auto;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.message-bubble code,
.message-bubble .inline-code {
    font-family: 'Fira Code', 'Consolas', monospace;
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    border: 1px solid var(--border);
}

.message-bubble .code-block code {
    background: none;
    padding: 0;
    border: none;
}

/* Markdown Headers */
.message-bubble .md-h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 16px 0 8px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
}

.message-bubble .md-h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 14px 0 6px;
    color: var(--text-primary);
}

.message-bubble .md-h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 12px 0 6px;
    color: var(--accent-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Markdown Tables */
.message-bubble .md-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 14px;
}

.message-bubble .md-table th,
.message-bubble .md-table td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}

.message-bubble .md-table th {
    background: var(--bg-hover);
    font-weight: 600;
    color: var(--accent-light);
}

.message-bubble .md-table tr:nth-child(even) {
    background: var(--bg-primary);
}

.message-bubble .md-table tr:hover {
    background: var(--bg-hover);
}

/* Markdown Lists */
.message-bubble .md-ul,
.message-bubble .md-ol {
    margin: 10px 0;
    padding-left: 24px;
}

.message-bubble .md-li,
.message-bubble .md-oli {
    margin: 6px 0;
    line-height: 1.5;
}

.message-bubble .md-ul .md-li::marker {
    color: var(--accent-light);
}

/* Markdown Blockquote */
.message-bubble .md-quote {
    border-left: 3px solid var(--accent);
    margin: 12px 0;
    padding: 8px 16px;
    background: var(--bg-primary);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* Markdown HR */
.message-bubble .md-hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

/* Math/LaTeX */
.message-bubble .math-block {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    text-align: center;
    font-family: 'Times New Roman', serif;
    font-size: 16px;
    overflow-x: auto;
}

.message-bubble .math-inline {
    font-family: 'Times New Roman', serif;
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 15px;
}

/* Welcome state */
.welcome-state {
    text-align: center;
    padding: 60px 20px;
}

.welcome-logo svg {
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
}

.welcome-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #ED318A;
}

.welcome-name {
    color: #ffffff;
}

.welcome-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto;
}

/* Login Modal */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    margin-bottom: 24px;
}

.login-logo img {
    border-radius: 16px;
}

.login-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-form input {
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: 'Fira Code', 'Consolas', monospace;
    outline: none;
    transition: border-color 0.2s;
}

.login-form input:focus {
    border-color: var(--accent);
}

.login-form input::placeholder {
    color: var(--text-muted);
}

.login-error {
    color: #ef4444;
    font-size: 13px;
    min-height: 20px;
}

.login-btn {
    padding: 14px 24px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(233, 30, 140, 0.4);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-help {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 20px;
}

.login-help a {
    color: var(--accent-light);
    text-decoration: none;
}

.login-help a:hover {
    text-decoration: underline;
}

/* Logout button */
.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

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

/* Copy button state */
.copy-btn.copied {
    color: var(--success);
}

/* Kebab Menu */
.chat-item .kebab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s;
    margin-left: auto;
}

.chat-item:hover .kebab-btn {
    opacity: 1;
}

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

.kebab-menu {
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    min-width: 160px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    z-index: 1000;
    display: none;
}

.kebab-menu.visible {
    display: block;
}

.kebab-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
}

.kebab-item:hover {
    background: var(--bg-hover);
}

.kebab-item.danger {
    color: #ef4444;
}

.kebab-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.kebab-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}

/* Memory Panel */
.memory-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.memory-panel.open {
    right: 0;
}

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

.memory-panel-header h3 {
    font-size: 18px;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.memory-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

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

.memory-tabs {
    display: flex;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
}

.memory-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.memory-tab:hover {
    color: var(--text-primary);
}

.memory-tab.active {
    color: var(--accent-light);
    border-bottom-color: var(--accent);
}

.memory-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.memory-section.hidden {
    display: none;
}

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

.memory-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.memory-table th,
.memory-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.memory-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
}

.memory-table tr:hover {
    background: var(--bg-hover);
}

.memory-table .delete-mem {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.memory-table .delete-mem:hover {
    color: #ef4444;
}

.memory-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.memory-storage-info {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
}

.storage-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

.storage-dot.local {
    background: var(--success);
}

.storage-dot.cloud {
    background: var(--accent-light);
}

.memory-add-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.visible {
    display: flex;
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 400px;
}

.modal-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.modal-card input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    margin-bottom: 16px;
}

.modal-card input:focus {
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn.cancel {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

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

.modal-btn:hover {
    transform: translateY(-1px);
}

/* Improved Sidebar Collapse */
.sidebar.collapsed {
    width: 0;
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

.sidebar.collapsed * {
    opacity: 0;
    visibility: hidden;
}

/* Show expand button when sidebar collapsed */
.sidebar.collapsed ~ .main-content .mobile-menu-btn {
    display: flex;
}

.main-content {
    transition: margin-left 0.3s ease;
}
