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

:root {
    /* Enterprise color palette */
    --primary-color: #0f172a;
    --primary-hover: #1e293b;
    --secondary-color: #475569;
    --secondary-hover: #334155;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    
    /* Primary color aliases for animations */
    --primary: #3b82f6;
    --primary-alpha: rgba(59, 130, 246, 0.1);
    --secondary-alpha: rgba(71, 85, 105, 0.05);
    
    /* Dark mode backgrounds */
    --background: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --card-bg: #1e293b;
    --modal-bg: #1e293b;
    
    /* Text colors for dark mode */
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #cbd5e1;
    --text-on-dark: #f1f5f9;
    --text-on-dark-secondary: #cbd5e1;
    
    /* Border and shadows for dark mode */
    --border-color: #334155;
    --border-light: #1e293b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Add Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

/* Header */
header {
    background: linear-gradient(to right, rgba(17, 24, 39, 0.98), rgba(31, 41, 55, 0.98));
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    max-width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
    flex-shrink: 0;
}

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

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.logo-tagline {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.025em;
}

header nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.user-info strong {
    color: var(--text-primary);
}

.role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-user {
    background-color: #dbeafe;
    color: #1e40af;
}

.role-admin {
    background-color: #fef3c7;
    color: #92400e;
}

/* Main Content */
main {
    min-height: calc(100vh - 60px);
    padding: 0;
    background-color: var(--background);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Features Grid */
.features {
    padding: 4rem 0;
}

.features h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background-color: var(--surface);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.feature-card h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-secondary);
}

/* Auth Container */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-card {
    background-color: var(--surface);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-card p {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
}

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

/* App Layout */
.app-container {
    display: flex;
    gap: 0;
    max-width: 100%;
    margin: 0;
    min-height: calc(100vh - 60px);
}

.sidebar {
    width: 240px;
    background-color: var(--sidebar-bg);
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    height: calc(100vh - 60px);
    position: sticky;
    top: 60px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 0;
}

.nav-link {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1.5rem;
    color: var(--text-on-dark-secondary);
    text-decoration: none;
    border-radius: 0;
    transition: all 0.15s ease;
    margin: 0 0.75rem;
    border-radius: var(--radius-md);
    position: relative;
}

.nav-link:hover {
    background-color: var(--sidebar-hover);
    color: var(--text-on-dark);
}

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

.nav-link.active .nav-desc {
    color: rgba(255, 255, 255, 0.9);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background-color: var(--text-on-dark);
    border-radius: 0 3px 3px 0;
}

.nav-icon {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    opacity: 0.9;
}

.nav-text {
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: -0.01em;
}

.nav-desc {
    font-size: 0.75rem;
    opacity: 0.85;
    margin-top: 0.125rem;
    line-height: 1.3;
}

.content {
    flex: 1;
    background-color: transparent;
    padding: 2rem;
    border-radius: 0;
    box-shadow: none;
    max-width: 1200px;
    margin: 0 auto;
}

.content-section {
    display: none;
}

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

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    transition: all 0.15s ease;
}

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

.stat-card h3 {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.025em;
}

/* Actions */
.actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Test Results */
.test-results {
    margin-top: 2rem;
}

/* Test Setup Styles */
.test-setup {
    background: var(--background);
    padding: 0;
    border-radius: 8px;
    margin-top: 2rem;
}

.collapsible-header {
    width: 100%;
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collapsible-header:hover {
    background: var(--surface);
    border-color: var(--primary-color);
}

.collapsible-content {
    padding: 2rem;
    animation: slideDown 0.3s ease;
}

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

.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.test-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.test-card h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.test-card p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.test-card button {
    margin-top: 0.5rem;
    width: 100%;
}

.llm-test {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.llm-test input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.test-success {
    background: #10b981;
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
    text-align: center;
}

.test-success h4 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

/* Topics list */
.topics-list {
    display: grid;
    gap: 1rem;
}

.topic-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.15s ease;
}

.topic-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-color);
    transform: translateY(-1px);
}

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

.topic-header h4 {
    margin: 0;
    color: var(--text-primary);
}

.topic-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.topic-status.inactive {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(107, 114, 128, 0.2);
}

.topic-config {
    margin-bottom: 16px;
}

