/*
===============================================================================
SAVED.AIMDIGITAL.COM - MAIN STYLESHEET
===============================================================================

This stylesheet contains all the styles for the Saved Articles application.
The file is organized into logical sections for maintainability and clarity.

Table of Contents:
1. CSS Variables & Configuration
2. Base Styles & Reset
3. Layout & Structure
4. Typography
5. Forms & Inputs
6. Buttons & Interactive Elements
7. Components
8. Tables & Data Display
9. Editor & Content
10. Page-Specific Styles
11. Responsive & Media Queries

===============================================================================
*/

/* ============================================================================
   1. CSS VARIABLES & CONFIGURATION
   ============================================================================
   
   Custom CSS properties for consistent theming and easy maintenance.
   Includes both light and dark mode variable definitions.
============================================================================ */

:root {
    /* Primary color palette */
    --primary-color: #2563eb;
    --danger-color: #dc2626;
    --success-color: #16a34a;
    --warning-color: #f59e0b;
    
    /* Base colors - light mode */
    --bg-color: #ffffff;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    
    /* Status badge colors - light mode */
    --status-unread-bg: #dbeafe;
    --status-unread-text: #1e40af;
    --status-read-bg: #d1fae5;
    --status-read-text: #065f46;
    --status-archived-bg: #e5e7eb;
    --status-archived-text: #4b5563;
    --status-deleted-bg: #fee2e2;
    --status-deleted-text: #991b1b;
    
    /* Alert colors - light mode */
    --alert-error-bg: #fee;
    --alert-error-text: #dc2626;
    --alert-error-border: #fecaca;
    --alert-success-bg: #f0fdf4;
    --alert-success-text: #16a34a;
    --alert-success-border: #bbf7d0;
    
    /* Form element colors - light mode */
    --form-bg: #ffffff;
    --form-border: #d1d5db;
    --form-border-focus: #2563eb;
    --form-text: #1f2937;
    --form-placeholder: #6b7280;
    --form-disabled-bg: #f9fafb;
    --form-disabled-text: #9ca3af;
    
    /* CKEditor colors - light mode */
    --ck-toolbar-bg: #ffffff;
    --ck-toolbar-border: #e5e7eb;
    --ck-content-bg: #ffffff;
    --ck-content-text: #1f2937;
    --ck-button-text: #374151;
    --ck-button-hover-bg: rgba(0, 0, 0, 0.1);
    --ck-button-active-bg: #2563eb;
    --ck-blockquote-text: #666666;
    --ck-annotation-bg: #f9f9f9;
    --ck-annotation-text: #666666;
}

/* Dark mode color overrides */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #111827;
        --text-color: #f3f4f6;
        --border-color: #374151;
        --shadow: 0 1px 3px rgba(0,0,0,0.3);
        
        /* Status badge colors - dark mode */
        --status-unread-bg: #1e3a8a;
        --status-unread-text: #93c5fd;
        --status-read-bg: #064e3b;
        --status-read-text: #6ee7b7;
        --status-archived-bg: #374151;
        --status-archived-text: #d1d5db;
        --status-deleted-bg: #7f1d1d;
        --status-deleted-text: #fca5a5;
        
        /* Alert colors - dark mode */
        --alert-error-bg: #7f1d1d;
        --alert-error-text: #fca5a5;
        --alert-error-border: #991b1b;
        --alert-success-bg: #064e3b;
        --alert-success-text: #6ee7b7;
        --alert-success-border: #10b981;
        
        /* Form element colors - dark mode */
        --form-bg: #1f2937;
        --form-border: #4b5563;
        --form-border-focus: #60a5fa;
        --form-text: #f9fafb;
        --form-placeholder: #9ca3af;
        --form-disabled-bg: #374151;
        --form-disabled-text: #6b7280;
        
        /* CKEditor colors - dark mode */
        --ck-toolbar-bg: #1f2937;
        --ck-toolbar-border: #4b5563;
        --ck-content-bg: #1f2937;
        --ck-content-text: #f9fafb;
        --ck-button-text: #d1d5db;
        --ck-button-hover-bg: rgba(255, 255, 255, 0.1);
        --ck-button-active-bg: #60a5fa;
        --ck-blockquote-text: #9ca3af;
        --ck-annotation-bg: #374151;
        --ck-annotation-text: #9ca3af;
    }
}

/* ============================================================================
   2. BASE STYLES & RESET
   ============================================================================
   
   Universal styles, box-sizing reset, and fundamental element styling.
   Establishes consistent foundation for all elements.
============================================================================ */

* {
    box-sizing: border-box;
}

body {
    font-family: 'urw-din', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* ============================================================================
   3. LAYOUT & STRUCTURE
   ============================================================================
   
   Main layout components including containers, navigation, and page structure.
   Defines the overall architecture of the application.
============================================================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation */
.navbar {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    font-family: 'utopia-std-display', Georgia, serif;
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-color);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    transition: opacity 0.2s;
}

