/**
 * Feature Panels - Shared Styles for Tasks, Notes, and Chat
 */

/* Floating Action Button Menu */
.feature-fab-menu {
    position: fixed;
    right: 24px;
    bottom: 24px;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    z-index: 999;
}

.fab-btn {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
}

.fab-btn:active {
    transform: scale(0.95);
}

.fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.fab-badge:empty,
.fab-badge[style*="display: none"] {
    display: none !important;
}

/* Keep FABs visible and clickable at all times */
.feature-fab-menu {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Base Panel Styles */
.feature-panel {
    position: fixed;
    top: 70px;
    right: 0;
    width: 400px;
    max-width: 90vw;
    height: calc(100vh - 70px);
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 10002; /* Higher than menu-overlay (10001) */
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.feature-panel:not(.hidden) {
    transform: translateX(0);
}

/* Panel Header */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.panel-title i {
    color: #667eea;
}

.selected-node-indicator {
    font-size: 12px;
    font-weight: 400;
    color: #667eea;
    margin-left: 8px;
}

.selected-node-indicator:before {
    content: " - ";
}

.panel-actions {
    display: flex;
    gap: 8px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    background: #667eea;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Panel Filters */
.panel-filters {
    padding: 12px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
}

.filter-buttons {
    display: flex;
    gap: 8px;
}

.filter-btn {
    flex: 1;
    padding: 8px 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.filter-btn:hover {
    background: #e0e0e0;
}

.filter-btn.active {
    background: #667eea;
    color: white;
}

.filter-count {
    font-size: 11px;
    opacity: 0.8;
}

.filter-tabs {
    display: flex;
    gap: 8px;
}

.filter-tab {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
}

.filter-tab:hover {
    color: #667eea;
}

.filter-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Panel Content */
.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.panel-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.panel-empty p {
    margin: 8px 0;
}

.empty-hint {
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
}

/* Panel Footer */
.panel-footer {
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/**
 * Todo Panel - Specific Styles
 */

.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s;
}

.task-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.task-item.highlight {
    animation: highlightPulse 2s ease-in-out;
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

@keyframes highlightPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.6);
    }
}

.task-item[data-status="completed"] {
    opacity: 0.6;
}

.task-item[data-status="completed"] .task-title {
    text-decoration: line-through;
    color: #999;
}

/* Task Checkbox */
.task-checkbox {
    flex-shrink: 0;
}

.task-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

/* Task Content */
.task-content {
    flex: 1;
    min-width: 0;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.task-title {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    line-height: 1.4;
}

.task-badges {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.priority-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-high {
    background: #fee;
    color: #c00;
}

.priority-medium {
    background: #fff3cd;
    color: #856404;
}

.priority-low {
    background: #e7f3ff;
    color: #004085;
}

.time-badge {
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 11px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-description {
    font-size: 13px;
    color: #666;
    margin: 8px 0;
    line-height: 1.5;
}

/* Task Editing Styles */
.task-title.editing,
.task-description.editing {
    background: #fff9e6;
    border: 2px solid #667eea;
    border-radius: 4px;
    padding: 4px 8px;
    outline: none;
    transition: all 0.2s ease;
}

.task-title.editing:focus,
.task-description.editing:focus {
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.edit-controls {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.edit-controls .btn-icon {
    width: 32px;
    height: 32px;
}

.edit-controls .save-edit {
    background: #10b981;
    color: white;
}

.edit-controls .save-edit:hover {
    background: #059669;
}

.edit-controls .cancel-edit {
    background: #ef4444;
    color: white;
}

.edit-controls .cancel-edit:hover {
    background: #dc2626;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    font-size: 12px;
    color: #888;
}

.task-node,
.task-due-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tag {
    padding: 2px 8px;
    background: #e7f3ff;
    color: #004085;
    border-radius: 12px;
    font-size: 11px;
}

.clickable-tag {
    cursor: pointer;
    transition: all 0.2s;
}

.clickable-tag:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

/* Active Tag Filter */
.active-tag-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    margin-top: 8px;
    font-size: 13px;
    color: #856404;
}

.tag-filter-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.clear-tag-filter {
    background: none;
    border: none;
    color: #856404;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.clear-tag-filter:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Task Subtasks */
.task-subtasks {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.subtasks-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    width: 100%;
    text-align: left;
}

.subtasks-toggle i {
    transition: transform 0.2s;
}

.subtasks-toggle:hover {
    color: #5568d3;
}

.subtask-list {
    margin: 8px 0 0 20px;
    padding: 0;
    list-style: disc;
    font-size: 13px;
    color: #666;
}

.task-subtasks.collapsed .subtask-list {
    display: none;
}

/* Task Actions */
.task-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.task-actions .btn-icon {
    padding: 6px;
    font-size: 14px;
}

.task-edit {
    color: #667eea;
}

.task-delete {
    color: #dc3545;
}

/* Task Stats */
.task-stats {
    font-size: 13px;
    color: #666;
}

/* Button Styles */
.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    color: #666;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f0f0f0;
    color: #667eea;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/**
 * Responsive Design
 */

/* Tablet and below */
@media (max-width: 768px) {
    .feature-panel {
        width: 100vw;
        max-width: 100vw;
        top: 0;
        height: 100vh;
    }
    
    .panel-header {
        padding: 12px 16px;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .panel-title {
        font-size: 16px;
    }
    
    .panel-content {
        padding: 12px;
    }
    
    .task-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .task-badges {
        margin-top: 0;
        width: 100%;
    }
    
    .task-item {
        padding: 12px;
    }
    
    /* Chat panel mobile optimizations */
    .chat-input-container {
        padding: 12px;
    }
    
    .chat-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Note editor mobile optimizations */
    .note-editor-toolbar {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .toolbar-btn {
        min-width: 36px;
        height: 36px;
        padding: 8px;
    }
    
    .markdown-editor {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Filter buttons mobile */
    .filter-btn {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    /* Action buttons mobile */
    .action-btn {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    /* Export modal mobile */
    .export-modal {
        width: 90%;
        max-width: 90%;
        margin: 20px;
    }
    
    .version-history-modal {
        width: 90%;
        max-width: 90%;
        max-height: 80vh;
    }
    
    /* Tag manager mobile */
    .tag-manager-modal {
        width: 90%;
        max-width: 90%;
    }
    
    /* Sync notification mobile */
    .sync-notification {
        bottom: 12px;
        right: 12px;
        left: 12px;
        font-size: 13px;
    }
}

/* Mobile small screens */
@media (max-width: 480px) {
    .panel-header {
        padding: 10px 12px;
    }
    
    .panel-title {
        font-size: 15px;
        gap: 6px;
    }
    
    .panel-content {
        padding: 8px;
    }
    
    .task-item,
    .note-item {
        padding: 10px;
    }
    
    .task-title,
    .note-item-title {
        font-size: 14px;
    }
    
    /* Compact toolbar */
    .toolbar-btn {
        min-width: 32px;
        height: 32px;
        padding: 6px;
    }
    
    .toolbar-btn i {
        font-size: 14px;
    }
    
    /* Smaller badges */
    .badge,
    .priority-badge,
    .tag {
        font-size: 11px;
        padding: 2px 6px;
    }
    
    /* Compact buttons */
    .btn-primary,
    .btn-secondary {
        font-size: 13px;
        padding: 8px 14px;
    }
    
    /* Related items compact */
    .related-item {
        padding: 6px 8px;
    }
    
    .related-item-title {
        font-size: 12px;
    }
    
    .view-note,
    .view-task {
        font-size: 10px;
        padding: 3px 8px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn-icon,
    .toolbar-btn,
    .filter-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .task-checkbox input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }
    
    /* Remove hover effects on touch devices */
    .task-item:hover,
    .note-item:hover,
    .related-item:hover {
        transform: none;
    }
    
    /* Better tap highlights */
    * {
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1);
    }
}

/**
 * Dark Mode Support
 */

@media (prefers-color-scheme: dark) {
    .feature-panel {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .panel-header,
    .panel-footer {
        background: #2a2a2a;
        border-color: #3a3a3a;
    }
    
    .panel-title {
        color: #e0e0e0;
    }
    
    .task-item {
        background: #2a2a2a;
        border-color: #3a3a3a;
    }
    
    .task-item:hover {
        border-color: #667eea;
    }
    
    .task-title {
        color: #e0e0e0;
    }
    
    .task-description {
        color: #b0b0b0;
    }
    
    .filter-btn {
        background: #2a2a2a;
        color: #b0b0b0;
    }
    
    .filter-btn:hover {
        background: #3a3a3a;
    }
    
    .filter-btn.active {
        background: #667eea;
        color: white;
    }
}

/* Export Modal Styles */
.export-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.export-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

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

.export-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.export-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #2c3e50;
}

.close-export-modal {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-export-modal:hover {
    background: #f0f0f0;
    color: #333;
}

.export-modal-body {
    padding: 24px;
}

.export-modal-body p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

.export-format-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.export-format-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.export-format-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.export-format-btn i {
    font-size: 28px;
    color: #667eea;
    min-width: 32px;
}

.export-format-btn span {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    display: block;
    margin-bottom: 4px;
}

.export-format-btn small {
    font-size: 13px;
    color: #666;
    display: block;
}

/* Dark mode support for export modal */
@media (prefers-color-scheme: dark) {
    .export-modal {
        background: #2a2a2a;
    }
    
    .export-modal-header {
        border-bottom-color: #444;
    }
    
    .export-modal-header h3 {
        color: #e0e0e0;
    }
    
    .close-export-modal {
        color: #999;
    }
    
    .close-export-modal:hover {
        background: #3a3a3a;
        color: #ddd;
    }
    
    .export-modal-body p {
        color: #999;
    }
    
    .export-format-btn {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .export-format-btn:hover {
        background: #333;
        border-color: #667eea;
    }
    
    .export-format-btn span {
        color: #e0e0e0;
    }
    
    .export-format-btn small {
        color: #999;
    }
}

/* Notes Panel - Markdown Editor Styles */

/* Quick Create Section */
.note-quick-create {
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.quick-create-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    opacity: 0.9;
}

.quick-create-header i {
    font-size: 14px;
}

.btn-quick-create {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-quick-create:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.btn-quick-create:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Notes List View */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.note-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.note-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.note-item.highlight {
    animation: highlightPulse 2s ease-in-out;
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

.note-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.note-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.note-pinned-icon {
    color: #667eea;
    font-size: 14px;
}

.note-item-preview {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.note-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.note-item-linked-node {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 4px;
    font-size: 11px;
    color: #2e7d32;
    font-weight: 500;
}

.note-item-linked-node i {
    font-size: 10px;
    color: #4caf50;
}

.note-item-date {
    font-size: 12px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 4px;
}

.note-item-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Search Bar */
.notes-search-bar {
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.search-results-msg {
    width: 100%;
    padding: 8px 12px;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 6px;
    color: #1976d2;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.search-results-msg i {
    font-size: 14px;
}

.notes-search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.notes-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-icon-sm {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon-sm:hover {
    background: #e0e0e0;
    color: #333;
}

/* Editor View */
.note-editor-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Linked Node Info */
.linked-node-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-bottom: 1px solid #a5d6a7;
    font-size: 13px;
    color: #2e7d32;
}

.linked-node-info i {
    color: #4caf50;
}

.linked-node-info strong {
    flex: 1;
    font-weight: 600;
}

.editor-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.editor-title {
    flex: 1;
}

.note-title-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
}

.note-title-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.editor-actions {
    display: flex;
    gap: 8px;
}

.btn-primary-sm {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary-sm:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Editor Toolbar */
.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    gap: 2px;
}

.toolbar-btn {
    background: none;
    border: none;
    padding: 8px 10px;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 14px;
}

.toolbar-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.toolbar-btn:active {
    background: #e0e0e0;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: #ddd;
    margin: 0 4px;
}

.toolbar-spacer {
    flex: 1;
}

/* Editor Content */
.editor-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.markdown-editor,
.markdown-preview {
    flex: 1;
    overflow-y: auto;
}

.note-content-input {
    width: 100%;
    height: 100%;
    padding: 16px;
    border: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
}

.note-content-input:focus {
    outline: none;
}

.preview-content {
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.preview-content h1 {
    font-size: 28px;
    margin: 24px 0 16px 0;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 8px;
}

.preview-content h2 {
    font-size: 24px;
    margin: 20px 0 12px 0;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 6px;
}

.preview-content h3 {
    font-size: 20px;
    margin: 16px 0 10px 0;
}

.preview-content h4 {
    font-size: 16px;
    margin: 14px 0 8px 0;
}

.preview-content p {
    margin: 12px 0;
}

.preview-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
}

.preview-content pre {
    background: #f5f5f5;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 12px 0;
}

.preview-content pre code {
    background: none;
    padding: 0;
}

.preview-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 16px;
    margin: 12px 0;
    color: #666;
    font-style: italic;
}

.preview-content ul,
.preview-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.preview-content li {
    margin: 6px 0;
}

.preview-content a {
    color: #667eea;
    text-decoration: none;
}

.preview-content a:hover {
    text-decoration: underline;
}

.preview-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 12px 0;
}

.preview-empty,
.preview-error {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-style: italic;
}

/* Editor Footer */
.editor-footer {
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    padding: 12px 16px;
}

.editor-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.meta-divider {
    color: #ddd;
}

.note-tags-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
}

.note-tags-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Dark mode support for notes */
@media (prefers-color-scheme: dark) {
    .note-item {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .note-item:hover {
        border-color: #667eea;
        background: #333;
    }
    
    .note-item-title {
        color: #e0e0e0;
    }
    
    .note-item-preview {
        color: #999;
    }
    
    .notes-search-bar,
    .editor-header,
    .editor-footer {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .notes-search-input,
    .note-title-input,
    .note-tags-input {
        background: #333;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .editor-toolbar {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .toolbar-btn {
        color: #999;
    }
    
    .toolbar-btn:hover {
        background: #3a3a3a;
        color: #ddd;
    }
    
    .toolbar-divider {
        background: #444;
    }
    
    .note-content-input {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .preview-content {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .preview-content code {
        background: #333;
        color: #e0e0e0;
    }
    
    .preview-content pre {
        background: #333;
    }
    
    .preview-content blockquote {
        color: #999;
    }
}

/* Tag Manager Modal */
.tag-manager-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tag-manager-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.tag-manager-content {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

.tag-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.tag-manager-header h3 {
    margin: 0;
    font-size: 20px;
    color: #2c3e50;
}

.close-tag-manager {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-tag-manager:hover {
    background: #f0f0f0;
    color: #333;
}

.tag-manager-body {
    padding: 24px;
    overflow-y: auto;
}

.tag-manager-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px 0;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
}

.tag-manager-info i {
    color: #667eea;
    font-size: 16px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tag-cloud-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.tag-cloud-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.tag-name {
    font-weight: 500;
    color: #2c3e50;
}

.tag-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: #667eea;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Dark mode support for tag manager */
@media (prefers-color-scheme: dark) {
    .tag-manager-content {
        background: #2a2a2a;
    }
    
    .tag-manager-header {
        border-bottom-color: #444;
    }
    
    .tag-manager-header h3 {
        color: #e0e0e0;
    }
    
    .close-tag-manager {
        color: #999;
    }
    
    .close-tag-manager:hover {
        background: #3a3a3a;
        color: #ddd;
    }
    
    .tag-manager-info {
        background: #333;
        color: #999;
    }
    
    .tag-cloud-item {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .tag-cloud-item:hover {
        background: #333;
        border-color: #667eea;
    }
    
    .tag-name {
        color: #e0e0e0;
    }
}

/* Version History Modal */
.version-history-modal {
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.version-history-modal .modal-body {
    overflow-y: auto;
    flex: 1;
}

.version-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.version-item {
    padding: 16px;
    background: #f8f9fa;
    border-left: 4px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.2s;
}

.version-item:hover {
    background: #e9ecef;
    border-left-color: #667eea;
}

.version-item.current {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-left-color: #667eea;
    border-left-width: 5px;
}

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

.version-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.version-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.version-item.current .version-label {
    color: #667eea;
    font-size: 15px;
}

.version-date {
    font-size: 13px;
    color: #6c757d;
}

.version-preview {
    color: #495057;
    font-size: 14px;
    line-height: 1.6;
    padding-left: 8px;
    border-left: 2px solid #dee2e6;
}

.version-item.current .version-preview {
    border-left-color: #667eea;
    font-weight: 500;
}

.restore-version-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    background: white;
    border: 1px solid #dee2e6;
    color: #495057;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.restore-version-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.restore-version-btn i {
    font-size: 12px;
}

/* Dark mode for version history */
@media (prefers-color-scheme: dark) {
    .version-item {
        background: #2a2a2a;
        border-left-color: #444;
    }
    
    .version-item:hover {
        background: #333;
        border-left-color: #667eea;
    }
    
    .version-item.current {
        background: linear-gradient(135deg, #1a2332 0%, #2a1a2a 100%);
    }
    
    .version-label {
        color: #e0e0e0;
    }
    
    .version-date {
        color: #999;
    }
    
    .version-preview {
        color: #ccc;
        border-left-color: #444;
    }
    
    .version-item.current .version-preview {
        border-left-color: #667eea;
    }
    
    .restore-version-btn {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .restore-version-btn:hover {
        background: #667eea;
        border-color: #667eea;
        color: white;
    }
}

/* ===================================
   CHAT PANEL STYLES
   =================================== */

/* Chat Panel Layout */
.chat-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-panel .panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
}

/* Status Indicator */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 8px;
    background: #6c757d;
}

.status-indicator.online {
    background: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
    animation: pulse-online 2s infinite;
}

@keyframes pulse-online {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Chat Welcome Message */
.chat-welcome {
    text-align: center;
    padding: 40px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.chat-welcome .chat-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.chat-welcome .chat-avatar i {
    font-size: 36px;
    color: white;
}

.chat-welcome h4 {
    margin: 0 0 16px;
    color: #2c3e50;
    font-size: 20px;
}

.chat-welcome p {
    color: #6c757d;
    margin-bottom: 20px;
}

.chat-welcome .feature-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.chat-welcome .feature-list li {
    padding: 8px 0;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-welcome .feature-list i {
    color: #667eea;
    width: 20px;
}

.quick-commands {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.quick-commands strong {
    color: #2c3e50;
}

.command-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
}

.command-chip {
    padding: 6px 14px;
    background: #667eea;
    color: white;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.command-chip:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Chat Messages */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: slideIn 0.3s ease-out;
}

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

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message.assistant {
    align-self: flex-start;
}

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

.chat-message.user .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.chat-message.assistant .message-avatar {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.message-avatar i {
    font-size: 18px;
}

.message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-text {
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.user .message-text {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant .message-text {
    background: white;
    color: #2c3e50;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chat-message.error .message-text {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

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

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

.message-text strong {
    font-weight: 600;
}

.message-time {
    font-size: 11px;
    color: #999;
    padding: 0 4px;
}

/* Message Actions */
.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.action-btn:disabled {
    background: #28a745;
    cursor: not-allowed;
    opacity: 0.9;
}

.action-btn i {
    font-size: 14px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 16px;
    align-items: center;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite;
}

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

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

@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Chat Input */
.chat-input-container {
    border-top: 1px solid #dee2e6;
    background: white;
    padding: 12px 16px;
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

#chat-input {
    flex: 1;
    border: 2px solid #dee2e6;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    transition: border-color 0.2s;
}

#chat-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.send-message {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-message:hover:not(:disabled) {
    background: #5568d3;
    transform: scale(1.05);
}

.send-message:disabled {
    background: #dee2e6;
    cursor: not-allowed;
    opacity: 0.6;
}

.input-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    color: #999;
}

.input-hint i {
    font-size: 14px;
}

/* Suggestion Chips */
.chat-suggestions {
    padding: 8px 16px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    max-height: 120px;
    overflow-y: auto;
}

.suggestion-chip {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-size: 13px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.suggestion-chip:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.suggestion-chip.command {
    background: #e3f2fd;
    border-color: #90caf9;
}

.suggestion-chip.command:hover {
    background: #2196f3;
    border-color: #2196f3;
}

.cmd-desc {
    opacity: 0.8;
    font-size: 12px;
}

/* =============================================
   RELATED ITEMS (Cross-Feature Linking)
   ============================================= */

/* Related Items Container */
.task-related,
.note-related-section {
    margin: 12px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

/* =============================================
   SYNC NOTIFICATION
   ============================================= */

.sync-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: white;
    border-radius: 8px;
    padding: 12px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    animation: slideInUp 0.3s ease;
}

/* =============================================
   MOBILE QUICK ACCESS BUTTONS
   ============================================= */

.mobile-quick-access {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    flex-direction: column;
    gap: 12px;
    z-index: 900;
}

/* =============================================
   LOADING & ERROR STATES
   ============================================= */

.loading-state,
.error-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
}

.loading-state i {
    font-size: 32px;
    color: #667eea;
    margin-bottom: 16px;
}

.loading-state p {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
}

.error-state i {
    font-size: 32px;
    color: #ff4757;
    margin-bottom: 16px;
}

.error-state p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #6c757d;
}

.error-state button {
    margin-top: 8px;
}

/* Skeleton loading for lists */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-item {
    padding: 16px;
    margin-bottom: 12px;
}

.skeleton-line {
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-line.short {
    width: 60%;
}

.skeleton-line.medium {
    width: 80%;
}

.skeleton-line.long {
    width: 100%;
}

/* Dark Mode - Loading States */
@media (prefers-color-scheme: dark) {
    .loading-state,
    .error-state {
        color: #999;
    }
    
    .loading-state p,
    .error-state p {
        color: #999;
    }
    
    .skeleton {
        background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
        background-size: 200% 100%;
    }
}

.quick-access-btn {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.quick-access-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.quick-access-btn:active {
    transform: scale(0.95);
}

.quick-access-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    background: #ff4757;
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2px solid white;
}

.quick-access-badge:empty {
    display: none;
}

/* Show mobile buttons on small screens */
@media (max-width: 768px) {
    .mobile-quick-access:not(.hidden) {
        display: flex;
    }
    
    .sync-notification {
        bottom: 100px; /* Above quick access buttons */
    }
}

/* Smaller buttons on very small screens */
@media (max-width: 480px) {
    .quick-access-btn {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    
    .mobile-quick-access {
        bottom: 16px;
        right: 16px;
        gap: 10px;
    }
}

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

.sync-notification.syncing {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    color: #1976d2;
}

.sync-notification.syncing i {
    color: #2196f3;
}

.sync-notification.success {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    color: #2e7d32;
}

.sync-notification.success i {
    color: #4caf50;
}

.sync-notification.error {
    background: #ffebee;
    border-left: 4px solid #f44336;
    color: #c62828;
}

.sync-notification.error i {
    color: #f44336;
}

.sync-notification i {
    font-size: 16px;
}

/* Dark Mode - Sync Notification */
@media (prefers-color-scheme: dark) {
    .sync-notification {
        background: #2a2a2a;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }
    
    .sync-notification.syncing {
        background: #1a3a52;
        border-left-color: #2196f3;
    }
    
    .sync-notification.success {
        background: #1b3a1b;
        border-left-color: #4caf50;
    }
    
    .sync-notification.error {
        background: #3a1a1a;
        border-left-color: #f44336;
    }
}

.related-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Related Items Header */
.related-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    color: #495057;
    margin-bottom: 8px;
}

.related-header i {
    color: #667eea;
}

/* Related Items List */
.related-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.related-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.2s;
}

.related-item:hover {
    background: #f8f9fa;
    border-color: #667eea;
    transform: translateX(2px);
}

.related-item-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.related-item-content i {
    font-size: 14px;
    flex-shrink: 0;
}

.related-item-title {
    font-size: 13px;
    color: #495057;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* View Button for Related Items */
.view-note,
.view-task {
    padding: 4px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.view-note:hover,
.view-task:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.view-note i,
.view-task i {
    font-size: 10px;
}

/* Priority Badge in Related Items */
.related-item .priority-badge {
    font-size: 10px;
    padding: 2px 6px;
    margin-left: 4px;
}

/* Dark Mode - Related Items */
@media (prefers-color-scheme: dark) {
    .task-related,
    .note-related-section {
        background: #2a2a2a;
        border-left-color: #667eea;
    }
    
    .related-header {
        color: #e0e0e0;
    }
    
    .related-item {
        background: #1a1a1a;
        border-color: #444;
    }
    
    .related-item:hover {
        background: #333;
        border-color: #667eea;
    }
    
    .related-item-title {
        color: #e0e0e0;
    }
}

/* Dark Mode - Chat Panel */
@media (prefers-color-scheme: dark) {
    .chat-panel .panel-content {
        background: #1a1a1a;
    }
    
    .chat-welcome h4 {
        color: #e0e0e0;
    }
    
    .chat-welcome p,
    .chat-welcome .feature-list li {
        color: #999;
    }
    
    .quick-commands {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .quick-commands strong {
        color: #e0e0e0;
    }
    
    .chat-message.assistant .message-text {
        background: #2a2a2a;
        color: #e0e0e0;
    }
    
    .message-text code {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .chat-input-container {
        background: #2a2a2a;
        border-top-color: #444;
    }
    
    #chat-input {
        background: #1a1a1a;
        color: #e0e0e0;
        border-color: #444;
    }
    
    #chat-input:focus {
        border-color: #667eea;
    }
    
    .input-hint {
        color: #666;
    }
    
    .chat-suggestions {
        background: #2a2a2a;
        border-top-color: #444;
    }
    
    .suggestion-chip {
        background: #1a1a1a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .suggestion-chip:hover {
        background: #667eea;
        color: white;
    }
    
    .suggestion-chip.command {
        background: #1a2332;
        border-color: #2196f3;
    }
}

