/* CSS Variables for Theming */
:root {
    /* Light Theme */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;
    --bg-color: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --transition: all 0.2s ease-in-out;
    
    /* Internal Link Colors */
    --internal-link-color: #059669;
    --internal-link-hover: #047857;
    --internal-link-bg: #ecfdf5;
}

[data-theme="dark"] {
    --primary-color: #818cf8;
    --primary-dark: #6366f1;
    --secondary-color: #94a3b8;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --error-color: #f87171;
    --info-color: #60a5fa;
    --bg-color: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #334155;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    
    /* Internal Link Colors for Dark Mode */
    --internal-link-color: #34d399;
    --internal-link-hover: #10b981;
    --internal-link-bg: #064e3b;
}

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

body {
    font-family: 'Inter', 'Calibri', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
}

/* Generated Content Styling */
.generated-content {
    font-family: 'Calibri', 'Inter', 'Segoe UI', sans-serif;
    line-height: 1.7;
    font-size: 16px;
    color: var(--text-primary);
    max-height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.generated-content h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1.5em 0 1em 0;
    padding-bottom: 0.5em;
    border-bottom: 3px solid var(--primary-color);
    line-height: 1.3;
}

.generated-content h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 1.5em 0 1em 0;
    padding-left: 0.5em;
    border-left: 4px solid var(--primary-color);
    line-height: 1.4;
}

.generated-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.5em 0 0.8em 0;
    line-height: 1.4;
}

.generated-content p {
    margin-bottom: 1.2em;
    text-align: justify;
    font-size: 16px;
}

.generated-content strong {
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(120deg, var(--primary-color) 0%, var(--primary-color) 100%);
    background-repeat: no-repeat;
    background-size: 100% 0.2em;
    background-position: 0 88%;
}

.generated-content em {
    font-style: italic;
    color: var(--text-secondary);
}

.generated-content ul, .generated-content ol {
    margin: 1.2em 0;
    padding-left: 2em;
}

.generated-content li {
    margin-bottom: 0.6em;
    position: relative;
}

.generated-content ul li::before {
    content: '•';
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: -1em;
}

.generated-content ol {
    counter-reset: list-counter;
}

.generated-content ol li {
    counter-increment: list-counter;
}

.generated-content ol li::before {
    content: counter(list-counter) '.';
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: -1em;
}

.generated-content blockquote {
    border-left: 4px solid var(--primary-color);
    background: var(--bg-tertiary);
    padding: 1.5em;
    margin: 1.5em 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
}

.generated-content blockquote p {
    margin-bottom: 0;
    color: var(--text-secondary);
}

.generated-content code {
    background: var(--bg-tertiary);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--text-primary);
}

.generated-content pre {
    background: var(--bg-tertiary);
    padding: 1.5em;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1.5em 0;
    border: 1px solid var(--border-color);
}

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

/* Internal Links Styling */
.internal-link {
    color: var(--internal-link-color) !important;
    font-weight: 600;
    text-decoration: none;
    background: var(--internal-link-bg);
    padding: 0.1em 0.3em;
    border-radius: 4px;
    border: 1px solid var(--internal-link-color);
    transition: all 0.2s ease;
    position: relative;
}

.internal-link:hover {
    color: var(--internal-link-hover) !important;
    background: var(--internal-link-color);
    color: white !important;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.internal-link::after {
    content: '🔗';
    font-size: 0.8em;
    margin-left: 0.3em;
    opacity: 0.7;
}

/* Article Actions Enhancement */
.article-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.article-actions .btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
    font-weight: 500;
}

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

.btn-success:hover {
    background: #0da271;
    transform: translateY(-1px);
}

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

.btn-info:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Enhanced Progress Bars */
.article-progress {
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    animation: move 1s linear infinite;
}

@keyframes move {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 20px 0;
    }
}

/* Status Badges */
.status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.status-generating {
    background: var(--warning-color);
    color: white;
}

.status-completed {
    background: var(--success-color);
    color: white;
}

.status-failed {
    background: var(--error-color);
    color: white;
}