.nav-links a:hover {
    opacity: 0.7;
}

.user-info {
    font-size: 14px;
    opacity: 0.7;
}

/* Article Edit Layout */
.article-edit-layout {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.article-edit-left {
    flex: 0 0 65%;
    min-width: 0;
}

.article-edit-right {
    flex: 0 0 35%;
    min-width: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    position: sticky;
    top: 20px;
}

/* Auth pages layout */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-box {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
}

.auth-box h1 {
    margin-bottom: 30px;
    text-align: center;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Dashboard layout */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
}

/* ============================================================================
   4. TYPOGRAPHY
   ============================================================================
   
   Typography styles for headings, text elements, and content hierarchy.
   Uses Utopia font for headings and URW DIN for body text.
============================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: 'utopia-std-display', Georgia, serif;
    font-weight: 700;
    margin-top: 0;
}

.text-muted {
    color: #6c757d;
    font-style: italic;
}

.text-muted a {
    color: var(--primary-color);
    text-decoration: none;
}

.text-muted a:hover {
    text-decoration: underline;
}

/* ============================================================================
   5. FORMS & INPUTS
   ============================================================================
   
   Form styling including inputs, selects, textareas, and form groups.
   Consistent styling with focus states and validation styles.
============================================================================ */

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

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

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

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background: var(--form-disabled-bg);
    color: var(--form-disabled-text);
    cursor: not-allowed;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--form-border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

@media (prefers-color-scheme: dark) {
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
    }
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.form-actions-right {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: auto;
}

/* Sticky form actions for large screens */
@media (min-width: 1024px) {
    .form-actions {
        position: sticky;
        bottom: 0;
        background: var(--bg-color);
        border-top: 1px solid var(--border-color);
        padding: 15px 20px;
        margin-top: 30px;
        margin-left: -20px;
        margin-right: -20px;
        margin-bottom: -20px;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
        z-index: 10;
    }
}

@media (min-width: 1024px) and (prefers-color-scheme: dark) {
    .form-actions {
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
    }
}

/* Search bar styles */
.search-bar {
    margin-bottom: 20px;
    background: var(--form-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.search-form {
    margin: 0;
}

.search-filters {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-row {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.filter-group.date-group {
    flex: 0 0 auto;
    min-width: 140px;
}

.filter-group.search-actions {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--form-border);
    border-radius: 6px;
    background: var(--form-bg);
    color: var(--form-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-input {
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid var(--form-border);
    border-radius: 6px;
    background: var(--form-bg);
    color: var(--form-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-select {
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid var(--form-border);
    border-radius: 6px;
    background: var(--form-bg);
    color: var(--form-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.date-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--form-text);
    margin-bottom: 0;
    white-space: nowrap;
}

.date-input {
    padding: 8px 12px;
    border: 1px solid var(--form-border);
    border-radius: 6px;
    background: var(--form-bg);
    color: var(--form-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 140px;
}

.search-input:focus,
.filter-input:focus,
.filter-select:focus,
.date-input:focus {
    outline: none;
    border-color: var(--form-border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-input::placeholder,
.filter-input::placeholder {
    color: var(--form-placeholder);
}

@media (prefers-color-scheme: dark) {
    .search-input:focus,
    .filter-input:focus,
    .filter-select:focus,
    .date-input:focus {
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
    }
}

/* Tag suggestions dropdown */
.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--form-bg);
    border: 1px solid var(--form-border);
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow);
}

.tag-suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    transition: background-color 0.15s ease;
}

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

.tag-suggestion-item:hover,
.tag-suggestion-item.selected {
    background-color: rgba(37, 99, 235, 0.1);
}

.filter-group {
    position: relative;
}

/* Bulk actions form elements */
.bulk-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.bulk-actions select,
.bulk-actions input[type="text"] {
    padding: 8px 12px;
    border: 1px solid var(--form-border);
    border-radius: 6px;
    background: var(--form-bg);
    color: var(--form-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bulk-actions select:focus,
.bulk-actions input[type="text"]:focus {
    outline: none;
    border-color: var(--form-border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.bulk-actions input[type="text"]::placeholder {
    color: var(--form-placeholder);
}

@media (prefers-color-scheme: dark) {
    .bulk-actions select:focus,
    .bulk-actions input[type="text"]:focus {
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
    }
}

/* ============================================================================
   6. BUTTONS & INTERACTIVE ELEMENTS
   ============================================================================
   
   Button styles with variants, hover states, and interactive animations.
   Includes base button styles and specialized button types.
============================================================================ */

.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-color);
    color: var(--text-color);
    position: relative;
    overflow: hidden;
}

/* Base button hover, active, and focus states */
.btn:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--form-border-focus);
}

.btn:active {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

/* Ripple effect for all buttons */
.btn:active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    animation: btn-ripple 0.6s ease-out;
}

@keyframes btn-ripple {
    to {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* Button variants */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:active {
    background: #1e40af;
    border-color: #1e40af;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-danger:active {
    background: #991b1b;
    border-color: #991b1b;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.btn-danger:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--form-border);
    transition: all 0.2s ease;
}

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

.btn-secondary:active {
    background: var(--border-color);
}

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

/* Filter pills styles */
.predefined-filters {
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filter-pill {
    display: inline-block;
    padding: 8px 16px;
    background: var(--bg-color);
    color: var(--text-color);
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-pill:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.filter-pill.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.filter-pill.active:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

/* Generate button (specialized) */
.btn-generate {
    background: #10b981;
    color: white;
    border: 1px solid #10b981;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-generate:hover {
    background: #059669;
    border-color: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-generate:active {
    background: #047857;
    border-color: #047857;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-generate:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.4);
}

.btn-generate:active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    animation: generate-ripple 0.6s ease-out;
}

@keyframes generate-ripple {
    to {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* Print and copy buttons */
.print-btn {
    background: var(--success-color);
    color: white;
}

.print-btn:hover {
    background: #047857;
}

.copy-btn {
    background: #7c3aed;
    color: white;
}

.copy-btn:hover {
    background: #6d28d9;
}

/* Dark mode button overrides */
@media (prefers-color-scheme: dark) {
    .btn:hover {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }
    
    .btn:active {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    
    .btn:focus {
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.4);
    }
    
    .btn-primary:hover {
        background: #1d4ed8;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    }
    
    .btn-primary:active {
        background: #1e40af;
        box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
    }
    
    .btn-primary:focus {
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.5);
    }
    
    .btn-danger:hover {
        background: #b91c1c;
        box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    }
    
    .btn-danger:active {
        background: #991b1b;
        box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
    }
    
    .btn-danger:focus {
        box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.5);
    }
    
    .btn-generate {
        background: #10b981;
        color: #f9fafb;
        border-color: #10b981;
    }
    
    .btn-generate:hover {
        background: #059669;
        border-color: #059669;
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    }
    
    .btn-generate:active {
        background: #047857;
        border-color: #047857;
        box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    }
    
    .btn-generate:focus {
        box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.5);
    }

    /* Filter pills dark mode */
    .predefined-filters {
        border-color: #374151;
    }

    .filter-pill {
        background: #374151;
        color: #f9fafb;
        border-color: #4b5563;
    }

    .filter-pill:hover {
        background: #60a5fa;
        color: white;
        border-color: #60a5fa;
        box-shadow: 0 2px 4px rgba(96, 165, 250, 0.3);
    }

    .filter-pill.active {
        background: #60a5fa;
        color: white;
        border-color: #60a5fa;
        box-shadow: 0 2px 4px rgba(96, 165, 250, 0.4);
    }

    .filter-pill.active:hover {
        background: #3b82f6;
        border-color: #3b82f6;
    }
}

/* Bookmarklet link */
.bookmarklet-link {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    margin: 20px 0;
}

/* ============================================================================
   7. COMPONENTS
   ============================================================================
   
   Reusable UI components including alerts, modals, badges, and utility components.
   These are self-contained elements used throughout the application.
============================================================================ */

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: var(--alert-error-bg);
    color: var(--alert-error-text);
    border: 1px solid var(--alert-error-border);
}

.alert-success {
    background: var(--alert-success-bg);
    color: var(--alert-success-text);
    border: 1px solid var(--alert-success-border);
}

/* AI Generation Notification Styling */
.ai-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #007cba;
    color: white;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 300px;
}

.ai-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.ai-notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
}

.ai-icon {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
}

/* Notification state colors */
.ai-notification.loading {
    background: #ffc107;
    color: #212529;
}

.ai-notification.success {
    background: #28a745;
    color: white;
}

.ai-notification.error {
    background: #dc3545;
    color: white;
}

/* Loading animation */
.ai-icon.loading i {
    animation: spin 1s linear infinite;
}

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

#aiMessage {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

/* Dark mode support for AI notifications */
@media (prefers-color-scheme: dark) {
    .ai-notification {
        background: #4a9eff;
    }

    .ai-notification.loading {
        background: #ffc107;
        color: #212529;
    }

    .ai-notification.success {
        background: #20c997;
        color: white;
    }

    .ai-notification.error {
        background: #e74c3c;
        color: white;
    }
}

/* Mobile responsive for AI notifications */
@media (max-width: 768px) {
    .ai-notification {
        right: 10px;
        top: 10px;
        max-width: calc(100vw - 20px);
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background: var(--bg-color);
    margin: 100px auto;
    padding: 40px;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 4px;
    margin-left: 8px;
}

.status-1 { 
    background: var(--status-unread-bg); 
    color: var(--status-unread-text); 
    border: 1px solid transparent;
}
.status-2 { 
    background: var(--status-read-bg); 
    color: var(--status-read-text); 
    border: 1px solid transparent;
}
.status-3 { 
    background: var(--status-archived-bg); 
    color: var(--status-archived-text); 
    border: 1px solid transparent;
}
.status-4 { 
    background: var(--status-deleted-bg); 
    color: var(--status-deleted-text); 
    border: 1px solid transparent;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
}

.page-link {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
}

.page-link.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Category and tag components */

.category-tag {
    background: var(--border-color);
    color: var(--text-color);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    margin-right: 6px;
    margin-bottom: 4px;
    display: inline-block;
}

.report-tag {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: var(--form-bg);
    border-radius: 8px;
    margin-top: 20px;
}

.no-content {
    color: var(--text-color);
    opacity: 0.6;
    font-style: italic;
    margin: 0;
}

.no-articles {
    color: var(--text-color);
    opacity: 0.7;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.no-categories {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-color);
    opacity: 0.7;
}

.no-categories a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.no-categories a:hover {
    text-decoration: underline;
}

/* Checkbox components */
.checkbox-group {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    background: var(--form-bg);
}

.checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-weight: normal;
    cursor: pointer;
    padding: 4px 0;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.checkbox-label:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

@media (prefers-color-scheme: dark) {
    .checkbox-label:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

.checkbox-label:last-child {
    margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    cursor: pointer;
}

/* Collapsible fieldset */
.collapsible-fieldset {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 20px;
    padding: 0;
}

.collapsible-fieldset legend {
    padding: 0;
    margin: 0;
    width: 100%;
}

.fieldset-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-color);
    border: none;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    text-align: left;
}

.fieldset-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.fieldset-content {
    padding: 16px;
}

.fieldset-content .body-preview {
    margin-bottom: 0;
}

/* ============================================================================
   8. TABLES & DATA DISPLAY
   ============================================================================
   
   Table styles for data presentation including articles table and other data grids.
   Includes sorting, hover states, and responsive table behavior.
============================================================================ */

.articles-table,
.users-table,
.categories-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-color);
    box-shadow: var(--shadow);
    margin-top: 20px;
}

.articles-table th,
.articles-table td,
.users-table th,
.users-table td,
.categories-table th,
.categories-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.articles-table th,
.users-table th,
.categories-table th {
    font-weight: 600;
    background: var(--form-bg);
}

.article-title {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 18px;
    line-height: 1.2;
}

.article-title:hover {
    text-decoration: underline;
}

.article-external-link {
    color: var(--primary-color);
    text-decoration: none;
    margin-left: 8px;
    display: inline;
    border: none;
    background: none;
    padding: 0;
    font-size: 16px;
}

.article-external-link:hover {
    color: var(--text-color);
}

.article-summary {
    font-size: 14px;
    opacity: 0.8;
    cursor: help;
    position: relative;
}

/* Custom tooltip styling for article summary */
.article-summary[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 0;
    bottom: 100%;
    margin-bottom: 5px;
    background: var(--text-color);
    color: var(--bg-color);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: normal;
    width: 300px;
    max-width: 80vw;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    line-height: 1.4;
    word-wrap: break-word;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease-in-out 0.5s forwards;
}

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

.notes-column {
    text-align: center;
    width: 40px;
}

.notes-icon {
    font-size: 16px;
    cursor: default;
}

.external-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 18px;
}

.tags {
    font-size: 14px;
    color: var(--primary-color);
}

/* Sorting links */
.sort-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sort-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.sort-indicator {
    font-size: 12px;
    color: var(--primary-color);
}

/* Table action buttons alignment */
.articles-table td:last-child,
.users-table td:last-child,
.categories-table td:last-child {
    white-space: nowrap;
}

.articles-table td:last-child .btn,
.users-table td:last-child .btn,
.categories-table td:last-child .btn {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-right: 5px;
    min-height: 32px;
    line-height: 1;
}

.articles-table td:last-child .btn:last-child,
.users-table td:last-child .btn:last-child,
.categories-table td:last-child .btn:last-child {
    margin-right: 0;
}

/* Icon spacing in buttons with text */
.btn .fa-pencil {
    margin-right: 8px;
}

/* ============================================================================
   9. EDITOR & CONTENT
   ============================================================================
   
   CKEditor styling and content area customization.
   Includes toolbar, content area, and editor-specific components.
============================================================================ */

/* Article editor container */
#editor-container {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow);
    min-height: 100px;
}

#editor {
    min-height: 500px;
    font-size: 16px;
    line-height: 1.6;
}

/* CKEditor base styling */
.ck-editor {
    border: 1px solid var(--form-border);
    border-radius: 6px;
    overflow: hidden;
}

.ck-editor__editable {
    font-family: 'utopia-std-display', Georgia, serif !important;
    font-size: 17px !important;
    line-height: 1.5em !important;
    padding: 20px;
    background: var(--ck-content-bg) !important;
    color: var(--ck-content-text) !important;
    border: none !important;
    min-height: 100px;
}

.ck-editor__editable :is(h1,h2,h3,h4,h5,h6) {
    font-family: 'utopia-std-display', Georgia, serif;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--ck-content-text) !important;
}

.ck-editor__editable blockquote {
    border-left: 4px solid var(--primary-color);
    margin: 16px 0;
    padding-left: 16px;
    font-style: italic;
    color: var(--ck-blockquote-text) !important;
}

.ck-editor__editable a {
    color: var(--primary-color) !important;
    text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
    .ck-editor__editable a {
        color: #fbbf24 !important; /* Light yellow for better visibility in dark mode */
    }
}

.ck-editor__editable p {
    color: var(--ck-content-text) !important;
}

/* CKEditor toolbar styling */
.ck-toolbar {
    background: var(--ck-toolbar-bg) !important;
    border-bottom: 1px solid var(--ck-toolbar-border) !important;
    border-radius: 6px 6px 0 0;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
}

.ck-toolbar .ck-toolbar__separator {
    background: var(--ck-toolbar-border) !important;
}

.ck-button {
    color: var(--ck-button-text) !important;
    border: none !important;
}

.ck-button:hover:not(.ck-disabled) {
    background: var(--ck-button-hover-bg) !important;
}

.ck-button.ck-on {
    background: var(--ck-button-active-bg) !important;
    color: white !important;
}

.ck-button.ck-disabled {
    opacity: 0.5;
}

/* CKEditor content area */
.ck-content {
    border-radius: 0 0 6px 6px;
    font-family: 'utopia-std-display', Georgia, serif !important;
    font-size: 17px !important;
    line-height: 1.5em !important;
    background: var(--ck-content-bg) !important;
    color: var(--ck-content-text) !important;
    border: none !important;
}

/* CKEditor dropdown and balloon styling */
.ck-dropdown__panel {
    background: var(--ck-toolbar-bg) !important;
    border: 1px solid var(--ck-toolbar-border) !important;
}

.ck-list__item {
    color: var(--ck-button-text) !important;
}

.ck-list__item:hover {
    background: var(--ck-button-hover-bg) !important;
}

.ck-balloon-panel {
    background: var(--ck-toolbar-bg) !important;
    border: 1px solid var(--ck-toolbar-border) !important;
}

.ck-balloon-panel .ck-button {
    color: var(--ck-button-text) !important;
}

/* CKEditor input styling */
.ck-input {
    background: var(--ck-content-bg) !important;
    color: var(--ck-content-text) !important;
    border: 1px solid var(--ck-toolbar-border) !important;
}

.ck-labeled-field-view__input-wrapper .ck-input {
    background: var(--ck-content-bg) !important;
    color: var(--ck-content-text) !important;
}

/* CKEditor tooltip styling */
.ck-tooltip {
    background: var(--ck-toolbar-bg) !important;
    color: var(--ck-button-text) !important;
    border: 1px solid var(--ck-toolbar-border) !important;
}

/* CKEditor heading dropdown styling */
.ck-heading-dropdown .ck-list__item {
    color: var(--ck-button-text) !important;
}

/* CKEditor highlight markers */
.ck-editor__editable .marker-yellow {
    background-color: var(--ck-annotation-bg) !important;
}

.ck-editor__editable .marker-green {
    background-color: rgba(34, 197, 94, 0.3) !important;
}

.ck-editor__editable .marker-pink {
    background-color: rgba(236, 72, 153, 0.3) !important;
}

.ck-editor__editable .marker-blue {
    background-color: rgba(59, 130, 246, 0.3) !important;
}

/* CKEditor focus states */
.ck-editor__editable:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

@media (prefers-color-scheme: dark) {
    .ck-editor__editable:focus {
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2) !important;
    }
    
    /* Dark mode specific highlight colors */
    .ck-editor__editable .marker-yellow {
        background-color: rgba(251, 191, 36, 0.3) !important;
    }
    
    .ck-editor__editable .marker-green {
        background-color: rgba(34, 197, 94, 0.4) !important;
    }
    
    .ck-editor__editable .marker-pink {
        background-color: rgba(236, 72, 153, 0.4) !important;
    }
    
    .ck-editor__editable .marker-blue {
        background-color: rgba(59, 130, 246, 0.4) !important;
    }
}

/* Annotation helper text */
.annotation-help {
    font-size: 12px;
    color: var(--ck-annotation-text);
    margin-top: 8px;
    padding: 8px;
    background-color: var(--ck-annotation-bg);
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

.annotation-help kbd {
    background-color: var(--form-border);
    border: 1px solid var(--form-border);
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 11px;
    font-family: monospace;
    color: var(--form-text);
}

.body-preview {
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

/* ============================================================================
   10. PAGE-SPECIFIC STYLES
   ============================================================================
   
   Styles specific to individual pages or sections of the application.
   Organized by functional area: Article Edit, Categories, Reports, etc.
============================================================================ */

/* ────────────────────────────────────────────────────────────────────────────
   Article Edit Page Styles
   ──────────────────────────────────────────────────────────────────────────── */

/* AI content display */
.ai-content-display {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    min-height: 60px;
    font-family: 'utopia-std-display', Georgia, serif;
    font-size: 17px;
    line-height: 1.5em;
    color: var(--text-color);
}

.ai-content-display h1, .ai-content-display h2, .ai-content-display h3 {
    font-family: 'utopia-std-display', Georgia, serif;
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--text-color);
}

.ai-content-display h1 { font-size: 1.5em; }
.ai-content-display h2 { font-size: 1.3em; }
.ai-content-display h3 { font-size: 1.1em; }

.ai-content-display p {
    margin-bottom: 10px;
}

.ai-content-display ul, .ai-content-display ol {
    margin: 10px 0;
    padding-left: 25px;
}

.ai-content-display li {
    margin-bottom: 5px;
    list-style-position: outside;
}

.ai-content-display ul li {
    list-style-type: disc;
}

.ai-content-display ol li {
    list-style-type: decimal;
}

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

.ai-content-display em {
    font-style: italic;
}

.ai-content-display code {
    background: var(--border-color);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

/* AI Summary and Key Points styling */
#ai_summary, #ai_key_points {
    font-family: 'utopia-std-display', Georgia, serif !important;
    font-size: 17px;
    line-height: 1.5em;
    resize: none;
    overflow: hidden;
    min-height: 60px;
}

/* URL field with external link */
.url-field-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.url-field-container input {
    flex: 1;
}

.url-field-container .external-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 16px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--form-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

.url-field-container .external-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Generate Post Modal Styling */
#generatePostModal .modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

#generatedPostContent {
    font-family: 'utopia-std-display', Georgia, serif !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
    max-height: 500px;
    overflow-y: auto;
    word-wrap: break-word;
}

#generatedPostContent blockquote {
    border-left: 4px solid var(--primary-color);
    margin: 16px 0;
    padding-left: 16px;
    font-style: italic;
    color: #666;
}

