/* Theme CSS Variables */
:root {
    /* Default to dark theme */
    --bg-void: #0a0a0f;
    --bg-abyss: #12121a;
    --bg-surface: #1a1a24;
    --bg-muted: #2a2a3a;
    --text-dim: #6b6b80;
    --text-main: #e5e5e5;
    --text-white: #ffffff;
    --accent-hot: #ff2d6a;
    --accent-electric: #a855f7;
    --accent-lime: #84cc16;
    --accent-cyan: #22d3ee;
    --border-muted: #3a3a4a;
    --shadow-glow: rgba(255, 45, 106, 0.1);
    --scrollbar-track: #12121a;
    --scrollbar-thumb: #2a2a3a;
    --scrollbar-thumb-hover: #3a3a4a;
    --selection-bg: rgba(255, 45, 106, 0.3);
    --selection-text: white;
    --animation-duration: 0.3s;
    --transition-duration: 0.2s;
}

/* Dark theme (default) */
[data-theme="dark"] {
    --bg-void: #0a0a0f;
    --bg-abyss: #12121a;
    --bg-surface: #1a1a24;
    --bg-muted: #2a2a3a;
    --text-dim: #6b6b80;
    --text-main: #e5e5e5;
    --text-white: #ffffff;
    --accent-hot: #ff2d6a;
    --accent-electric: #a855f7;
    --accent-lime: #84cc16;
    --accent-cyan: #22d3ee;
    --border-muted: #3a3a4a;
    --shadow-glow: rgba(255, 45, 106, 0.1);
    --scrollbar-track: #12121a;
    --scrollbar-thumb: #2a2a3a;
    --scrollbar-thumb-hover: #3a3a4a;
    --selection-bg: rgba(255, 45, 106, 0.3);
    --selection-text: white;
}

/* Light theme */
[data-theme="light"] {
    --bg-void: #f8fafc;
    --bg-abyss: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-muted: #e2e8f0;
    --text-dim: #64748b;
    --text-main: #334155;
    --text-white: #0f172a;
    --accent-hot: #e11d48;
    --accent-electric: #9333ea;
    --accent-lime: #65a30d;
    --accent-cyan: #0891b2;
    --border-muted: #cbd5e1;
    --shadow-glow: rgba(225, 29, 72, 0.1);
    --scrollbar-track: #f1f5f9;
    --scrollbar-thumb: #cbd5e1;
    --scrollbar-thumb-hover: #94a3b8;
    --selection-bg: rgba(225, 29, 72, 0.2);
    --selection-text: #0f172a;
}

/* Light theme button fixes */
[data-theme="light"] .btn-edit {
    background-color: #cbd5e1 !important;
    color: #1e293b !important;
    border: 1px solid #94a3b8 !important;
}

[data-theme="light"] .btn-edit:hover {
    background-color: #94a3b8 !important;
    color: #0f172a !important;
}

[data-theme="light"] .btn-delete {
    border-color: #fca5a5 !important;
    color: #dc2626 !important;
}

[data-theme="light"] .btn-delete:hover {
    background-color: #fee2e2 !important;
}

[data-theme="light"] .btn-cancel {
    background-color: #e2e8f0 !important;
    color: #334155 !important;
}

[data-theme="light"] [class*="text-gray-300"],
[data-theme="light"] [class*="text-gray-400"] {
    color: #475569 !important;
}

/* Monochrome theme (e-ink optimized) - pure black and white only */
[data-theme="mono"] {
    --bg-void: #ffffff;
    --bg-abyss: #ffffff;
    --bg-surface: #ffffff;
    --bg-muted: #ffffff;
    --text-dim: #000000;
    --text-main: #000000;
    --text-white: #000000;
    --accent-hot: #000000;
    --accent-electric: #000000;
    --accent-lime: #000000;
    --accent-cyan: #000000;
    --border-muted: #000000;
    --shadow-glow: transparent;
    --scrollbar-track: #ffffff;
    --scrollbar-thumb: #000000;
    --scrollbar-thumb-hover: #000000;
    --selection-bg: #000000;
    --selection-text: #ffffff;
    --animation-duration: 0s;
    --transition-duration: 0s;
}

