/* Modern Dark Theme - MarkD Reader */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-card: #1e1e1e;
    --bg-hover: #252525;
    --border-color: #333333;
    --border-subtle: #222222;
    
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --text-muted: #888888;
    --text-accent: #6b7280;
    
    --accent-primary: #3b82f6;
    --accent-secondary: #6366f1;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-error: #ef4444;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 60px;
    --top-bar-height: 64px;
    --detail-panel-width: 400px;
}

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

.login-modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    margin: 1rem;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.login-form input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

.login-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-btn:hover {
    background: #2563eb;
}

.login-error {
    color: var(--accent-error);
    font-size: 0.875rem;
    margin-top: 0.75rem;
    text-align: center;
}

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

html {
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    font-size: 14px;
    font-weight: 400;
    overflow-x: hidden;
}

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

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

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

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

/* Layout */
.app {
    display: flex;
    height: 100vh;
    background: var(--bg-primary);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    transition: width 0.3s ease;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-content {
    overflow: hidden;
}

.sidebar.collapsed .app-title,
.sidebar.collapsed .app-subtitle,
.sidebar.collapsed .nav-section h3,
.sidebar.collapsed .nav-item-label span,
.sidebar.collapsed .nav-item-count,
.sidebar.collapsed .btn {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
}

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

/* App Header in Sidebar */
.app-header {
    margin-bottom: 32px;
}

.app-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.app-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.app-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-left: 40px;
}

/* Navigation */
.nav-section {
    margin-bottom: 32px;
}

.nav-section h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.nav-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

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

.nav-item.active {
    background: var(--accent-primary);
    color: white;
}

.nav-item-label {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item-count {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item.active .nav-item-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
    position: relative;
}

/* Top Bar */
.top-bar {
    min-height: var(--top-bar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: relative;
    z-index: 5;
    gap: 24px;
    flex-wrap: wrap;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* Menu Dropdown */
.menu-dropdown {
    position: fixed;
    top: var(--top-bar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
    display: none;
    overflow-y: auto;
}

.menu-content {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    margin: 0;
    min-height: auto;
}

.menu-dropdown:not(.hidden) {
    display: block;
}

.menu-section {
    margin-bottom: 24px;
}

.menu-section:last-child {
    margin-bottom: 0;
}

.menu-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filter Buttons in Menu */
.filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

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

.filter-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.filter-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.filter-count {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.filter-btn.active .filter-count {
    background: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
}


/* Sort Buttons in Menu */
.sort-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

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

.sort-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.sort-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Full width button */
.btn-full {
    width: 100%;
    justify-content: center;
}

/* Sync animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.syncing {
    opacity: 0.7;
}

.filter-btn.active .filter-count {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.filter-btn:not(.active) .filter-count {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.sidebar-toggle {
    padding: 8px;
    border-radius: var(--radius-sm);
}


.top-bar-center {
    flex: 1;
    max-width: 500px;
    margin: 0 auto;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Search in Top Bar */
.search-container {
    width: 100%;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    z-index: 2;
}

#searchInput {
    width: 100%;
    padding: 10px 12px 10px 42px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

#searchInput:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-card);
}

#searchInput::placeholder {
    color: var(--text-muted);
}

/* Desktop Controls */
.desktop-controls {
    display: none;
    gap: 12px;
    margin-right: 12px;
}

.desktop-dropdown {
    position: relative;
}

.desktop-select {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.desktop-select:hover {
    background: var(--bg-hover);
}

.desktop-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-card);
}

.desktop-select .dropdown-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.desktop-select .dropdown-text {
    flex: 1;
    text-align: left;
}

.desktop-select .dropdown-arrow {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.desktop-select.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-top: 4px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 240px;
    overflow-y: auto;
}

.dropdown-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.dropdown-option:hover {
    background: var(--bg-hover);
}

.dropdown-option.active {
    background: var(--accent-primary);
    color: white;
}

.dropdown-option svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.dropdown-option span {
    flex: 1;
}

/* Responsive Controls */
@media (min-width: 769px) {
    /* Desktop: Show dropdowns, hide menu button completely */
    .desktop-controls {
        display: flex;
    }
    
    .top-bar-left {
        display: none;
    }
    
    .search-container {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .search-box {
        flex: 1;
    }
    
    .top-bar-center {
        flex: 1;
        max-width: none;
    }
}

@media (max-width: 768px) {
    /* Mobile: Hide dropdowns, show menu button */
    .desktop-controls {
        display: none;
    }
    
    .menu-toggle {
        display: flex;
    }
}


/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    background: none;
}

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

.btn-primary:hover {
    background: #2563eb;
}

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

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

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

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

/* Load More Button */
.load-more-container {
    display: flex;
    justify-content: center;
    padding: 24px 0;
    margin-top: 24px;
}

.load-more-btn {
    padding: 12px 24px;
    font-size: 16px;
}

.load-more-container.hidden {
    display: none;
}

/* Content Area */
.content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    position: relative;
}

.content.with-detail {
    padding-right: calc(var(--detail-panel-width) + 24px);
}

.content.with-modal {
    padding-right: calc(400px + 24px);
}

/* Bookmark Grid */
.bookmark-grid-container {
    display: block;
    overflow-x: hidden;
}

.bookmark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 0;
    overflow-x: hidden;
}

