/* Article Template Enhancements */

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Enhanced section styling */
.article-section {
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.article-section:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Gradient backgrounds for sections */
.executive-summary {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid #3b82f6;
}

.main-analysis {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left: 4px solid #16a34a;
}

.key-points {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-left: 4px solid #9333ea;
}

.recommendations {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-left: 4px solid #ea580c;
}

/* Enhanced navigation buttons */
.nav-button {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.nav-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Section headers with icons */
.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 0.5rem;
    backdrop-filter: blur(10px);
}

.section-header .icon-container {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* Content containers */
.content-container {
    background: white;
    border-radius: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Quick navigation enhancements */
.quick-nav {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
}

.quick-nav .nav-link {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.quick-nav .nav-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Article structure overview */
.structure-overview {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
}

.structure-overview .structure-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    transition: all 0.2s ease;
}

.structure-overview .structure-item:hover {
    color: #1d4ed8;
    transform: translateX(4px);
}

/* Responsive improvements */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .section-header .icon-container {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .content-container {
        padding: 1rem;
    }
}

/* Print styles */
@media print {
    .quick-nav,
    .structure-overview {
        display: none;
    }
    
    .article-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Accessibility improvements */
.section-header:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.nav-link:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 0.375rem;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .content-container {
        background: #1f2937;
        color: #f9fafb;
        border-color: #374151;
    }
    
    .quick-nav {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
        border-color: #374151;
    }
    
    .structure-overview {
        background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
        border-color: #3b82f6;
    }
}

/* --- Auth & Policy Modals --- */
.auth-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.auth-logo { height: 40px; width: auto; flex: 0 0 auto; display: block; }
.auth-title { margin: 0; }

/* Ensure auth header does not overlap the card that follows */
.auth-header + .card { margin-top: 0; }

/* Responsive safeguard: stack on small screens */
@media (max-width: 640px) {
    .auth-header { align-items: flex-start; }
}

.modal { 
    display: none !important; 
    position: fixed !important; 
    inset: 0 !important; 
    background: rgba(0, 0, 0, 0.5) !important; 
    z-index: 9999 !important; 
    overflow-y: auto !important; 
    padding: 20px !important; 
}
.modal[aria-hidden="false"] { 
    display: flex !important; 
    align-items: flex-start !important; 
    justify-content: center !important; 
}
.modal-content { 
    background: var(--card-bg) !important; 
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    max-width: 800px !important; 
    width: 100% !important; 
    margin: 40px auto !important; 
    padding: 0 !important; 
    border-radius: 12px !important; 
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important; 
    max-height: 90vh !important; 
    display: flex !important; 
    flex-direction: column !important; 
}
.modal-close { 
    background: none !important; 
    border: none !important; 
    font-size: 24px !important; 
    line-height: 1 !important; 
    cursor: pointer !important; 
    color: var(--text-primary) !important;
    transition: color 0.2s ease !important;
}
.modal-close:hover {
    color: var(--text-secondary) !important;
}
.modal-header { 
    display: flex !important; 
    align-items: center !important; 
    gap: 12px !important; 
    padding: 20px 24px !important; 
    border-bottom: 1px solid var(--border-color) !important; 
    flex-shrink: 0 !important; 
}
.modal-header img { 
    display: block !important; 
    height: 24px !important; 
    width: auto !important; 
}
.modal-body {
    overflow-y: auto !important;
    padding: 24px !important;
    flex: 1 !important;
    color: var(--text-primary) !important;
}

/* Dark theme modal adjustments */
[data-theme="dark"] .modal { 
    background: rgba(0,0,0,0.75) !important; 
}
[data-theme="dark"] .modal-content { 
    background: var(--card-bg) !important; 
    color: var(--text-primary) !important; 
    border: 1px solid var(--border-color) !important; 
}
[data-theme="dark"] .modal-body {
    color: var(--text-primary) !important;
}