/* Disable all animations and transitions for monochrome theme */
[data-theme="mono"] *,
[data-theme="mono"] *::before,
[data-theme="mono"] *::after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
}

[data-theme="mono"] .animate-pulse {
    animation: none !important;
}

/* E-ink specific: no box shadows, no gradients */
[data-theme="mono"] .bookmark-card,
[data-theme="mono"] .bg-surface,
[data-theme="mono"] nav {
    box-shadow: none !important;
    background-image: none !important;
}

[data-theme="mono"] .bookmark-card {
    border: 2px solid #000000 !important;
}

[data-theme="mono"] .tag {
    background-color: transparent !important;
    border: 1px solid #000000 !important;
    color: #000000 !important;
}

/* High contrast borders for e-ink */
[data-theme="mono"] input,
[data-theme="mono"] textarea,
[data-theme="mono"] select {
    border: 2px solid #000000 !important;
    background: #ffffff !important;
    color: #000000 !important;
}

[data-theme="mono"] button {
    border: 2px solid #000000 !important;
}

/* Override all gray/slate colors to pure black */
[data-theme="mono"] [class*="text-gray"],
[data-theme="mono"] [class*="text-slate"],
[data-theme="mono"] [class*="bg-gray"],
[data-theme="mono"] [class*="bg-slate"] {
    color: #000000 !important;
}

[data-theme="mono"] [class*="bg-gray"],
[data-theme="mono"] [class*="bg-slate"] {
    background-color: #ffffff !important;
}

[data-theme="mono"] [class*="border-gray"],
[data-theme="mono"] [class*="border-slate"] {
    border-color: #000000 !important;
}

/* Override any remaining opacity backgrounds */
[data-theme="mono"] [class*="/"] {
    --tw-bg-opacity: 1 !important;
    --tw-text-opacity: 1 !important;
    --tw-border-opacity: 1 !important;
}

/* Ensure all links are black */
[data-theme="mono"] a {
    color: #000000 !important;
}

/* Make focused/hover states visible without color */
[data-theme="mono"] a:hover,
[data-theme="mono"] button:hover {
    text-decoration: underline !important;
}

/* Fix view toggle buttons - white icon on black background when selected */
[data-theme="mono"] .view-toggle.bg-hot,
[data-theme="mono"] .view-toggle.text-white,
[data-theme="mono"] button.bg-hot {
    background-color: #000000 !important;
    color: #ffffff !important;
}

[data-theme="mono"] .view-toggle.bg-hot svg,
[data-theme="mono"] button.bg-hot svg {
    stroke: #ffffff !important;
}

/* Theme switcher active state */
[data-theme="mono"] .theme-btn.active {
    background-color: #000000 !important;
    color: #ffffff !important;
}

/* More spacing for view toggle buttons in e-ink */
[data-theme="mono"] .view-toggle {
    margin: 0 4px;
    padding: 8px 12px;
}

[data-theme="mono"] .theme-btn {
    margin: 0 2px;
}

/* Loading spinner keyframes */
@keyframes spin {
    to { transform: rotate(360deg); }
}

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

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

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px var(--shadow-glow); }
    50% { box-shadow: 0 0 30px var(--shadow-glow); }
}

/* HTMX request states */
.htmx-request {
    position: relative;
    pointer-events: none;
}

.htmx-request::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.7);
    border-radius: inherit;
}

[data-theme="light"] .htmx-request::after {
    background: rgba(255, 255, 255, 0.7);
}

[data-theme="mono"] .htmx-request::after {
    background: rgba(255, 255, 255, 0.5);
}

/* Button loading state */
.btn.htmx-request {
    color: transparent;
}

.btn.htmx-request::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid var(--text-dim);
    border-right-color: transparent;
    border-radius: 9999px;
    animation: spin 0.6s linear infinite;
    background: transparent;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn-primary.htmx-request::after {
    border-color: white;
    border-right-color: transparent;
}

