:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #121212;
    --bg-tertiary: #1a1a1a;
    --bg-elevated: #1f1f1f;
    --bg-hover: #252525;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #6b6b6b;
    --border-color: #2a2a2a;
    --accent-primary: #8b5cf6;
    --accent-secondary: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    --glow-color: rgba(139, 92, 246, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--glow-color);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-elevated: #ffffff;
    --bg-hover: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border-color: #e5e7eb;
    --glow-color: rgba(139, 92, 246, 0.15);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
}

.app-container {
    display: grid;
    grid-template-columns: 260px 1fr 400px;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    height: 100vh;
    overflow: hidden;
}

.sidebar-header {
    margin-bottom: 32px;
    padding: 0 8px;
    flex-shrink: 0;
}

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

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.logo-icon svg {
    width: 24px;
    height: 24px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.nav-btn {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.nav-btn svg {
    width: 18px;
    height: 18px;
}

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

.add-item-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    font-weight: 600;
}

.add-item-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.categories {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 8px;
    min-height: 0;
}

.categories::-webkit-scrollbar {
    width: 6px;
}

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

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

.categories::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

.category-btn {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 6px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    position: relative;
}

.category-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: height 0.2s ease;
}

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

.category-btn.active {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.category-btn.active::before {
    height: 20px;
}

.category-icon svg {
    width: 18px;
    height: 18px;
}

.user-info {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    padding: 16px 8px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.avatar svg {
    width: 18px;
    height: 18px;
}

.nickname {
    font-weight: 500;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.settings-btn svg {
    width: 18px;
    height: 18px;
}

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

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    padding: 32px;
    background: var(--bg-primary);
    overflow: hidden;
    height: 100vh;
}

.section-icon svg {
    width: 18px;
    height: 18px;
}

.quick-access {
    margin-bottom: 24px;
    flex-shrink: 0;
}

.quick-access-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.quick-access-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quick-access-items {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 40px;
    padding: 8px;
    border: 2px dashed transparent;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.quick-access-items.drag-over {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.quick-access-items:empty::before {
    content: 'Drag items here for quick access';
    color: var(--text-tertiary);
    font-size: 13px;
    font-style: italic;
}

.quick-item {
    padding: 8px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.quick-item > span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.quick-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.quick-item-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}

.quick-item-favorite,
.quick-item-delete {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    opacity: 0;
}

.quick-item:hover .quick-item-favorite,
.quick-item:hover .quick-item-delete {
    opacity: 1;
}

.quick-item-favorite.active {
    opacity: 1 !important;
    color: #fbbf24;
}

.quick-item-favorite.active svg {
    fill: currentColor;
}

.quick-item-favorite svg,
.quick-item-delete svg {
    width: 14px;
    height: 14px;
}

.quick-item-favorite:hover {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.quick-item-delete:hover {
    background: rgba(220, 38, 38, 0.2);
    color: #dc2626;
}

.items-section {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0 -8px;
    padding: 0 8px;
    min-height: 0;
}

.items-section::-webkit-scrollbar {
    width: 6px;
}

.items-section::-webkit-scrollbar-track {
    background: transparent;
}

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

.items-section::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 24px;
    padding-bottom: 24px;
}

.item-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: grab;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.item-card:active {
    cursor: grabbing;
}

.item-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.item-card:hover {
    transform: translateY(-4px);
}

.item-card.dragging:hover {
    transform: scale(0.95);
}

.item-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.item-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.item-icon svg {
    width: 36px;
    height: 36px;
    position: relative;
    z-index: 1;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.item-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

.item-card:hover .item-icon {
    box-shadow: var(--shadow-glow);
    border-color: var(--accent-primary);
}

.item-card:hover .item-icon::before {
    opacity: 0.1;
}

.item-card:hover .item-icon svg {
    color: var(--accent-primary);
}

.item-name {
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.item-card:hover .item-name {
    color: var(--text-primary);
}

.suggestions-bar {
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.suggestions-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.suggestions-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.suggestions-items {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.suggestion-item {
    padding: 8px 16px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.suggestion-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

/* Chat Panel */
.chat-panel {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.chat-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

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

.chat-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-primary);
}

.chat-header h2 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
}

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

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

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

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

.message {
    display: flex;
    gap: 12px;
    animation: messageSlideIn 0.3s ease;
}

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
}

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

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

.message-content {
    flex: 1;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

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

.chat-input-container {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    transition: all 0.2s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--glow-color);
}

.chat-input::placeholder {
    color: var(--text-tertiary);
}

.send-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.send-btn svg {
    width: 18px;
    height: 18px;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    overflow-y: hidden;
}

.modal-backdrop[style*="display: none"] {
    display: none;
}

.modal-backdrop:not([style*="display: none"]) {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    position: relative;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    padding: 12px;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
    z-index: 1001;
}

.modal-content::-webkit-scrollbar {
    width: 0px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

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

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.modal-title-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-primary);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.close-btn,
.icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.close-btn svg,
.icon-btn svg {
    width: 20px;
    height: 20px;
}

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

.modal-body {
    padding: 12px;
}

.setting-group {
    margin-bottom: 24px;
}

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

.setting-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-secondary);
}

.label-icon svg {
    width: 16px;
    height: 16px;
}

.setting-group input,
.setting-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.setting-group input:focus,
.setting-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--glow-color);
}

.theme-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.data-operations {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.theme-btn {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.theme-btn svg {
    width: 18px;
    height: 18px;
}

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

.theme-btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

.data-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.danger-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid #dc2626;
    border-radius: var(--radius-md);
    background: transparent;
    color: #dc2626;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.danger-btn svg {
    width: 18px;
    height: 18px;
}

.danger-btn:hover {
    background: #dc2626;
    color: white;
}

/* Form Sections */
.form-section {
    margin-bottom: 20px;
}

.form-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.form-section input[type="text"],
.form-section input[type="url"],
.form-section textarea,
.form-section select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-section input:focus,
.form-section textarea:focus,
.form-section select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-section textarea {
    resize: vertical;
    min-height: 60px;
}

.help-text {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 6px;
}

.icon-type-select {
    margin-bottom: 16px;
}

/* Icon Grid */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.icon-grid::-webkit-scrollbar {
    width: 6px;
}

.icon-grid::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 3px;
}

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

.icon-grid::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

.icon-option {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-option svg {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

.icon-option:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
    transform: scale(1.05);
}

.icon-option.selected {
    border-color: var(--accent-primary);
    background: var(--accent-gradient);
}

.icon-option.selected svg {
    color: white;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

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

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

.btn-secondary svg {
    width: 16px;
    height: 16px;
}

/* Tooltip */
.item-tooltip {
    position: fixed;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    max-width: 280px;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 999;
}

.item-tooltip.visible {
    opacity: 1;
}

.tooltip-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.tooltip-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.tooltip-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--accent-primary);
}

.tooltip-icon svg {
    width: 14px;
    height: 14px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 240px 1fr 360px;
    }
}

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    
    .sidebar,
    .chat-panel {
        display: none;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 16px;
    }
    
    .item-icon {
        width: 60px;
        height: 60px;
    }
    
    .item-icon svg {
        width: 30px;
        height: 30px;
    }
}

