:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #475569;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 8rem 2rem 4rem;
    text-align: center;
    margin-top: 60px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
    padding: 1rem 2rem;
    background: rgba(255,255,255,0.1);
    border-radius: 1rem;
    backdrop-filter: blur(10px);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.section {
    margin: 4rem 0;
}

.section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text);
}

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

.subject-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s;
}

.subject-card:hover::before {
    opacity: 1;
}

.subject-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.subject-card h3 {
    margin-bottom: 1rem;
    color: var(--text);
}

.subject-card ul {
    list-style: none;
    margin-bottom: 1rem;
}

.subject-card li {
    padding: 0.25rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding-left: 1.5rem;
    position: relative;
}

.subject-card li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
}

.percentage {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Exam Section */
.pruefung-section {
    background: var(--bg-card);
    border-radius: 1rem;
    padding: 3rem 2rem;
}

.exam-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.exam-btn {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    color: var(--text);
}

.exam-btn:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.02);
}

.exam-title {
    display: block;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.exam-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Progress Section */
.progress-container {
    display: grid;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.progress-item {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-weight: 500;
}

.progress-bar-full {
    height: 12px;
    background: var(--bg);
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.quiz-container {
    background: var(--bg-card);
    border-radius: 1rem;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.timer {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    font-family: monospace;
}

.timer.warning {
    color: var(--warning);
}

.timer.danger {
    color: var(--danger);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: var(--danger);
}

.progress-bar {
    height: 6px;
    background: var(--bg);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s;
}

/* Question */
.question-container {
    padding: 2rem;
}

.question-text {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.answers {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.answer-option {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.answer-option:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.answer-option.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.2);
}

.answer-option.correct {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.2);
}

.answer-option.wrong {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.2);
}

.answer-letter {
    width: 30px;
    height: 30px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.answer-option.correct .answer-letter {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.answer-option.wrong .answer-letter {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.answer-text {
    flex: 1;
}

.explanation {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary);
    font-size: 0.9rem;
}

/* Quiz Controls */
.quiz-controls {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Result Container */
.result-container {
    background: var(--bg-card);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.result-container h2 {
    margin-bottom: 2rem;
    font-size: 2rem;
}

.result-score {
    margin-bottom: 2rem;
}

.result-percent {
    display: block;
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.result-text {
    display: block;
    font-size: 1.2rem;
    color: var(--text-muted);
}

.result-feedback {
    background: rgba(99, 102, 241, 0.1);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary);
}

.result-details {
    text-align: left;
    background: var(--bg);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.result-details p {
    margin: 0.5rem 0;
}

/* Footer */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 3rem 2rem 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-links a {
    display: inline-block;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .hero {
        padding: 6rem 1rem 2rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .hero-stats {
        gap: 1rem;
    }

    .stat {
        padding: 0.75rem 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .container {
        padding: 1rem;
    }

    .section {
        margin: 2rem 0;
    }

    .section h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .subjects-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .subject-card {
        padding: 1rem;
    }

    .subject-icon {
        font-size: 2rem;
    }

    .subject-card h3 {
        font-size: 1.1rem;
    }

    .subject-card li {
        font-size: 0.85rem;
    }

    .pruefung-section {
        padding: 2rem 1rem;
    }

    .exam-modes {
        grid-template-columns: 1fr;
    }

    .exam-btn {
        padding: 1.5rem;
    }

    .quiz-container {
        max-width: 90%;
    }

    .quiz-header {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .question-container {
        padding: 1.5rem;
    }

    .question-text {
        font-size: 1rem;
    }

    .quiz-controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        padding: 1rem;
    }

    .result-container {
        max-width: 90%;
    }

    .result-percent {
        font-size: 3rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .navbar {
        position: static;
    }

    .hero {
        margin-top: 0;
        padding: 3rem 1rem 2rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 0.5rem;
    }

    .stat {
        padding: 0.5rem 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .section h2 {
        font-size: 1.3rem;
    }

    .exam-title {
        font-size: 1.1rem;
    }

    .exam-desc {
        font-size: 0.8rem;
    }

    .timer {
        font-size: 1.2rem;
    }

    .answer-option {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .answer-letter {
        width: 25px;
        height: 25px;
        font-size: 0.9rem;
    }

    .quiz-container {
        max-width: 100%;
        max-height: 95vh;
    }
}