.btn-delete.htmx-request::after {
    border-color: #ef4444;
    border-right-color: transparent;
}

/* Card loading state */
.bookmark-card.htmx-request {
    opacity: 0.5;
}

.bookmark-card.htmx-request::after {
    background: rgba(10, 10, 15, 0.5);
}

[data-theme="light"] .bookmark-card.htmx-request::after {
    background: rgba(255, 255, 255, 0.5);
}

/* ==================== NUKE ANIMATION ==================== */
@keyframes nuke {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
        filter: brightness(1);
    }
    10% {
        transform: scale(1.02) rotate(-1deg);
        filter: brightness(1.2);
    }
    20% {
        transform: scale(1.01) rotate(1deg);
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.6);
    }
    30% {
        transform: scale(1.02) rotate(-1deg);
        filter: brightness(1.3);
    }
    40% {
        transform: scale(1) rotate(1deg);
        box-shadow: 0 0 50px rgba(239, 68, 68, 0.8);
    }
    50% {
        transform: scale(0.98) rotate(-0.5deg);
        filter: brightness(1.5);
    }
    60% {
        transform: scale(0.95) rotate(0.5deg);
        opacity: 0.8;
    }
    70% {
        transform: scale(0.85) rotate(-0.5deg);
        opacity: 0.6;
        box-shadow: 0 0 60px rgba(239, 68, 68, 1);
    }
    80% {
        transform: scale(0.7) rotate(0deg);
        opacity: 0.4;
        filter: brightness(2);
    }
    90% {
        transform: scale(0.5) rotate(0deg);
        opacity: 0.2;
    }
    100% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
}

/* Card nuking state - when delete button is in request */
.bookmark-card:has(.btn-delete.htmx-request) {
    animation: nuke 0.6s ease-in-out forwards;
    border-color: rgba(239, 68, 68, 0.8) !important;
    pointer-events: none;
}

.bookmark-card:has(.btn-delete.htmx-request)::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(239, 68, 68, 0.3), transparent 70%);
    border-radius: inherit;
    z-index: 10;
    pointer-events: none;
}

/* Light theme nuke */
[data-theme="light"] .bookmark-card:has(.btn-delete.htmx-request) {
    box-shadow: 0 0 40px rgba(220, 38, 38, 0.5);
}

/* Mono theme - simple fade out, no fancy animation */
[data-theme="mono"] .bookmark-card:has(.btn-delete.htmx-request) {
    animation: none !important;
    opacity: 0.3;
    border-color: #000000 !important;
}

[data-theme="mono"] .bookmark-card:has(.btn-delete.htmx-request)::before {
    display: none;
}

/* Form loading state */
form.htmx-request {
    opacity: 0.7;
}

/* New item animation */
.bookmark-card {
    animation: slideIn var(--animation-duration) ease-out;
}

/* Equal height cards in grid */
#bookmark-list,
.grid {
    align-items: stretch;
}

#bookmark-list > .bookmark-card {
    height: 100%;
}

.bookmark-card {
    display: flex;
    flex-direction: column;
}

.bookmark-card .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bookmark-card .card-footer {
    margin-top: auto;
}

/* Settling animation (after swap) */
.htmx-settling .bookmark-card {
    animation: fadeIn var(--animation-duration) ease-out;
}

/* Added state (for new cards) */
.htmx-added {
    animation: slideIn var(--animation-duration) ease-out;
}

/* Swapping out state */
.htmx-swapping {
    opacity: 0;
    transition: opacity calc(var(--transition-duration) * 0.75);
}

/* ==================== TAG SIDEBAR ANIMATIONS ==================== */
@keyframes tagSidebarFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tagPop {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Tag sidebar container animation */
#tag-sidebar > div {
    animation: tagSidebarFadeIn 0.3s ease-out;
}

/* Individual tag animations with stagger */
#tag-sidebar .tag {
    animation: tagPop 0.3s ease-out backwards;
}