.bookmark-grid-container.hidden {
    display: none;
}



/* Bookmark Cards (Grid View) */
.bookmark-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: visible;
}

.bookmark-card:hover {
    border-color: var(--border-color);
    background: var(--bg-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.bookmark-card.selected {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
    box-shadow: 0 0 0 2px var(--accent-primary);
    transform: translateY(-2px);
}

/* Swipe to delete states */
.bookmark-card.swiping {
    z-index: 10;
    transition: none !important;
    position: relative;
}

.bookmark-card.swipe-delete-ready {
    /* Keep card normal color, only button should be red */
}

.bookmark-card.swipe-reveal-delete {
    position: relative;
    z-index: 10;
}

.swipe-delete-button {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80px;
    background: var(--accent-error);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    z-index: 100;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    transform: translateX(80px);
    pointer-events: auto;
}

.swipe-delete-button:hover {
    background: #dc2626;
}

.swipe-delete-button:active {
    background: #b91c1c;
}

.swipe-delete-button svg {
    width: 24px;
    height: 24px;
}

.bookmark-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.bookmark-favicon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.bookmark-favicon img {
    width: 24px;
    height: 24px;
    object-fit: cover;
}

.bookmark-favicon-placeholder {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
}

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

.bookmark-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bookmark-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 16px;
}

.bookmark-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.bookmark-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

.bookmark-meta-item svg {
    width: 14px;
    height: 14px;
}

.bookmark-domain {
    color: var(--accent-primary);
    font-weight: 500;
}

.bookmark-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

.bookmark-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bookmark-tags-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.bookmark-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}


.bookmark-card:hover .bookmark-tag-edit-btn,

.no-tags-small {
    color: var(--text-muted);
    font-style: italic;
    font-size: 11px;
}

.bookmark-tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
}

.bookmark-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    opacity: 1;
    transition: opacity 0.2s ease;
    width: 100%;
    padding: 8px 0;
    border-top: 1px solid var(--border-subtle);
    margin-top: 4px;
}

.bookmark-actions-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bookmark-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Hide delete button on mobile */
@media (max-width: 768px) {
    .bookmark-actions-right {
        display: none;
    }
}

.bookmark-action {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 44px;
}

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

.bookmark-action.active {
    color: var(--accent-primary);
}

.bookmark-action svg {
    width: 20px;
    height: 20px;
}

/* Status Indicators */
.bookmark-status {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
}

.status-badge {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-badge.read {
    background: var(--accent-success);
}

.status-badge.favorite {
    background: var(--accent-warning);
}

.status-badge.unread {
    background: var(--accent-primary);
}

/* Detail Panel */
.detail-panel {
    position: fixed;
    top: var(--top-bar-height);
    right: 0;
    bottom: 0;
    width: var(--detail-panel-width);
    background: var(--bg-card);
    border-left: 1px solid var(--border-subtle);
    z-index: 35; /* Higher than floating action overlay (20), sidebar (30), and backdrop (25) */
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.detail-resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    cursor: col-resize;
    z-index: 10;
    transition: background-color 0.2s ease;
}

.detail-resize-handle:hover,
.detail-resize-handle.active {
    background: var(--accent-primary);
}

.detail-resize-handle::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    width: 8px;
}