/* Notification Animation */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Update item card styles for better font sizing */
.item-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: grab;
    transition: transform 0.2s ease, opacity 0.2s ease;
    padding: 4px;
}

.item-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.item-icon svg {
    width: 30px;
    height: 30px;
    position: relative;
    z-index: 1;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.item-name {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 16px;
    padding-bottom: 24px;
}

/* Update category button styling */
.category-btn {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 4px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    position: relative;
}

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

/* Empty state styling */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.empty-state i {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
        gap: 14px;
    }
    
    .item-icon {
        width: 60px;
        height: 60px;
    }
    
    .item-icon svg {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 768px) {
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
        gap: 12px;
    }
    
    .item-icon {
        width: 56px;
        height: 56px;
    }
    
    .item-icon svg {
        width: 26px;
        height: 26px;
    }
    
    .item-name {
        font-size: 10px;
    }
}

/* Markdown styling in chat messages */
.message-content h1,
.message-content h2,
.message-content h3 {
    margin: 12px 0 8px 0;
    font-weight: 600;
    line-height: 1.3;
}

.message-content h1 { font-size: 18px; }
.message-content h2 { font-size: 16px; }
.message-content h3 { font-size: 14px; }

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

.message-content li {
    margin: 4px 0;
    line-height: 1.5;
}

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

.message-content code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.message.user .message-content code {
    background: rgba(255, 255, 255, 0.2);
}

.message-content pre {
    background: rgba(0, 0, 0, 0.1);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}

.message.user .message-content pre {
    background: rgba(255, 255, 255, 0.2);
}

.message-content pre code {
    background: transparent;
    padding: 0;
}

.message-content strong {
    font-weight: 600;
    color: var(--accent-primary);
}

.message.user .message-content strong {
    color: white;
}

.message-content blockquote {
    border-left: 3px solid var(--accent-primary);
    margin: 8px 0;
    padding-left: 12px;
    font-style: italic;
    opacity: 0.9;
}

.message-content a {
    color: var(--accent-primary);
    text-decoration: underline;
}

.message.user .message-content a {
    color: white;
}