.topic-config p {
    margin: 4px 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.topic-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.topic-actions .btn-primary {
    font-weight: 500;
}

/* Newsletters list */
.newsletters-list {
    display: grid;
    gap: 16px;
}

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

.newsletter-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.newsletter-header h4 {
    margin: 0;
    color: var(--text-primary);
}

.newsletter-status {
    font-size: 0.875rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.newsletter-status.draft {
    background: #f59e0b;
    color: white;
}

.newsletter-status.published {
    background: #10b981;
    color: white;
}

.newsletter-status.archived {
    background: #6b7280;
    color: white;
}

.newsletter-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.newsletter-subject {
    margin: 0.5rem 0 1rem 0;
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

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

/* Create newsletter form */
.create-newsletter-form {
    max-width: 800px;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

.workflow-steps {
    margin-top: 32px;
}

.workflow-step {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.workflow-step h3 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.workflow-step p {
    margin: 0 0 16px 0;
    color: var(--text-secondary);
}

.step-result {
    margin-top: 16px;
}

/* Articles selection */
.articles-selection-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1rem;
    background: var(--background);
}

.article-selection-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
}

.article-selection-item:hover {
    background-color: var(--surface-hover);
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.article-selection-item input[type="checkbox"] {
    margin-top: 4px;
    cursor: pointer;
}

.article-preview h5 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.article-bullet {
    margin: 0 0 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.article-meta {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Preview modal */
.modal-large {
    max-width: 900px;
    width: 90%;
}

.modal-body {
    padding: 20px;
}

.preview-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background-color: var(--background);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: 0.25rem;
}

.tab-btn {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    position: relative;
    border-radius: var(--radius-sm);
}

.tab-btn:hover {
    color: var(--text-primary);
    background-color: var(--surface-hover);
}

.tab-btn.active {
    color: var(--text-primary);
    background-color: var(--surface);
    box-shadow: var(--shadow-sm);
}

.preview-content {
    max-height: 500px;
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--background);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.preview-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Loading states */
.loading {
    color: var(--text-primary);
    font-style: italic;
    font-size: 0.875rem;
}

/* AI Loading Animation */
.ai-loading {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-alpha), var(--secondary-alpha));
    border-radius: var(--radius-md);
    border: 1px solid var(--primary-alpha);
    animation: pulse-glow 2s ease-in-out infinite;
}

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

.ai-loading-icon {
    width: 48px;
    height: 48px;
    position: relative;
}

.ai-loading-icon svg {
    width: 100%;
    height: 100%;
    animation: rotate 3s linear infinite;
}

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

.ai-loading-content {
    flex: 1;
}

.ai-loading-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.ai-loading-status {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.ai-progress-dots {
    display: inline-flex;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.ai-progress-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    animation: bounce 1.4s ease-in-out infinite;
}

.ai-progress-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-progress-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem;
    font-size: 0.875rem;
}

/* Scrollbar styling for dark theme */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

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

/* Improve contrast for specific elements */
.topic-config p strong,
.newsletter-meta span,
.article-preview h5 {
    color: var(--text-primary);
    font-weight: 500;
}

/* Sources selection grid */
.sources-selection {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.source-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.source-item input[type="checkbox"] {
    cursor: pointer;
}

.source-item label {
    cursor: pointer;
    font-size: 0.875rem;
    margin: 0;
    flex: 1;
}

.source-item.selected {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.source-item.selected label {
    color: white;
}

/* Template hint styling */
.template-hint {
    background-color: var(--background);
    padding: 0.75rem;
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
    margin-top: 0.5rem;
}

/* Better disabled state visibility */
button:disabled,
.btn:disabled,
input:disabled,
select:disabled {
    opacity: 0.7;
    color: var(--text-secondary) !important;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

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

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea,
.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background-color: var(--surface);
    color: var(--text-primary);
    transition: all 0.15s ease;
}

/* Placeholder text */
.form-group input::placeholder,
.form-group textarea::placeholder,
.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

.form-group input:hover,
.form-group textarea:hover,
.form-control:hover {
    border-color: var(--text-secondary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input:disabled,
.form-control:disabled {
    background-color: var(--background);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    gap: 0.5rem;
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.btn:hover::before {
    opacity: 1;
}

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

.btn-primary:hover {
    background-color: var(--accent-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background-color: var(--surface-hover);
    border-color: var(--text-secondary);
}

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

.btn-danger:hover {
    background-color: var(--danger-hover);
    box-shadow: var(--shadow-md);
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-block {
    width: 100%;
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 5vh;
    animation: fadeIn 0.15s ease;
    overflow-y: auto;
}

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

.modal-content {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.2s ease;
    margin: 20px auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
}

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

.modal form {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Alerts */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert strong {
    font-weight: 600;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: #86efac;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Footer */
footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
}

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

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: static;
        margin-bottom: 1rem;
    }
    
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .nav-link {
        min-width: 100px;
        align-items: center;
        text-align: center;
        margin-bottom: 0;
    }
    
    .nav-desc {
        display: none;
    }
    
    .nav-icon {
        font-size: 1.25rem;
        margin-bottom: 0.125rem;
    }
    
    .nav-text {
        font-size: 0.875rem;
    }
    
    .feature-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    /* Modal adjustments for mobile */
    .modal.show {
        padding-top: 2vh;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
        margin: 10px auto;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal form {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
    }
    
    .sources-grid {
        max-height: 200px;
    }
}