.detail-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.detail-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    justify-content: space-between;
}

.detail-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.detail-footer {
    padding: 16px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
}

.detail-delete-btn {
    width: 100%;
    background: var(--accent-error) !important;
    color: white !important;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.detail-delete-btn:hover {
    background: #dc2626 !important;
}

.detail-delete-btn:active {
    background: #b91c1c !important;
}

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

.detail-header-favicon {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-right: 12px;
}

.detail-header-favicon img {
    width: 16px;
    height: 16px;
    object-fit: cover;
}

.detail-header-favicon svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.detail-actions .btn svg {
    width: 20px;
    height: 20px;
}

.detail-actions .btn {
    padding: 8px;
    min-width: auto;
}

.detail-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.detail-bookmark {
    margin-bottom: 24px;
}

.detail-bookmark-header {
    display: flex;
    align-items: flex-start;
    gap: 0px;
    margin-bottom: 8px;
}

.detail-bookmark-favicon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.detail-bookmark-favicon img {
    width: 20px;
    height: 20px;
    object-fit: cover;
}

.detail-bookmark-content h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.detail-bookmark-url {
    color: var(--accent-primary);
    font-size: 14px;
    text-decoration: none;
    word-break: break-all;
}

.detail-bookmark-url:hover {
    text-decoration: underline;
}

.detail-bookmark-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin: 16px 0;
}

.detail-bookmark-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.detail-meta-item svg {
    width: 16px;
    height: 16px;
}

.detail-bookmark-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.detail-bookmark-tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
}

/* Field editing styles */
.detail-field-group {
    margin-bottom: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

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

.detail-field-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.edit-field-btn {
    padding: 4px 8px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.edit-field-btn:hover {
    opacity: 1;
}

.detail-field-display {
    margin-bottom: 8px;
}

.detail-field-edit {
    margin-top: 8px;
}

.detail-field-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.detail-field-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-primary);
}

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

.detail-field-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.detail-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0;
}

/* Tag editing styles */
.detail-bookmark-tags-section {
    margin-top: 16px;
}

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

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

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

.btn-sm svg {
    width: 12px;
    height: 12px;
}

.no-tags {
    color: var(--text-muted);
    font-style: italic;
    font-size: 12px;
}

.detail-bookmark-tags-edit {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 12px;
}

.tags-input-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.tags-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-primary);
}

/* Text Content Display Styles */
.detail-text-content {
    margin-top: 12px;
}

.text-content-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    color: var(--text-muted);
    font-size: 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.text-content-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.text-content-wrapper {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-tertiary);
}

.text-content-header {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.text-content-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.text-content-file {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.text-content-size {
    color: var(--text-muted);
    font-size: 12px;
}

.text-content-body {
    padding: 16px;
    max-height: 500px;
    overflow-y: auto;
    line-height: 1.7;
    font-size: 14px;
    color: var(--text-secondary);
}

.text-content-body h1,
.text-content-body h2,
.text-content-body h3 {
    color: var(--text-primary);
    margin: 16px 0 8px 0;
    font-weight: 600;
}

.text-content-body h1 {
    font-size: 20px;
}

.text-content-body h2 {
    font-size: 18px;
}

.text-content-body h3 {
    font-size: 16px;
}

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

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

.text-content-body em {
    font-style: italic;
}

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

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

.text-content-body img {
    max-width: 100%;
    height: auto;
    margin: 12px 0;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    display: block;
}

.text-content-body figure {
    margin: 16px 0;
    text-align: center;
}

.text-content-body figure img {
    margin: 0 0 8px 0;
}

.text-content-body figcaption {
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
    line-height: 1.4;
}

.text-content-body::-webkit-scrollbar {
    width: 6px;
}

.text-content-body::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

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

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

.text-content-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.text-content-error svg {
    width: 24px;
    height: 24px;
    color: var(--accent-error);
}

.text-content-error p {
    margin: 0;
    font-size: 14px;
}

.text-content-error .error-detail {
    font-size: 12px;
    color: var(--text-accent);
    font-family: var(--font-mono);
}

/* Reader View Styles */
.reader-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.reader-view.hidden {
    display: none;
}

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

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

.reader-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 4px;
}

.reader-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.reader-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.reader-meta-item svg {
    width: 14px;
    height: 14px;
}

.reader-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 24px;
    flex-shrink: 0;
}

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