#tag-sidebar .tag:nth-child(1) { animation-delay: 0.02s; }
#tag-sidebar .tag:nth-child(2) { animation-delay: 0.04s; }
#tag-sidebar .tag:nth-child(3) { animation-delay: 0.06s; }
#tag-sidebar .tag:nth-child(4) { animation-delay: 0.08s; }
#tag-sidebar .tag:nth-child(5) { animation-delay: 0.10s; }
#tag-sidebar .tag:nth-child(6) { animation-delay: 0.12s; }
#tag-sidebar .tag:nth-child(7) { animation-delay: 0.14s; }
#tag-sidebar .tag:nth-child(8) { animation-delay: 0.16s; }
#tag-sidebar .tag:nth-child(9) { animation-delay: 0.18s; }
#tag-sidebar .tag:nth-child(10) { animation-delay: 0.20s; }
#tag-sidebar .tag:nth-child(n+11) { animation-delay: 0.22s; }

/* Tag sidebar swapping - fade out */
#tag-sidebar.htmx-swapping > div,
#tag-sidebar.htmx-request > div {
    opacity: 0.5;
    transition: opacity 0.15s ease-out;
}

/* Mono theme - disable tag sidebar animations */
[data-theme="mono"] #tag-sidebar > div,
[data-theme="mono"] #tag-sidebar .tag {
    animation: none !important;
}

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

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

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

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

/* Selection styling */
::selection {
    background: var(--selection-bg);
    color: var(--selection-text);
}

/* Theme switcher styles */
.theme-switcher {
    display: flex;
    gap: 2px;
    padding: 2px;
    background: var(--bg-muted);
    border-radius: 8px;
    border: 1px solid var(--border-muted);
}

.theme-btn {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: all var(--transition-duration);
    text-transform: lowercase;
}

/* Dark theme: lighter text for theme buttons */
[data-theme="dark"] .theme-btn {
    color: #a0a0b0;
}

.theme-btn:hover {
    color: var(--text-main);
    background: var(--bg-surface);
}

[data-theme="dark"] .theme-btn:hover {
    color: #ffffff;
    background: #2a2a3a;
}

.theme-btn.active {
    background: var(--accent-hot);
    color: white;
    box-shadow: 0 2px 8px var(--shadow-glow);
}

[data-theme="light"] .theme-btn.active {
    background: var(--accent-hot);
    color: white;
}

[data-theme="mono"] .theme-btn.active {
    background: #000000;
    color: #ffffff;
    box-shadow: none;
}

[data-theme="mono"] .theme-btn {
    border: 1px solid transparent;
}

[data-theme="mono"] .theme-btn:hover {
    border-color: #000000;
}

/* Themed body background */
body {
    background-color: var(--bg-void);
    color: var(--text-main);
}

/* ==================== SEARCH BAR ANIMATIONS ==================== */

/* Search container base styles */
.search-container {
    position: relative;
}

.search-wrapper {
    position: relative;
    transition: transform var(--transition-duration) ease;
}

/* Search input styling */
.search-input {
    transition: all var(--transition-duration) ease,
                box-shadow 0.4s ease,
                border-color 0.3s ease;
}

/* Focus state - glow effect */
.search-focused .search-input {
    transform: scale(1.01);
    box-shadow:
        0 0 0 1px var(--accent-hot),
        0 0 20px var(--shadow-glow),
        0 0 40px rgba(255, 45, 106, 0.15),
        0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Search icon animation */
.search-icon {
    transition: color 0.3s ease, transform 0.3s ease;
}

.search-focused .search-icon {
    color: var(--accent-hot);
    transform: translateY(-50%) scale(1.1);
}

/* Clear button animation */
.search-clear {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.search-clear:hover {
    transform: translateY(-50%) scale(1.1);
}

/* HTMX indicator - spinner */
.htmx-indicator {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}

/* Search results staggered animation */
@keyframes searchResultSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.search-result-item {
    animation: searchResultSlideIn 0.4s ease forwards;
    animation-delay: var(--stagger-delay, 0ms);
    opacity: 0;
}

/* Search results header animation */
@keyframes searchHeaderFade {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.search-results-header {
    animation: searchHeaderFade 0.3s ease forwards;
}

/* Empty state animation */
@keyframes emptyStatePulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.search-empty-icon {
    animation: emptyStatePulse 2s ease-in-out infinite;
}

/* Shimmer loading effect for search input */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.search-wrapper.htmx-request::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0.75rem;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 45, 106, 0.1) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease infinite;
    pointer-events: none;
    z-index: 1;
}

/* Pulse ring effect on focus */
@keyframes pulseRing {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 45, 106, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 45, 106, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 45, 106, 0);
    }
}

