/* Simple Notes System Styles */
/* Clean and seamless notes experience with theme support */

/* Theme Variables */
:root {
    /* Light theme */
    --notes-bg-primary: #ffffff;
    --notes-bg-secondary: #f8fafc;
    --notes-bg-tertiary: #f1f5f9;
    --notes-text-primary: #1e293b;
    --notes-text-secondary: #475569;
    --notes-text-muted: #64748b;
    --notes-border: #e2e8f0;
    --notes-border-hover: #cbd5e1;
    --notes-accent: #fde047;
    --notes-accent-hover: #facc15;
    --notes-success: #10b981;
    --notes-error: #ef4444;
    --notes-shadow: rgba(0, 0, 0, 0.08);
    --notes-shadow-hover: rgba(0, 0, 0, 0.12);
}

.dark {
    /* Dark theme */
    --notes-bg-primary: #1e293b;
    --notes-bg-secondary: #334155;
    --notes-bg-tertiary: #475569;
    --notes-text-primary: #f1f5f9;
    --notes-text-secondary: #cbd5e1;
    --notes-text-muted: #94a3b8;
    --notes-border: #475569;
    --notes-border-hover: #64748b;
    --notes-accent: #ffdb4d;
    --notes-accent-hover: #fcd34d;
    --notes-success: #34d399;
    --notes-error: #f87171;
    --notes-shadow: rgba(0, 0, 0, 0.4);
    --notes-shadow-hover: rgba(0, 0, 0, 0.5);
}

/* Floating Sticky Note Button */
.sticky-note-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--notes-accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px var(--notes-shadow), 0 8px 10px -6px var(--notes-shadow);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
    font-size: 26px;
    color: #1e293b; /* Premium dark color for icon */
    transform: rotate(-6deg);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.sticky-note-btn:hover {
    transform: rotate(0deg) scale(1.15) translateY(-5px);
    background: var(--notes-accent-hover);
    box-shadow: 0 20px 35px -10px var(--notes-shadow-hover);
}

.dark .sticky-note-btn {
    color: #0f172a; /* Solid dark icon even in dark mode */
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.6);
}

.sticky-note-btn .notes-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--notes-error);
    color: var(--notes-bg-primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid var(--notes-bg-primary);
}

/* Notes Panel */
.notes-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--notes-bg-primary);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--notes-border);
    transition: right 0.3s ease;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--notes-text-primary);
    box-shadow: -4px 0 20px var(--notes-shadow);
}

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

/* Panel Header */
.notes-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--notes-border);
    background: var(--notes-bg-secondary);
}

.notes-panel-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--notes-text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--notes-text-secondary);
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

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

/* Search Bar */
.notes-search {
    position: relative;
    padding: 15px 20px;
    border-bottom: 1px solid var(--notes-border);
    background: var(--notes-bg-secondary);
}

.notes-search input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 1px solid var(--notes-border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--notes-bg-primary);
    color: var(--notes-text-primary);
    transition: all 0.2s ease;
}

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

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

.notes-search i {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--notes-text-muted);
}

/* Tabs */
.notes-tabs {
    display: flex;
    gap: 0;
    padding: 0 20px;
    background: var(--notes-bg-secondary);
    border-bottom: 1px solid var(--notes-border);
}

.notes-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--notes-text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

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

.notes-tab.active {
    color: var(--notes-text-primary);
    border-bottom-color: var(--notes-accent);
}

.notes-tab i {
    font-size: 13px;
}

/* Current Page Notes Section */
.current-page-notes,
.current-page-resources {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    position: relative;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    --show-scroll-indicator: 0;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.current-page-notes::-webkit-scrollbar,
.current-page-resources::-webkit-scrollbar {
    display: none;
}

/* Fade gradient at bottom to indicate more content */
.current-page-notes::after,
.current-page-resources::after {
    content: '';
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.2) 40%,
        rgba(0, 0, 0, 0.5) 80%,
        rgba(0, 0, 0, 0.7) 100%);
    pointer-events: none;
    opacity: var(--show-scroll-indicator);
    transition: opacity 0.3s ease;
    margin: 0 -20px -20px -20px; /* Extend to edges */
}