/* Enhanced Article Cards */
.article-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.article-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.article-header {
    padding: 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.article-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.2rem;
    flex: 1;
    min-width: 200px;
}

.article-meta {
    display: flex;
    gap: 16px;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.article-content {
    padding: 0;
}

/* Export and Copy Enhancements */
.export-formatting {
    font-family: 'Calibri', 'Inter', sans-serif;
    line-height: 1.6;
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.export-formatting h1 {
    font-size: 2.5rem;
    margin-bottom: 1em;
    color: #1e293b;
    border-bottom: 3px solid #6366f1;
    padding-bottom: 0.5em;
}

.export-formatting h2 {
    font-size: 2rem;
    margin: 1.5em 0 1em 0;
    color: #6366f1;
}

.export-formatting h3 {
    font-size: 1.5rem;
    margin: 1.5em 0 1em 0;
    color: #1e293b;
}

.export-formatting p {
    margin-bottom: 1.2em;
    text-align: justify;
}

.export-formatting strong {
    font-weight: bold;
    color: #1e293b;
}

.export-formatting em {
    font-style: italic;
    color: #64748b;
}

.export-formatting ul, .export-formatting ol {
    margin: 1.2em 0;
    padding-left: 2em;
}

.export-formatting li {
    margin-bottom: 0.6em;
}

.export-formatting blockquote {
    border-left: 4px solid #6366f1;
    background: #f8fafc;
    padding: 1.5em;
    margin: 1.5em 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .generated-content {
        font-size: 15px;
        padding: 16px;
        max-height: 400px;
    }
    
    .generated-content h1 {
        font-size: 1.8rem;
    }
    
    .generated-content h2 {
        font-size: 1.5rem;
    }
    
    .generated-content h3 {
        font-size: 1.2rem;
    }
    
    .article-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .article-meta {
        justify-content: flex-start;
    }
    
    .article-actions {
        flex-direction: column;
    }
    
    .article-actions .btn {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .generated-content {
        font-size: 14px;
        padding: 12px;
    }
    
    .generated-content h1 {
        font-size: 1.6rem;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Print Styles for Export */
@media print {
    .export-formatting {
        font-family: 'Calibri', sans-serif;
        line-height: 1.6;
        color: #000;
        padding: 0;
    }
    
    .export-formatting h1 {
        color: #000;
        border-bottom-color: #000;
    }
    
    .export-formatting h2 {
        color: #333;
    }
    
    .export-formatting a {
        color: #059669;
        text-decoration: underline;
    }
}

/* Smooth Scrolling for Internal Links */
html {
    scroll-behavior: smooth;
}

/* Loading Animation for Regeneration */
.regenerating {
    position: relative;
}

.regenerating::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.1;
    }
    50% {
        opacity: 0.2;
    }
    100% {
        opacity: 0.1;
    }
}

/* Enhanced Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: 'Inter', sans-serif;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

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

.btn-secondary:hover:not(:disabled) {
    background: #475569;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--bg-secondary);
}

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

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

.btn-success:hover:not(:disabled) {
    background: #0da271;
}

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

.btn-info:hover:not(:disabled) {
    background: #2563eb;
}

/* Keep all your existing styles below this point... */
/* [All your previous CSS code remains here] */
/* CSS Variables for Theming */
:root {
    /* Light Theme */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --bg-color: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --transition: all 0.2s ease-in-out;
}

[data-theme="dark"] {
    --primary-color: #818cf8;
    --primary-dark: #6366f1;
    --secondary-color: #94a3b8;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --error-color: #f87171;
    --bg-color: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #334155;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
}

/* Auth Page Styles */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 20px;
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1200px;
    width: 100%;
    gap: 40px;
    align-items: center;
}

.auth-card {
    background: var(--bg-color);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

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

.auth-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

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

.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.tab-button {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

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

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.auth-form input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.auth-form i {
    position: absolute;
    left: 12px;
    top: 38px;
    color: var(--text-muted);
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.feature {
    text-align: center;
    color: white;
}

.feature i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.feature h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.feature p {
    opacity: 0.8;
    font-size: 1.1rem;
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.theme-toggle {
    position: relative;
}

.theme-switch {
    display: none;
}

.theme-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.theme-label:hover {
    background: var(--bg-tertiary);
}

.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.user-btn:hover {
    background: var(--bg-tertiary);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

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

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* Main Content */
.main-content {
    padding: 24px;
}

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

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

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

/* Form Sections */
.form-section {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

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

.section-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

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

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Topic Rows */
.topic-row {
    display: grid;
    grid-template-columns: 1fr 150px auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 12px;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

/* Add-ins Grid */
.addins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.checkbox-label:hover {
    background: var(--bg-secondary);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: var(--transition);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: #475569;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-secondary);
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-lg {
    padding: 16px 24px;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-icon {
    padding: 8px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 32px;
}

/* Results Section */
.results-section {
    margin-top: 40px;
}

.results-stats {
    background: var(--bg-secondary);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-weight: 500;
    color: var(--text-secondary);
}

.article-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.article-title {
    font-weight: 600;
    color: var(--text-primary);
}

.article-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.article-content {
    padding: 20px;
}

.article-progress {
    margin-bottom: 16px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.article-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.generated-content {
    line-height: 1.8;
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.generated-content h1,
.generated-content h2,
.generated-content h3 {
    margin: 1.5em 0 0.5em 0;
    color: var(--text-primary);
}

.generated-content h1 {
    font-size: 1.8rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5em;
}

.generated-content h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.generated-content h3 {
    font-size: 1.3rem;
}

.generated-content p {
    margin-bottom: 1em;
}

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

.generated-content em {
    font-style: italic;
    color: var(--text-secondary);
}

.generated-content ul,
.generated-content ol {
    margin: 1em 0;
    padding-left: 2em;
}

.generated-content li {
    margin-bottom: 0.5em;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

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

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-body {
    padding: 24px;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.loading-overlay.show {
    display: flex;
}

.loading-content {
    background: var(--bg-color);
    padding: 40px;
    border-radius: var(--radius);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-content h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.loading-content p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--error-color);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        grid-template-columns: 1fr;
    }
    
    .auth-features {
        display: none;
    }
    
    .navbar {
        padding: 12px 16px;
    }
    
    .nav-brand span {
        display: none;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .topic-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .addins-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .article-header {
        flex-direction: column;
        gap: 8px;
        align-items: start;
    }
    
    .article-meta {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 24px;
    }
    
    .form-section {
        padding: 16px;
    }
    
    .modal-content {
        width: 95%;
    }
}
/* Settings Page Styles */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
}

.settings-section {
    margin-bottom: 40px;
}

.settings-section .section-header {
    margin-bottom: 20px;
}

.settings-section .section-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.settings-form {
    max-width: 500px;
}

.settings-form .form-group {
    margin-bottom: 24px;
}

.settings-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-form input,
.settings-form select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.settings-form input:focus,
.settings-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.settings-form small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Danger Zone */
.danger-zone {
    border-color: var(--error-color);
    background: rgba(239, 68, 68, 0.05);
}

.danger-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.danger-icon {
    color: var(--error-color);
    font-size: 2rem;
}

.danger-text {
    flex: 1;
    min-width: 300px;
}

.danger-text h3 {
    color: var(--error-color);
    margin-bottom: 8px;
    font-weight: 600;
}

.danger-text p {
    color: var(--text-secondary);
    margin: 0;
}

/* Delete Warning */
.delete-warning {
    text-align: center;
    padding: 20px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.delete-warning i {
    font-size: 3rem;
    color: var(--error-color);
    margin-bottom: 16px;
    display: block;
}

.delete-warning h3 {
    color: var(--error-color);
    margin-bottom: 12px;
    font-weight: 600;
}

.delete-warning p {
    color: var(--text-secondary);
    margin: 0;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-actions .btn {
    min-width: 140px;
}

/* Responsive Design for Settings */
@media (max-width: 768px) {
    .settings-card {
        padding: 20px;
    }
    
    .danger-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .danger-text {
        min-width: auto;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .settings-container {
        margin: 0 -16px;
    }
    
    .settings-card {
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
}