.reader-close svg {
    width: 20px;
    height: 20px;
}

.reader-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.reader-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex: 1;
    color: var(--text-muted);
    font-size: 16px;
}

.reader-loading .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.reader-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    line-height: 1.8;
    font-size: 16px;
    color: var(--text-secondary);
}

.reader-body h1,
.reader-body h2,
.reader-body h3,
.reader-body h4,
.reader-body h5,
.reader-body h6 {
    color: var(--text-primary);
    font-weight: 600;
    margin: 32px 0 16px 0;
    line-height: 1.3;
}

.reader-body h1 {
    font-size: 32px;
    margin-top: 0;
}

.reader-body h2 {
    font-size: 28px;
}

.reader-body h3 {
    font-size: 24px;
}

.reader-body h4 {
    font-size: 20px;
}

.reader-body p {
    margin: 0 0 20px 0;
}

.reader-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.reader-body em {
    font-style: italic;
}

.reader-body a {
    color: var(--accent-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.reader-body a:hover {
    border-bottom-color: var(--accent-primary);
}

.reader-body blockquote {
    margin: 24px 0;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
}

.reader-body code {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 14px;
}

.reader-body pre {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 20px 0;
}

.reader-body pre code {
    background: none;
    padding: 0;
    color: var(--text-secondary);
}

.reader-body ul,
.reader-body ol {
    margin: 16px 0;
    padding-left: 24px;
}

.reader-body li {
    margin: 8px 0;
}

.reader-body img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: block;
}

.reader-body figure {
    margin: 24px 0;
    text-align: center;
}

.reader-body figure img {
    margin: 0 0 12px 0;
}

.reader-body figcaption {
    color: var(--text-muted);
    font-size: 14px;
    font-style: italic;
    line-height: 1.5;
}

.reader-body::-webkit-scrollbar {
    width: 8px;
}

.reader-body::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

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

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

.reader-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    color: var(--text-muted);
    gap: 16px;
    padding: 32px;
}

.reader-error-icon svg {
    width: 48px;
    height: 48px;
    color: var(--accent-error);
}

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

.reader-error p {
    font-size: 16px;
    margin: 0;
    max-width: 400px;
}

/* Reader button in detail view */
.reader-btn.hidden {
    display: none !important;
}

/* Reader action buttons */
.reader-actions {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-subtle);
    padding: 16px 24px;
    margin-top: 32px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    border-radius: var(--radius-md);
    transform: translateY(0);
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.reader-actions.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.reader-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-height: 44px;
}

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

.reader-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Specific styling for delete button */
.reader-action-btn.btn-danger {
    background: var(--accent-error);
    color: white;
    border: 1px solid var(--accent-error);
}

.reader-action-btn.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

/* Mobile responsiveness for reader */
@media (max-width: 768px) {
    .reader-header {
        padding: 12px 16px;
    }
    
    .reader-title {
        font-size: 18px;
    }
    
    .reader-meta {
        font-size: 12px;
        gap: 12px;
    }
    
    .reader-body {
        padding: 16px;
        font-size: 15px;
    }
    
    .reader-body h1 {
        font-size: 26px;
    }
    
    .reader-body h2 {
        font-size: 22px;
    }
    
    .reader-body h3 {
        font-size: 18px;
    }
    
    .reader-close {
        width: 36px;
        height: 36px;
        margin-left: 16px;
    }
    
    .reader-close svg {
        width: 18px;
        height: 18px;
    }
    
    .reader-actions {
        padding: 12px 16px;
        gap: 8px;
        margin-top: 24px;
    }
    
    .reader-action-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .reader-action-btn span {
        display: none;
    }
    
    .reader-action-btn svg {
        width: 20px;
        height: 20px;
    }
}

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

.tags-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Quick tag edit modal */
.quick-tag-bookmark-title {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

/* Loading States */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-muted);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 64px 32px;
    color: var(--text-muted);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    line-height: 1.5;
}