.search-focused::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0.75rem;
    animation: pulseRing 1.5s ease-out infinite;
    pointer-events: none;
}

/* Light theme adjustments */
[data-theme="light"] .search-focused .search-input {
    box-shadow:
        0 0 0 1px var(--accent-hot),
        0 0 20px rgba(225, 29, 72, 0.15),
        0 4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .search-wrapper.htmx-request::before {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(225, 29, 72, 0.1) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
}

[data-theme="light"] .search-focused::after {
    animation-name: pulseRingLight;
}

@keyframes pulseRingLight {
    0% {
        box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.3);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(225, 29, 72, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(225, 29, 72, 0);
    }
}

/* ==================== E-INK THEME: DISABLE ALL SEARCH ANIMATIONS ==================== */
[data-theme="mono"] .search-input,
[data-theme="mono"] .search-wrapper,
[data-theme="mono"] .search-icon,
[data-theme="mono"] .search-clear,
[data-theme="mono"] .search-result-item,
[data-theme="mono"] .search-results-header,
[data-theme="mono"] .search-empty-icon {
    animation: none !important;
    transition: none !important;
}

[data-theme="mono"] .search-focused .search-input {
    transform: none !important;
    box-shadow: none !important;
}

[data-theme="mono"] .search-focused .search-icon {
    transform: translateY(-50%) !important;
}

[data-theme="mono"] .search-focused::after,
[data-theme="mono"] .search-wrapper.htmx-request::before {
    display: none !important;
}

[data-theme="mono"] .search-result-item {
    opacity: 1 !important;
}

[data-theme="mono"] .search-empty-icon {
    opacity: 0.5 !important;
}

/* ==================== SETTINGS PAGE STYLES ==================== */

/* Settings buttons - Dark theme (default) */
.settings-btn-primary {
    background-color: var(--accent-hot);
    color: #ffffff;
    border: none;
    box-shadow: 0 0 20px rgba(255, 45, 106, 0.3);
}

.settings-btn-primary:hover {
    box-shadow: 0 0 30px rgba(255, 45, 106, 0.5);
    transform: translateY(-1px);
}

.settings-btn-danger {
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.settings-btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.3);
}

/* Settings buttons - Light theme */
[data-theme="light"] .settings-btn-primary {
    background-color: var(--accent-hot);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.3);
}

[data-theme="light"] .settings-btn-primary:hover {
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.4);
}

[data-theme="light"] .settings-btn-danger {
    background-color: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.4);
}

[data-theme="light"] .settings-btn-danger:hover {
    background-color: rgba(220, 38, 38, 0.2);
}

[data-theme="light"] .settings-btn-export {
    background-color: rgba(147, 51, 234, 0.1);
    color: #7c3aed;
    border-color: rgba(147, 51, 234, 0.4);
}

[data-theme="light"] .settings-btn-export:hover {
    background-color: rgba(147, 51, 234, 0.2);
}

[data-theme="light"] .settings-btn-import {
    background-color: rgba(101, 163, 13, 0.1);
    color: #4d7c0f;
    border-color: rgba(101, 163, 13, 0.4);
}

[data-theme="light"] .settings-btn-import:hover {
    background-color: rgba(101, 163, 13, 0.2);
}

