/* Base styles and variables */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --text-color: #333;
    --border-radius: 5px;
    --box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f9f9f9;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
}

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

h3 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-top: 1.5rem;
}

p {
    margin-bottom: 1.5rem;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

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

li {
    margin-bottom: 0.5rem;
}

/* Header styles */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem 0;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    color: white;
    margin-bottom: 1rem;
}

nav ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

nav li {
    margin-right: 1.5rem;
    margin-bottom: 0.5rem;
}

nav a {
    color: white;
    font-weight: 500;
    text-decoration: none;
    padding: 0.5rem 0;
    position: relative;
}

nav a:hover {
    color: var(--light-color);
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--light-color);
    transition: var(--transition);
}

nav a:hover::after {
    width: 100%;
}

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

section {
    margin-bottom: 3rem;
}

#introduction, #conclusion, #references {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* Question navigation */
.question-nav {
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.question-nav h3 {
    margin-top: 0;
}

.question-nav ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.5rem;
    list-style: none;
    padding: 0;
}

.question-nav a {
    display: block;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.question-nav a:hover {
    background-color: var(--light-color);
    border-left-color: var(--secondary-color);
    text-decoration: none;
}

/* Question cards */
.question-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: var(--transition);
}

.question-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.question-card h2 {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    margin-top: 0;
    border-bottom: none;
}

.question-content {
    padding: 1.5rem;
}

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

footer p {
    margin-bottom: 0.5rem;
}

/* Responsive styles */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .question-nav ul {
        grid-template-columns: 1fr;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav li {
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .container {
        width: 95%;
        padding: 0 10px;
    }
    
    #introduction, #conclusion, #references, .question-content {
        padding: 1rem;
    }
}

/* Print styles */
@media print {
    header, footer, .question-nav {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        background: white;
        color: black;
    }
    
    .question-card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
        margin-bottom: 1.5rem;
    }
    
    .question-card h2 {
        background-color: #f5f5f5;
        color: black;
    }
    
    a {
        color: black;
        text-decoration: none;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 90%;
    }
}