#generatedPostContent a {
    color: var(--primary-color);
    text-decoration: underline;
}

#generatedPostContent p {
    margin-bottom: 16px;
}

@media (prefers-color-scheme: dark) {
    #generatedPostContent blockquote {
        color: #9ca3af;
    }
}

/* Article title field styling */
#title {
    font-size: 1.2em; /* 20% larger than base font size */
    font-weight: 500;
    font-family: 'urw-din', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Article metadata fields styling */
#publication,
#author,
#canonical_url,
#tags {
    font-family: 'urw-din', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Article action buttons region */
.article-actions {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--form-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.article-actions .btn {
    display: inline-block;
    width: auto;
}

/* Three-column row layout */
.three-column-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.three-column-row .column {
    flex: 1;
}

.three-column-row .column label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.three-column-row .column input {
    width: 100%;
    box-sizing: border-box;
}

/* Four-column row layout */
.four-column-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.four-column-row .column {
    flex: 1;
    min-width: 0;
}

.four-column-row .column label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
}

.four-column-row .column input {
    width: 100%;
    box-sizing: border-box;
}

.four-column-row .url-field-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.four-column-row .url-field-container input {
    flex: 1;
}

.four-column-row .url-field-container .external-link {
    flex-shrink: 0;
    font-size: 14px;
    padding: 6px;
    min-width: 28px;
    height: 28px;
}