[data-theme="light"] .settings-file-input::file-selector-button {
    background-color: #e2e8f0 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}

[data-theme="light"] .settings-file-input:hover::file-selector-button {
    background-color: #cbd5e1 !important;
}

/* Settings buttons - Mono/E-ink theme */
[data-theme="mono"] .settings-section {
    border: 2px solid #000000 !important;
    box-shadow: none !important;
}

[data-theme="mono"] .settings-btn-primary,
[data-theme="mono"] .settings-btn-danger,
[data-theme="mono"] .settings-btn-export,
[data-theme="mono"] .settings-btn-import {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    box-shadow: none !important;
    transform: none !important;
}

[data-theme="mono"] .settings-btn-primary:hover,
[data-theme="mono"] .settings-btn-danger:hover,
[data-theme="mono"] .settings-btn-export:hover,
[data-theme="mono"] .settings-btn-import:hover {
    background-color: #000000 !important;
    color: #ffffff !important;
}

[data-theme="mono"] .settings-file-input::file-selector-button {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
}

[data-theme="mono"] .settings-file-input:hover::file-selector-button {
    background-color: #000000 !important;
    color: #ffffff !important;
}

/* ==================== FAVOURITE TAGS SECTION ==================== */

.fav-tags-section {
    background: linear-gradient(to right, rgba(234, 179, 8, 0.1), rgba(249, 115, 22, 0.1));
    border: 1px solid rgba(234, 179, 8, 0.3);
    padding: 1.25rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.fav-tags-title {
    color: #facc15;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fav-tags-title svg {
    width: 1rem;
    height: 1rem;
}

.fav-tag {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    background: rgba(234, 179, 8, 0.2);
    color: #fde047;
    border: 1px solid rgba(234, 179, 8, 0.4);
    transition: all var(--transition-duration);
}

.fav-tag:hover {
    background: rgba(234, 179, 8, 0.3);
    border-color: #facc15;
}

/* Light theme favourite tags */
[data-theme="light"] .fav-tags-section {
    background: linear-gradient(to right, rgba(234, 179, 8, 0.08), rgba(249, 115, 22, 0.08));
    border-color: rgba(202, 138, 4, 0.4);
}

[data-theme="light"] .fav-tags-title {
    color: #a16207;
}

[data-theme="light"] .fav-tag {
    background: rgba(234, 179, 8, 0.15);
    color: #854d0e;
    border-color: rgba(202, 138, 4, 0.5);
}

[data-theme="light"] .fav-tag:hover {
    background: rgba(234, 179, 8, 0.25);
    border-color: #ca8a04;
    color: #713f12;
}

/* Mono/E-ink theme favourite tags */
[data-theme="mono"] .fav-tags-section {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
}

[data-theme="mono"] .fav-tags-title {
    color: #000000 !important;
}

[data-theme="mono"] .fav-tag {
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
}

[data-theme="mono"] .fav-tag:hover {
    background: #000000 !important;
    color: #ffffff !important;
}

/* ==================== AUTOCOMPLETE DROPDOWN ==================== */

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-surface);
    border: 2px solid var(--border-muted);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    animation: slideIn var(--animation-duration) ease-out;
}

.autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    color: var(--text-main);
    font-size: 14px;
    transition: background-color var(--transition-duration), color var(--transition-duration);
    border-bottom: 1px solid var(--border-muted);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: var(--accent-electric);
    color: white;
}

/* Light theme autocomplete */
[data-theme="light"] .autocomplete-dropdown {
    background: var(--bg-surface);
    border-color: var(--border-muted);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .autocomplete-item:hover,
[data-theme="light"] .autocomplete-item.selected {
    background: var(--accent-electric);
    color: white;
}

/* Mono/E-ink theme autocomplete */
[data-theme="mono"] .autocomplete-dropdown {
    background: #ffffff;
    border: 2px solid #000000;
    box-shadow: none;
    animation: none;
}

[data-theme="mono"] .autocomplete-item {
    border-bottom-color: #000000;
    color: #000000;
}

[data-theme="mono"] .autocomplete-item:hover,
[data-theme="mono"] .autocomplete-item.selected {
    background: #000000;
    color: #ffffff;
}
