/* Enhanced Wikipedia-style typography and layout */
body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.7;
    font-size: 16px;
}

/* Modern font stack */
h1, h2, h3, h4, h5, h6, .font-sans {
    font-family: 'Inter', 'Arial', 'Helvetica', sans-serif;
}

/* Article content styling */
article {
    max-width: none;
}

article h1, article h2, article h3 {
    font-family: 'Inter', 'Arial', 'Helvetica', sans-serif;
    font-weight: 600;
}

article p {
    font-family: 'Georgia', 'Times New Roman', serif;
    text-align: justify;
    hyphens: auto;
    font-size: 16px;
    line-height: 1.7;
}

/* Enhanced link styling */
a {
    color: #0645ad;
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    text-decoration: underline;
    color: #0b5394;
}

a:visited {
    color: #0b0080;
}

/* Modern button styling */
button {
    transition: all 0.2s ease;
    font-weight: 500;
}

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

/* Citation styling */
.citation {
    font-size: 0.8em;
    vertical-align: super;
    color: #0645ad;
    font-weight: 500;
}

/* Enhanced loading animations */
@keyframes shimmer {
    0% { 
        background-position: -200px 0; 
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
    100% { 
        background-position: calc(200px + 100%) 0; 
        opacity: 0.8;
    }
}

.animate-pulse {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 2s infinite;
}

/* Dark mode loading */
.dark .animate-pulse {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200px 100%;
}

/* Enhanced infobox styling */
.infobox table td {
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding: 8px 12px;
    vertical-align: top;
}

.dark .infobox table td {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Section headers with enhanced Wikipedia-style underlines */
section h2 {
    border-bottom: 3px solid #a2a9b1;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    position: relative;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: #36a2eb;
}

.dark section h2 {
    border-bottom: 3px solid #54595d;
}

/* Enhanced floating controls with modern design */
.floating-controls {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

/* Modern scrollbar design */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #c1c1c1, #a8a8a8);
    border-radius: 5px;
    border: 2px solid #f1f1f1;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a8a8a8, #888);
}

.dark ::-webkit-scrollbar-track {
    background: #2d3748;
}

.dark ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4a5568, #2d3748);
    border: 2px solid #2d3748;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #6b7280, #4a5568);
}

/* Enhanced image styling */
img {
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

img:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    transform: scale(1.02);
}

/* Print styles */
@media print {
    .fixed, .float-right, aside, footer, button {
        display: none !important;
    }
    
    article {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
        line-height: 1.5;
    }
    
    h1 { font-size: 20pt; }
    h2 { font-size: 16pt; }
    h3 { font-size: 14pt; }
    
    img {
        max-width: 100%;
        height: auto;
        box-shadow: none;
    }
}

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

/* Enhanced focus states for accessibility */
button:focus, input:focus, select:focus {
    outline: 2px solid #36a2eb;
    outline-offset: 2px;
}

/* Data visualization enhancements */
.data-bar {
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, #36a2eb, #4bc0c0);
}

.data-bar:hover {
    background: linear-gradient(90deg, #2563eb, #0891b2);
}

/* Enhanced tab styling */
nav button {
    position: relative;
    overflow: hidden;
}

nav button::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #36a2eb;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

nav button:hover::before {
    width: 100%;
}

/* Loading state improvements */
.loading-shimmer {
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Interactive elements */
.interactive-element {
    transition: all 0.3s ease;
    cursor: pointer;
}

.interactive-element:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

/* Citation hover effects */
.citation:hover {
    background: rgba(6, 69, 173, 0.1);
    border-radius: 3px;
    padding: 1px 2px;
}

/* Modern card design */
.card {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.dark .card {
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Typography improvements */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive enhancements */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .float-right {
        float: none !important;
        width: 100% !important;
        margin: 0 0 1rem 0 !important;
    }
    
    aside {
        width: 100% !important;
        margin-bottom: 2rem;
    }
    
    .grid {
        grid-template-columns: 1fr !important;
    }
}

/* Animation utilities */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Modern glassmorphism effects */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.dark .glass {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}