/* Modal Styles - Side Panel */
.modal {
    position: fixed;
    top: 64px; /* Use explicit value instead of CSS variable */
    right: 0;
    bottom: 0;
    width: 400px;
    background: var(--bg-card);
    border-left: 1px solid var(--border-subtle);
    z-index: 40;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

/* Specific rule for Add Bookmark modal to ensure correct positioning */
#addBookmarkModal {
    top: 64px;
    z-index: 40;
}

.modal:not(.hidden) {
    transform: translateX(0);
}

.modal-content {
    background: transparent;
    border-radius: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    overflow: hidden;
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

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

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

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

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

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-card);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    min-width: 320px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-color: var(--accent-success);
}

.toast.error {
    border-color: var(--accent-error);
}

.toast.warning {
    border-color: var(--accent-warning);
}

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

@keyframes toastPulse {
    0% {
        transform: scale(1);
        box-shadow: var(--shadow-lg);
    }
    50% {
        transform: scale(1.02);
        box-shadow: var(--shadow-lg), 0 0 0 4px rgba(59, 130, 246, 0.1);
    }
    100% {
        transform: scale(1);
        box-shadow: var(--shadow-lg);
    }
}

.toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toast-message {
    flex: 1;
}

.toast-action {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    margin-left: 12px;
    transition: background-color 0.2s ease;
}

.toast-action:hover {
    background: var(--accent-secondary);
}

.toast-action:active {
    transform: translateY(1px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    :root {
        --detail-panel-width: 320px;
    }
    
    .bookmark-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 16px;
    }
    
    .content {
        padding: 16px;
    }
    
    .top-bar {
        padding: 0 16px;
    }
}

@media (max-width: 768px) {
    .top-bar {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .top-bar-center {
        flex: 1;
        max-width: none;
    }
    
    /* Mobile list view optimizations */
    
    /* Mobile modal adjustments */
    .content.with-modal {
        padding-right: 0; /* Remove padding on mobile */
    }
    
    .bookmark-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
        gap: 12px;
    }
    
    .bookmark-card {
        padding: 16px;
    }
    
    .content {
        padding: 12px;
    }
    
    .detail-panel {
        width: 100%;
        top: var(--top-bar-height); /* Respect top bar even on mobile */
    }
    
    /* Modal responsive adjustments */
    .modal {
        width: 100%;
        top: 0;
        transform: translateY(100%);
    }
    
    .modal:not(.hidden) {
        transform: translateY(0);
    }
    
    .sidebar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 30;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 25;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* Hidden elements */
.hidden {
    display: none !important;
}

/* Utility classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* PWA Install and Update Toasts */
.install-toast,
.update-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 60;
    min-width: 320px;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
}

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

.install-toast-content,
.update-toast-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
}

.install-toast-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--accent-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

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

.install-toast-text,
.update-toast-text {
    flex: 1;
    min-width: 0;
}

.install-toast-title,
.update-toast-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 15px;
}

.install-toast-subtitle,
.update-toast-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
}

.install-toast-actions,
.update-toast-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.install-btn,
.update-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.install-btn:hover,
.update-btn:hover {
    background: var(--accent-secondary);
}

.dismiss-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
    font-weight: 500;
}

.dismiss-btn:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* Mobile adjustments for PWA toasts */
@media (max-width: 768px) {
    .install-toast,
    .update-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
    
    .install-toast-content,
    .update-toast-content {
        padding: 12px;
        gap: 12px;
    }
    
    .install-toast-icon {
        width: 40px;
        height: 40px;
    }
    
    .install-toast-icon svg {
        width: 20px;
        height: 20px;
    }
}

/* Extra small mobile devices */
@media (max-width: 400px) {
    .bookmark-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
        gap: 8px;
    }
    
    .bookmark-card {
        padding: 12px;
    }
    
    .content {
        padding: 8px;
    }
}

/* Processing indicator styles */
.processing-indicator {
    text-align: center;
    padding: 40px 20px;
}

.processing-indicator .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.processing-indicator p {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.processing-indicator small {
    font-size: 14px;
    color: var(--text-muted);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