/* Light mode gradient */
:root .current-page-notes::after,
:root .current-page-resources::after {
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(248, 250, 252, 0.6) 40%,
        rgba(248, 250, 252, 0.9) 80%,
        var(--notes-bg-secondary) 100%);
}

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

.section-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--notes-text-primary);
}

.add-note-btn {
    background: var(--notes-accent);
    border: 1px solid var(--notes-border);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--notes-text-primary);
}

.add-note-btn:hover {
    background: var(--notes-accent-hover);
    transform: scale(1.1);
    border-color: var(--notes-accent-hover);
}

/* Dark mode adjustments: ensure plus icon is black for better contrast as requested */
.dark .add-note-btn,
.dark .add-note-btn i {
    color: #000000 !important;
}

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

.note-item {
    background: var(--notes-bg-primary);
    border: 1px solid var(--notes-border);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px var(--notes-shadow);
}

.note-item:hover {
    border-color: var(--notes-accent);
    box-shadow: 0 4px 12px var(--notes-shadow-hover);
    transform: translateY(-1px);
}

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

.note-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--notes-text-primary);
    margin: 0;
}

.note-concept {
    font-size: 12px;
    color: var(--notes-text-secondary);
    background: var(--notes-bg-tertiary);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid var(--notes-border);
}

.note-content-preview {
    font-size: 13px;
    color: var(--notes-text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--notes-text-muted);
}

.note-date {
    font-size: 11px;
}

.note-actions {
    display: flex;
    gap: 6px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.note-item:hover .note-actions {
    opacity: 1;
}

.note-action-btn {
    background: none;
    border: 1px solid var(--notes-border);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    color: var(--notes-text-secondary);
    font-size: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.note-action-btn.delete-btn:hover {
    background: var(--notes-error);
    color: white;
    border-color: var(--notes-error);
}

.note-action-btn.favorite-active {
    color: #fbbf24;
    border-color: #fbbf24;
}

.note-action-btn.favorite-active:hover {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border-color: #fbbf24;
}

/* Yellow checkbox for resource favorite */
#resource-favorite {
    accent-color: #fbbf24;
}

#resource-favorite:checked {
    background-color: #fbbf24;
    border-color: #fbbf24;
}

.modal-action-btn {
    transition: all 0.2s ease;
}

.modal-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--notes-shadow);
}

.modal-action-btn.edit-btn:hover {
    background: var(--notes-accent-hover);
}

.modal-action-btn.delete-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Resources List */
.resources-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.resource-item {
    background: var(--notes-bg-primary);
    border: 1px solid var(--notes-border);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px var(--notes-shadow);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.resource-item:hover {
    border-color: var(--notes-accent);
    box-shadow: 0 4px 12px var(--notes-shadow-hover);
    transform: translateY(-1px);
}

.resource-favicon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 4px;
    background: var(--notes-bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.resource-favicon img {
    width: 16px;
    height: 16px;
}

.resource-favicon i {
    font-size: 14px;
    color: var(--notes-text-muted);
}

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

.resource-title-link {
    font-weight: 600;
    font-size: 14px;
    color: #2563eb; /* Blue color for light mode */
    text-decoration: none;
    display: block;
    margin: 0 0 8px 0;
    word-break: break-word;
    transition: all 0.2s ease;
}

.resource-title-link:hover {
    text-decoration: underline;
    color: #1d4ed8; /* Darker blue on hover */
}

/* Dark mode resource title */
.dark .resource-title-link {
    color: var(--notes-accent);
}

.dark .resource-title-link:hover {
    color: var(--notes-accent-hover);
}

.resource-description {
    font-size: 13px;
    color: var(--notes-text-secondary);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.resource-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.resource-domain {
    font-size: 11px;
    color: var(--notes-text-muted);
}

.resource-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--notes-bg-tertiary);
    color: var(--notes-text-secondary);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
}

.resource-tag.from-note {
    background: var(--notes-accent);
    color: #1a1a1a; /* Dark text for better contrast */
}

.resource-actions {
    display: flex;
    gap: 6px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.resource-item:hover .resource-actions {
    opacity: 1;
}

/* Search Results */
.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.search-results h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--notes-text-primary);
}

