/* Variables */
:root {
    --primary-color: #4a6fa5;
    --secondary-color: #6c757d;
    --accent-color: #3d5a80;
    --background-color: #f8f9fa;
    --text-color: #333;
    --light-text: #6c757d;
    --border-color: #dee2e6;
    --header-bg: #3d5a80;
    --header-text: #ffffff;
    --footer-bg: #293241;
    --footer-text: #e0fbfc;
    --section-bg: #ffffff;
    --code-bg: #f5f5f5;
    --link-color: #4a6fa5;
    --link-hover: #3d5a80;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 5px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', Times, serif;
    margin-bottom: 1rem;
    line-height: 1.3;
    color: var(--text-color);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 2rem;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

h4 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1.5rem;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

ul, ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Header */
header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 3rem 0;
    text-align: center;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    color: var(--header-text);
}

.subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 0;
}

/* Navigation */
#main-nav {
    background-color: var(--section-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

#main-nav ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#main-nav li {
    margin: 0;
    white-space: nowrap;
}

#main-nav a {
    display: block;
    padding: 1rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

#main-nav a:hover {
    color: var(--primary-color);
    background-color: rgba(0, 0, 0, 0.05);
}

/* Main Content */
main {
    padding: 2rem 0;
}

.section {
    background-color: var(--section-bg);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 2rem 0;
    text-align: center;
}

footer p {
    margin-bottom: 0.5rem;
}

/* References */
.references-list {
    padding-left: 2rem;
}

.references-list li {
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.35rem;
    }
    
    #main-nav ul {
        flex-wrap: nowrap;
    }
    
    #main-nav a {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .section {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    #main-nav a {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .section {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    header, #main-nav, footer {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background-color: #fff;
    }
    
    .section {
        box-shadow: none;
        margin-bottom: 1rem;
        page-break-inside: avoid;
    }
    
    h2, h3, h4 {
        page-break-after: avoid;
    }
    
    p, ul, ol {
        page-break-inside: avoid;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
}

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

.section {
    animation: fadeIn 0.5s ease-in-out;
}

/* Accessibility */
:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #121212;
        --text-color: #e0e0e0;
        --light-text: #a0a0a0;
        --section-bg: #1e1e1e;
        --border-color: #333;
        --code-bg: #2d2d2d;
    }
    
    #main-nav {
        background-color: #1a1a1a;
    }
    
    #main-nav a:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }
}
