
/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Separate heading font stack */
    --heading-font: 'Georgia', 'Times New Roman', serif;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Apply heading font */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Header */
header {
    background: linear-gradient(135deg, #d32f2f, #f44336);
    color: white;
    padding: 2rem;
    text-align: center;
}

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

nav a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Main content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Article grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.article-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.article-card img { /* Added style for images in article cards */
    max-width: 100%;
    height: auto;
    display: block; /* Optional: to remove extra space below image if it's an inline element */
    margin-top: 1rem; /* Optional: to add some space above the image */
    margin-bottom: 1rem; /* Optional: to add some space below the image */
    border-radius: 4px; /* Optional: to match card's rounded corners */
}

.article-card h2 a {
    color: #d32f2f;
    text-decoration: none;
}

.article-card h2 a:hover {
    text-decoration: underline;
}

.date {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.stats {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.stat {
    background: #e3f2fd;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #1976d2;
}

/* Article page sections */
section {
    background: white;
    margin: 2rem 0;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

section h2 {
    color: #d32f2f;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* Audio section */
.audio-section audio {
    width: 100%;
    margin-top: 1rem;
}

/* German text */
.german-text p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-subheading {
    font-family: var(--heading-font);
    font-size: 1.35rem;
    margin: 2rem 0 1rem;
    color: #b71c1c;
    line-height: 1.3;
    position: relative;
}
.article-subheading:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg,#d32f2f,#f44336);
    border-radius: 2px;
}

/* Explained word hover tooltips */
.hover-hint {
        font-size: 0.85rem;
        color: #666;
        margin-bottom: 0.75rem;
}

.explained-word {
        position: relative;
        background: #fff9c4;
        padding: 0 2px;
        border-radius: 3px;
        cursor: help;
        transition: background-color 0.2s;
}
.explained-word.beginner { background: #e8f5e8; }
.explained-word.intermediate { background: #fff3e0; }
.explained-word.advanced { background: #ffebee; }
.explained-word:hover { background: #ffe082; }

.explained-word .tooltip-text {
        visibility: hidden;
        opacity: 0;
        position: absolute;
        left: 0;
        top: 110%;
        z-index: 10;
        background: #222;
        color: #fff;
        padding: 0.6rem 0.75rem;
        border-radius: 6px;
        font-size: 0.8rem;
        line-height: 1.2;
        width: 240px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.25);
        transition: opacity 0.15s;
}
.explained-word .tooltip-text .example { color: #90caf9; font-style: italic; }
.explained-word:hover .tooltip-text { visibility: visible; opacity: 1; }

@media (max-width: 600px) {
    .explained-word .tooltip-text {
        left: 50%;
        transform: translateX(-50%);
        top: 125%;
        width: 70vw;
    }
}

/* Explanations */
.explanations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.explanation-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
}

.explanation-card.beginner {
    border-left: 4px solid #4caf50;
}

.explanation-card.intermediate {
    border-left: 4px solid #ff9800;
}

.explanation-card.advanced {
    border-left: 4px solid #f44336;
}

.explanation-card h3 {
    color: #d32f2f;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.part-of-speech {
    font-style: italic;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.definition {
    margin-bottom: 1rem;
    font-weight: 500;
}

.example {
    color: #555;
    margin-bottom: 1rem;
}

.difficulty-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.beginner .difficulty-badge {
    background: #e8f5e8;
    color: #2e7d32;
}

.intermediate .difficulty-badge {
    background: #fff3e0;
    color: #ef6c00;
}

.advanced .difficulty-badge {
    background: #ffebee;
    color: #c62828;
}

/* Quiz section */
.quiz-question {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.quiz-question h3 {
    color: #d32f2f;
    margin-bottom: 1rem;
}

.question {
    font-weight: 500;
    margin-bottom: 1rem;
}

.options {
    margin-bottom: 1rem;
}

.options label {
    display: block;
    padding: 0.5rem 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.options label:hover {
    background-color: #f5f5f5;
    border-radius: 4px;
}

.options input[type="radio"] {
    margin-right: 0.5rem;
}

.check-button {
    background: #d32f2f;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.check-button:hover {
    background: #b71c1c;
}

.answer-feedback {
    background: #e8f5e8;
    border: 1px solid #4caf50;
    border-radius: 4px;
    padding: 1rem;
    margin-top: 1rem;
}

.answer-feedback.incorrect {
    background: #ffebee;
    border-color: #f44336;
}

#quiz-results {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: #666;
    border-top: 1px solid #ddd;
    margin-top: 3rem;
}

footer a {
    color: #d32f2f;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .explanations-grid {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}