/* Formatting Toolbar */
.formatting-toolbar {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: var(--notes-bg-tertiary);
    border-bottom: 1px solid var(--notes-border);
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
}

.format-btn {
    background: none;
    border: 1px solid var(--notes-border);
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--notes-text-secondary);
    font-size: 12px;
    transition: all 0.2s ease;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.format-btn.active {
    background: var(--notes-accent);
    color: var(--notes-text-primary);
    border-color: var(--notes-accent);
}

/* Quick Note Form */
.quick-note-form {
    padding: 20px;
    border-top: 1px solid var(--notes-border);
    background: var(--notes-bg-secondary);
    max-height: 60vh;
    overflow-y: auto;
}

.note-title-container {
    margin-bottom: 12px;
}

.note-title-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--notes-border);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    background: var(--notes-bg-primary);
    color: var(--notes-text-primary);
    transition: all 0.2s ease;
}

.note-title-input:focus {
    outline: none;
    border-color: var(--notes-accent);
    box-shadow: 0 0 0 3px var(--notes-shadow);
}

.note-title-input::placeholder {
    color: var(--notes-text-muted);
    font-weight: 400;
}

.note-editor-container {
    border: 1px solid var(--notes-border);
    border-radius: 8px;
    background: var(--notes-bg-primary);
    margin-bottom: 12px;
    overflow: hidden;
}

.quick-note-form textarea {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 0 0 8px 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    background: var(--notes-bg-primary);
    color: var(--notes-text-primary);
}

.quick-note-form textarea:focus {
    outline: none;
}

.quick-note-form textarea::placeholder {
    color: var(--notes-text-muted);
}

/* Tags Container */
.note-tags-container {
    margin-bottom: 12px;
}

.note-tags-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--notes-border);
    border-radius: 8px;
    font-size: 13px;
    background: var(--notes-bg-primary);
    color: var(--notes-text-primary);
    transition: all 0.2s ease;
}

.note-tags-input:focus {
    outline: none;
    border-color: var(--notes-accent);
    box-shadow: 0 0 0 3px var(--notes-shadow);
}

.note-tags-input::placeholder {
    color: var(--notes-text-muted);
}

.note-tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    min-height: 24px;
}

.note-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--notes-accent);
    color: #1a1a1a; /* Dark text for better contrast on yellow background */
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--notes-border);
    transition: all 0.2s ease;
}

/* Removed hover effect - tags are not clickable on cards */

.note-tag .remove-tag {
    cursor: pointer;
    opacity: 0.7;
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
}

.note-tag .remove-tag:hover {
    opacity: 1;
}

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

.save-btn, .cancel-btn {
    padding: 8px 16px;
    border: 1px solid var(--notes-border);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-btn {
    background: var(--notes-bg-tertiary);
    color: var(--notes-accent);
    border-color: var(--notes-border);
}

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

.cancel-btn {
    background: var(--notes-bg-tertiary);
    color: var(--notes-text-secondary);
    border-color: var(--notes-border);
}

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

/* Overlay */
.notes-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1400;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.notes-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Formatted Content Styles */
.note-content, .version-full-content {
    line-height: 1.6;
}

.note-content strong, .note-content b, .version-full-content strong, .version-full-content b {
    font-weight: 600;
    color: var(--notes-text-primary);
}

.note-content em, .note-content i, .version-full-content em, .version-full-content i {
    font-style: italic;
    color: var(--notes-text-secondary);
}

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

.note-content ul li, .version-full-content ul li {
    list-style-type: disc;
    margin: 4px 0;
}

.note-content ol li, .version-full-content ol li {
    list-style-type: decimal;
    margin: 4px 0;
}

.note-content .checkbox-item, .version-full-content .checkbox-item {
    display: flex;
    align-items: center;
    margin: 4px 0;
    gap: 8px;
}

.note-content .checkbox-item input[type="checkbox"], .version-full-content .checkbox-item input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.note-content .checkbox-item.completed, .version-full-content .checkbox-item.completed {
    text-decoration: line-through;
    color: var(--notes-text-muted);
}

.note-content p, .version-full-content p {
    margin: 8px 0;
}

.note-content br, .version-full-content br {
    line-height: 1.6;
}

/* Empty State */
.notes-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--notes-text-muted);
}

