/* --- FUNDAMENTY I RESET --- */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

:root {
    --primary-dark: #2c3e50;
    --primary-blue: #3498db;
    --accent-yellow: #ffca28;
    --success-green: #27ae60;
    --error-red: #e53935;
    --bg-light: #f4f7f6;
    --white: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: var(--bg-light);
    min-height: 100vh;
}

/* --- NAGŁÓWEK (Wspólny dla wszystkich stron) --- */
.main-header {
    background: var(--primary-dark);
    color: var(--white);
    padding: 1rem 0;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
}

.logo { 
    font-size: 1.8rem; 
    margin: 0; 
    letter-spacing: 1px;
    color: var(--white);
}

.logo span { color: var(--primary-blue); }

.back-btn {
    color: var(--white);
    text-decoration: none;
    background: #34495e;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.back-btn:hover { background: var(--primary-blue); }

/* --- KONTENER GŁÓWNY --- */
.container {
    max-width: 900px;
    width: 95%;
    margin: 2rem auto;
    padding: 0 1rem;
}

.container--quiz {
    max-width: 500px;
    width: 90%;
    margin: 2rem auto;
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* --- KARTY I SEKCJE (Strona Główna) --- */
.card {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.card:hover { transform: translateY(-3px); }

.teacher-section { 
    background: var(--primary-blue); 
    color: var(--white); 
}

.teacher-section h2 { border-left-color: var(--white); color: var(--white); }

.btn {
    display: inline-block;
    background: var(--white);
    color: var(--primary-blue);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 1rem;
}

.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.quiz-link {
    text-decoration: none;
    background: #e8f4fd;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    font-weight: bold;
    color: #2980b9;
    transition: 0.2s;
    border: 2px solid transparent;
}

.quiz-link:hover {
    background: #d1e9f9;
    border-color: var(--primary-blue);
}

/* --- LOGIKA QUIZU (Strony z pytaniami) --- */
.quiz-container {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.progress-text { 
    color: #7f8c8d; 
    font-weight: bold; 
    margin-bottom: 1.5rem; 
}

.question {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    color: var(--primary-dark);
}

.options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

button.option {
    background: var(--white);
    border: 3px solid #dee2e6;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

button.option:hover { border-color: var(--primary-blue); background: #f8f9fa; }

/* Statusy odpowiedzi */
button.correct { 
    background: #c8e6c9 !important; 
    border-color: var(--success-green) !important; 
    color: #1b5e20; 
}

button.wrong { 
    background: #ffcdd2 !important; 
    border-color: var(--error-red) !important; 
    color: #b71c1c; 
}

.icon { margin-right: 10px; font-weight: bold; }

/* --- MODAL (POMOC) --- */
#helpBtn {
    background: #9b59b6;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 20px;
}

.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex; justify-content: center; align-items: center;
    z-index: 2000;
}

.modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    position: relative;
}
.modal-content img {
    max-width: 90%;
}

.close { position: absolute; top: 10px; right: 20px; font-size: 30px; cursor: pointer; }

/* --- STOPKA I INNE --- */
.hidden { display: none !important; }

footer {
    text-align: center;
    padding: 2rem;
    background: var(--primary-dark);
    color: var(--white);
    margin-top: 4rem;
}

#restartBtn {
    background: var(--accent-yellow);
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1.1rem;
}

/* --- RESPONSYWNOŚĆ --- */
@media (max-width: 600px) {
    .header-content { flex-direction: column; gap: 10px; }
    .container { margin-top: 1rem; }
}