/* ────────────────────────────────────────────────────────────────────────────
   Categories Page Styles
   ──────────────────────────────────────────────────────────────────────────── */

.category-form {
    max-width: 600px;
    margin-top: 20px;
}

/* Search bar styles (category-specific overrides) */
.search-bar {
    margin: 20px 0;
    padding: 20px;
    background: var(--form-bg);
    border-radius: 8px;
}

.search-bar form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-bar input[type="text"] {
    flex: 1;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid var(--form-border);
    border-radius: 4px;
    font-size: 14px;
    background: var(--form-bg);
    color: var(--form-text);
}

.search-bar .btn {
    padding: 8px 16px;
    font-size: 14px;
}

/* ────────────────────────────────────────────────────────────────────────────
   Reports Page Styles
   ──────────────────────────────────────────────────────────────────────────── */

/* Typeahead Components */
.typeahead-container {
    position: relative;
    margin-bottom: 20px;
}

.typeahead-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: var(--bg-color);
    color: var(--text-color);
}

.typeahead-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow);
}

.typeahead-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.typeahead-item:hover {
    background-color: var(--border-color);
}

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

/* Category Selection Components */
.category-selection {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.category-item {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: move;
    display: flex;
    align-items: center;
    gap: 0;
    transition: all 0.2s;
}

.category-item:hover {
    box-shadow: var(--shadow);
}

.category-item.selected {
    background: var(--bg-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.category-checkbox {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
    flex-basis: 20px;
}

.category-handle {
    cursor: move;
    color: var(--text-color);
    opacity: 0.6;
    font-size: 14px;
    user-select: none;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.category-label {
    color: var(--text-color);
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    flex: 1;
    padding-left: 8px;
    user-select: none;
    display: flex;
    align-items: center;
}

.category-label strong {
    color: var(--text-color);
    font-size: 16px;
}

/* Report Container and Layout */
.report-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.report-header {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.report-title {
    font-family: 'utopia-std-display', Georgia, serif;
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.report-meta {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Category Sections in Reports */
.category-section {
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.category-section:last-child {
    border-bottom: none;
}

.category-heading {
    font-family: 'utopia-std-display', Georgia, serif;
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

/* Article List and Items */
.article-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-item {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'utopia-std-display', Georgia, serif;
    line-height: 1.6;
}

.article-content,
.article-header {
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.6;
}

.article-publication {
    font-weight: normal;
    color: var(--text-color);
}

.article-meta,
.article-date {
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: normal;
}

.article-notes {
    color: var(--text-color);
    opacity: 0.8;
    font-style: italic;
}

/* Article Highlights */
.article-highlights {
    margin-top: 10px;
}

.article-highlights h4 {
    font-size: 0.9rem;
    margin: 0 0 8px 0;
    color: var(--text-color);
    font-weight: 600;
}

.highlight-quote,
.article-highlights-block {
    background: var(--bg-color);
    border-left: 4px solid var(--primary-color);
    padding: 8px 12px;
    margin: 6px 0 16px 0;
    font-style: italic;
    color: var(--text-color);
    opacity: 0.9;
    font-size: 0.9rem;
    line-height: 1.4;
}

.article-highlights-block {
    padding-left: 16px;
}

.article-highlights-block p {
    margin-bottom: 16px;
}

.article-notes-section {
    margin-top: 16px;
    color: var(--text-color);
}

.article-notes-section p {
    margin-bottom: 16px;
}

/* Save Report Section */
.save-report-section {
    background: var(--bg-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.save-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.save-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-color);
    color: var(--text-color);
}

/* Reports Grid Layout */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.report-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.2s;
}

.report-card:hover {
    box-shadow: var(--shadow);
}

.report-name {
    font-family: 'utopia-std-display', Georgia, serif;
    font-size: 1.25rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

.report-details {
    margin-bottom: 15px;
}

.report-categories {
    margin-top: 8px;
}

.report-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.report-link:hover {
    text-decoration: underline;
}

/* Report Actions */
.report-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: space-between;
    align-items: center;
}

/* ════════════════════════════════════════════════════════════════════════════
   Inline Styles (moved from templates)
   ──────────────────────────────────────────────────────────────────────────── */

/* Report Creation Filter Styles */
/* Filter Type Cards */
.filter-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.filter-card {
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: block;
}

.filter-card:hover {
    border-color: #007cba;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.15);
    transform: translateY(-2px);
}

.filter-card.active {
    border-color: #007cba;
    background: linear-gradient(135deg, #f8fbff 0%, #e8f4fd 100%);
    box-shadow: 0 4px 16px rgba(0, 124, 186, 0.2);
}

.filter-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.filter-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.filter-card:hover .filter-icon {
    transform: scale(1.1);
}

.filter-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.filter-description {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.4;
}

.filter-card.active .filter-title {
    color: #007cba;
}

/* Filter Content Sections */
.filter-content {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.filter-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    margin-top: 1.5rem;
}

.filter-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
}

/* Date Range Styling */
.date-range-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 140px;
}

.date-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #555;
    margin: 0;
}

.date-input {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.date-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.date-separator {
    display: flex;
    align-items: center;
    margin-top: 1.5rem;
    font-weight: 500;
    color: #666;
}

/* Enhanced Typeahead Styling for Reports */
.typeahead-container {
    position: relative;
    margin-top: 1rem;
}

.typeahead-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.typeahead-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* Dark Mode Support for Report Filters */
@media (prefers-color-scheme: dark) {
    .filter-card {
        border-color: #404040;
        background: #2a2a2a;
    }

    .filter-card:hover {
        border-color: #4a9eff;
        box-shadow: 0 4px 12px rgba(74, 158, 255, 0.15);
    }

    .filter-card.active {
        border-color: #4a9eff;
        background: linear-gradient(135deg, #1e2a3a 0%, #2a3a4a 100%);
        box-shadow: 0 4px 16px rgba(74, 158, 255, 0.2);
    }

    .filter-title {
        color: #e0e0e0;
    }

    .filter-description {
        color: #b0b0b0;
    }

    .filter-card.active .filter-title {
        color: #4a9eff;
    }

    .filter-section {
        background: #1a1a1a;
        border-color: #404040;
    }

    .date-label {
        color: #b0b0b0;
    }

    .date-input {
        border-color: #404040;
        background: #2a2a2a;
        color: #e0e0e0;
    }

    .date-input:focus {
        border-color: #4a9eff;
        box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
    }

    .date-separator {
        color: #b0b0b0;
    }

    .typeahead-input {
        border-color: #404040;
        background: #2a2a2a;
        color: #e0e0e0;
    }

    .typeahead-input:focus {
        border-color: #4a9eff;
        box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
    }

    .typeahead-input::placeholder {
        color: #888;
    }
}

/* ============================================================================
   REPORT OPTIONS GRID STYLES
   ============================================================================ */

.report-options {
    margin-top: 0.5rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.option-item:hover {
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.15);
    transform: translateY(-1px);
}

.option-item:has(.option-checkbox:checked) {
    border-color: #007cba;
    background: linear-gradient(135deg, #f8fbff 0%, #e8f4fd 100%);
    box-shadow: 0 2px 12px rgba(0, 124, 186, 0.2);
}

.option-checkbox {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    accent-color: #007cba;
    cursor: pointer;
}

.option-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    user-select: none;
}

.option-item:has(.option-checkbox:checked) .option-label {
    color: #007cba;
    font-weight: 600;
}

/* Dark mode styles for report options */
[data-theme="dark"] .option-item {
    border-color: #404040;
    background: #2a2a2a;
}

[data-theme="dark"] .option-item:hover {
    border-color: #4a9eff;
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.15);
}

[data-theme="dark"] .option-item:has(.option-checkbox:checked) {
    border-color: #4a9eff;
    background: linear-gradient(135deg, #1e2a3a 0%, #2a3a4a 100%);
    box-shadow: 0 2px 12px rgba(74, 158, 255, 0.2);
}

[data-theme="dark"] .option-label {
    color: #e0e0e0;
}

[data-theme="dark"] .option-item:has(.option-checkbox:checked) .option-label {
    color: #4a9eff;
}

[data-theme="dark"] .option-checkbox {
    accent-color: #4a9eff;
}

/* Mobile Responsive for Report Filters */
@media (max-width: 768px) {
    .filter-type-grid {
        grid-template-columns: 1fr;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .option-item {
        padding: 0.875rem;
    }

    .date-range-container {
        flex-direction: column;
        align-items: stretch;
    }

    .date-separator {
        margin-top: 0;
        justify-content: center;
        order: 1;
    }

    .date-input-group:first-child {
        order: 0;
    }

    .date-input-group:last-child {
        order: 2;
    }
}

/* Form and input helper styles */
.inline-form {
    display: inline;
}

.hidden-input {
    display: none;
}

.form-help-text {
    color: var(--form-placeholder);
    font-size: 12px;
    display: block;
    margin-top: 4px;
}

/* Checkbox with label layout */
.checkbox-with-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Table cell alignment utilities */
.text-center {
    text-align: center;
}

/* Status icons for boolean values */
.status-icon-yes {
    color: var(--success-color);
}

.status-icon-no {
    color: var(--text-color);
    opacity: 0.4;
}

/* Article editor utilities */
.fieldset-content-hidden {
    display: none;
}

.body-textarea {
    width: 100%;
    font-family: monospace;
}

/* Modal layout utilities */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    position: absolute;
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: var(--border-color);
    color: var(--primary-color);
}

.generated-content {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 15px;
    font-family: 'utopia-std-display', Georgia, serif;
    line-height: 1.6;
    white-space: pre-wrap;
}

.modal-button-group {
    display: flex;
    gap: 10px;
}

/* Report blockquote styles */
.report-blockquote {
    border-left: 4px solid #2563eb;
    padding-left: 16px;
    margin: 16px 0;
    font-style: italic;
    color: #666;
}

@media (prefers-color-scheme: dark) {
    .generated-content {
        background: #1f2937;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .report-blockquote {
        color: #9ca3af;
    }
}

/* ============================================================================
   11. RESPONSIVE & MEDIA QUERIES
   ============================================================================
   
   Responsive design styles and print media queries.
   Handles mobile layouts, responsive table behavior, and print styling.
============================================================================ */

/* Mobile responsive styles */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-filters {
        gap: 12px;
    }
    
    .search-row {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .search-row:last-child {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }
    
    .filter-group {
        flex: 1;
        min-width: 0;
    }
    
    .filter-group.date-group {
        min-width: auto;
    }
    
    .filter-group.search-actions {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        justify-content: center;
    }
    
    .search-input,
    .filter-input,
    .filter-select,
    .date-input {
        min-width: auto;
    }
    
    .articles-table {
        font-size: 14px;
    }
    
    .articles-table th:nth-child(n+4),
    .articles-table td:nth-child(n+4) {
        display: none;
    }
    
    /* Article edit mobile layout */
    .article-edit-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .article-edit-left,
    .article-edit-right {
        flex: 1;
    }
    
    /* Three-column row responsive */
    .three-column-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .three-column-row .column {
        flex: none;
    }
    
    /* Four-column row responsive */
    .four-column-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .four-column-row .column {
        flex: none;
        min-width: auto;
    }
}

/* Print media query */
@media print {
    .save-report-section,
    .report-actions {
        display: none;
    }
}


/*
===============================================================================
END OF STYLESHEET
===============================================================================
*/