.notes-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
    color: var(--notes-text-muted);
}

.notes-empty p {
    margin: 0;
    font-size: 14px;
    color: var(--notes-text-muted);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sticky-note-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .notes-panel {
        width: 100%;
        right: -100%;
    }

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

/* Header */
.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.notes-header h3 {
    margin: 0;
    color: white;
    font-size: 18px;
    font-weight: 600;
}

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

/* Tabs */
.notes-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.notes-tab-btn {
    flex: 1;
    padding: 12px 8px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.notes-tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.notes-tab-btn.active {
    background: rgba(139, 69, 19, 0.3);
    color: white;
    border-bottom: 2px solid #8b4513;
}

/* Search */
.notes-search {
    position: relative;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 14px;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-icon {
    position: absolute;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
}

/* Tab Content */
.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Filters */
.notes-filters {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-select {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    font-size: 12px;
}

.btn-filter {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.btn-filter:hover,
.btn-filter.active {
    background: rgba(139, 69, 19, 0.3);
}

/* Notes List */
.notes-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.note-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.note-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

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

.note-item-title {
    font-weight: 600;
    color: white;
    font-size: 14px;
    margin: 0;
}

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

.note-item-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.note-type-badge {
    background: rgba(139, 69, 19, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
}

.note-item-preview {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    line-height: 1.4;
}

/* Buttons */
.btn-icon {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-primary {
    background: #8b4513;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #a0522d;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Loading State */
.notes-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .notes-panel.expanded {
        width: 100vw;
        background: rgba(0, 0, 0, 0.95);
    }
    
    .notes-tab {
        left: -50px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    margin: 5% auto;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    color: white;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Note Editor Styles */
.note-editor-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Note: .note-title-input and .note-tags-input styles are defined earlier in the file with proper theming */

.note-meta {
    display: flex;
    gap: 12px;
}

/* Resource Styles */
.resource-add {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.resource-input {
    flex: 1;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 14px;
}

.resource-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.btn-add {
    padding: 10px 12px;
    background: #8b4513;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add:hover {
    background: #a0522d;
}

.resource-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin: 8px;
    transition: all 0.3s ease;
}

.resource-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

.resource-title {
    font-weight: 600;
    color: white;
    font-size: 14px;
    margin: 0;
}

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

/* .resource-meta, .resource-domain, and .resource-description are defined earlier in the file with proper theming */

/* Dashboard Card Styles */
.note-card, .resource-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    min-height: 160px;
}

.dark .note-card, .dark .resource-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.note-card:hover, .resource-card:hover {
    border-color: var(--notes-accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.12);
}

.dark .note-card:hover, .dark .resource-card:hover {
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.note-card-header, .resource-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    min-height: 24px;
}

.note-type-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.favorite-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--notes-text-muted);
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s ease;
    padding: 4px;
    z-index: 10;
}

.favorite-btn:hover {
    color: var(--notes-accent);
    transform: scale(1.2);
}

.favorite-btn .fa-star {
    color: var(--notes-accent);
}

.resource-favicon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: var(--notes-bg-secondary);
    padding: 4px;
}

.resource-favicon img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.resource-favicon i {
    font-size: 14px;
    color: var(--notes-text-muted);
}

.note-card-title, .resource-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--notes-text-primary);
    margin: 0;
    padding-right: 32px;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1.4;
}

.note-card-title:hover {
    color: var(--notes-accent);
}

.resource-card-title {
    margin: 0;
}

.resource-card-title a {
    color: var(--notes-text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.resource-card-title a:hover {
    color: var(--notes-accent);
}

.note-card-preview, .resource-card-description {
    font-size: 13px;
    color: var(--notes-text-secondary);
    line-height: 1.5;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.note-card-meta, .resource-card-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.concept-tag, .domain-tag, .date-tag, .note-type-tag, .resource-type-tag {
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.concept-tag {
    background: rgba(251, 191, 36, 0.1);
    color: #f59e0b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.concept-tag:hover {
    background: rgba(251, 191, 36, 0.2);
}

.note-type-tag {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.resource-type-tag {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.domain-tag {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.date-tag {
    color: var(--notes-text-muted);
    font-size: 10px;
    text-transform: none;
}

.note-card-actions, .resource-card-actions {
    display: flex;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--notes-border);
}

.note-card-actions button, .resource-card-actions button {
    flex: 1;
    padding: 6px 10px;
    background: transparent;
    border: 1px solid var(--notes-border);
    border-radius: 4px;
    color: var(--notes-text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.note-card-actions button:hover, .resource-card-actions button:hover {
    background: var(--notes-bg-secondary);
    border-color: var(--notes-accent);
    color: var(--notes-accent);
}

.resource-favicon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--notes-bg-secondary);
}

.resource-favicon img {
    width: 16px;
    height: 16px;
}

.resource-favicon i {
    font-size: 14px;
    color: var(--notes-text-muted);
}

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

.modal-content {
    background: var(--notes-bg-primary);
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px var(--notes-shadow-hover);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--notes-text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--notes-text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s ease;
}

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

.modal-body {
    padding: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--notes-text-primary);
}

.note-type-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--notes-border);
    border-radius: 6px;
    background: var(--notes-bg-secondary);
    color: var(--notes-text-primary);
    font-size: 14px;
}

.template-item {
    padding: 16px;
    border: 1px solid var(--notes-border);
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-item:hover {
    border-color: var(--notes-accent);
    background: var(--notes-bg-secondary);
}

.template-item h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: var(--notes-text-primary);
}

.template-item p {
    margin: 0;
    font-size: 14px;
    color: var(--notes-text-secondary);
}

/* Template Styles */
.templates-list {
    padding: 8px;
}

.template-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

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

.template-title {
    font-weight: 600;
    color: white;
    font-size: 16px;
    margin: 0;
}

.template-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.template-type {
    background: rgba(139, 69, 19, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: white;
    display: inline-block;
}

/* Note Preview */
.note-preview {
    position: fixed;
    top: 20px;
    right: 420px;
    width: 300px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    z-index: 1500;
    color: white;
    transition: all 0.3s ease;
}

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

.note-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.note-preview-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.note-preview-body {
    padding: 16px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.5;
}

.note-preview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-small {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Empty States */
.notes-empty,
.resources-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

.notes-empty i,
.resources-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.notes-empty p,
.resources-empty p {
    margin: 0 0 20px 0;
    font-size: 16px;
}

/* Link Insert Modal */
.link-input:focus {
    outline: none;
    border-color: var(--notes-accent) !important;
    box-shadow: 0 0 0 3px var(--notes-shadow) !important;
}

.link-insert-modal-overlay .close-modal-btn:hover {
    color: var(--notes-text-primary);
}

.link-insert-modal-overlay .cancel-link-btn:hover {
    background: var(--notes-bg-tertiary);
}

.link-insert-modal-overlay .insert-link-btn:hover {
    background: var(--notes-accent-hover);
    transform: translateY(-1px);
}

/* Version History Modal */
.version-item {
    cursor: pointer;
}

.version-item:hover {
    border-color: var(--notes-accent) !important;
    box-shadow: 0 2px 8px var(--notes-shadow-hover) !important;
}

/* Modal Action Buttons */
.modal-action-btn.versions-btn:hover {
    background: rgba(100, 116, 139, 0.25) !important;
    border-color: rgba(100, 116, 139, 0.5) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.2);
}

.modal-action-btn.edit-btn:hover {
    background: rgba(168, 85, 247, 0.25) !important;
    border-color: rgba(168, 85, 247, 0.5) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.modal-action-btn.delete-btn:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.modal-action-btn:active {
    transform: translateY(0);
}

/* Dark theme adjustments */
.dark .notes-panel.expanded {
    background: rgba(0, 0, 0, 0.8);
    border-left-color: rgba(255, 255, 255, 0.1);
}

/* Tag Badges */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tag-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.dark .tag-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Concept Tag Display Styling */
.concept-tag-display {
    /* Dark mode styles are inline in the HTML */
}

/* Light mode override for concept tag */
:root:not(.dark) .concept-tag-display {
    background: rgba(251, 191, 36, 0.1) !important;
    color: #111827 !important; /* near-black for readability in light mode */
    border-color: #fbbf24 !important;
}

:root:not(.dark) .concept-tag-display i,
:root:not(.dark) .concept-tag-display button,
:root:not(.dark) .concept-tag-display span {
    color: #111827 !important;
}

/* Light mode: make yellow pills use near-black text/icons */
:root:not(.dark) .btn-new-note,
:root:not(.dark) .btn-new-note i {
    color: #111827 !important;
}

:root:not(.dark) .toolbar-tab.active,
:root:not(.dark) .toolbar-tab.active i {
    color: #111827 !important;
}

:root:not(.dark) .filter-item.active,
:root:not(.dark) .filter-item.active i {
    color: #111827 !important;
}

:root:not(.dark) .filter-item.active .filter-count {
    color: #111827 !important;
    background: rgba(0, 0, 0, 0.08);
}

/* Light mode: selected concept tags in editors/viewers */
:root:not(.dark) #selected-concept-tag span,
:root:not(.dark) #selected-concept-tag i,
:root:not(.dark) #selected-concept-tag button,
:root:not(.dark) #resource-selected-concept-tag span,
:root:not(.dark) #resource-selected-concept-tag i,
:root:not(.dark) #resource-selected-concept-tag button,
:root:not(.dark) #quick-note-selected-concept-tag span,
:root:not(.dark) #quick-note-selected-concept-tag i,
:root:not(.dark) #quick-note-selected-concept-tag button {
    color: #111827 !important;
}

/* Light mode link color in note content - match concept tag color */
:root:not(.dark) .note-content a {
    color: #d97706 !important;
}

:root:not(.dark) .note-content a:hover {
    color: #b45309 !important;
}

/* Resource Modal */
.resource-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--notes-shadow);
    /* unify with note modal: remove extra blur */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.resource-modal-content {
    background: var(--notes-bg-primary);
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.resource-modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--notes-border);
    position: sticky;
    top: 0;
    background: var(--notes-bg-primary);
    z-index: 1;
    border-radius: 12px 12px 0 0;
}

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

.resource-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--notes-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    position: sticky;
    bottom: 0;
    background: var(--notes-bg-primary);
    border-radius: 0 0 12px 12px;
}

.resource-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--notes-text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    line-height: 1;
    transition: all 0.2s ease;
}

.resource-modal-close:hover {
    color: var(--notes-text-primary);
    transform: scale(1.1);
}

.resource-modal-title {
    margin: 0 40px 0 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--notes-text-primary);
    word-break: break-word;
}

.resource-modal-url {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--notes-bg-secondary);
    border: 1px solid var(--notes-border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--notes-text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.resource-modal-url:hover {
    background: var(--notes-bg-tertiary);
    border-color: var(--notes-accent);
    color: var(--notes-text-primary);
}

.resource-modal-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--notes-text-secondary);
    margin-bottom: 16px;
}

.resource-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--notes-text-muted);
}

.resource-modal-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
/ *   F o r c e   r e f r e s h   * /  
 