/* Globale Variablen */
:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --math-color: #0ea5e9;
    --dgb-color: #f59e0b;
    --info-color: #10b981;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --pdf-red: #ef4444;
    --doc-blue: #3b82f6;
    --xls-green: #10b981;
    --html-orange: #f59e0b;
}

/* Grundeinstellungen */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Header-Bereich */
header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 2.5rem 1rem;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 2rem;
    color: var(--primary);
    font-weight: 800;
}

header p {
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 1rem;
}

/* Hauptnavigation (Startseite) */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.nav-toggle {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.nav-toggle.active {
    background: var(--primary);
    color: white;
}

/* Zurück-Button (Unterseiten) */
.back-nav {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.btn-back {
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid #e2e8f0;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    transition: 0.2s;
}

.btn-back:hover {
    background: #e2e8f0;
}

/* Hauptinhaltsbereich */
main {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Ansichten umschalten (Hauptseite) */
.view-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Klassen-Navigation (Startseite) */
.class-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.class-pill {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 0.6rem 1.2rem;
    border-radius: 9999px;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    text-decoration: none; 
    display: inline-block;
}

.class-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

/* Download- und Glücksrad-Karten */
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.download-card {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: 0.2s;
}

.download-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.file-icon {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.icon-pdf { background-color: var(--pdf-red); }
.icon-doc { background-color: var(--doc-blue); }
.icon-xls { background-color: var(--xls-green); }
.icon-html { background-color: var(--html-orange); }

.file-info h4 { margin: 0; font-size: 1rem; }
.file-info p { margin: 0; font-size: 0.8rem; color: var(--text-muted); }

/* Material-Karten in den Klassen (Unterseiten) */
.subject-group { margin-bottom: 2.5rem; }

.subject-header { 
    display: flex; 
    align-items: center; 
    gap: 0.75rem; 
    margin-bottom: 1.25rem; 
    padding-bottom: 0.5rem; 
    border-bottom: 2px solid #e2e8f0; 
}

/* Fächer-Badges */
.subject-badge { 
    font-size: 0.7rem; 
    text-transform: uppercase; 
    padding: 0.2rem 0.6rem; 
    border-radius: 4px; 
    color: white; 
    font-weight: 700; 
}

.bg-math { background-color: var(--math-color); }
.bg-info { background-color: var(--info-color); }
.bg-dgb { background-color: var(--dgb-color); }

.resource-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 1.25rem; 
}

.resource-card {
    background: white; 
    border: 1px solid #e2e8f0; 
    padding: 1.25rem;
    border-radius: 0.75rem; 
    text-decoration: none; 
    color: inherit; 
    display: flex; 
    flex-direction: column; 
    transition: all 0.2s;
}

.resource-card:hover { 
    border-color: var(--primary); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); 
    transform: translateY(-2px); 
}

.resource-card h4 { 
    margin: 0 0 0.4rem 0; 
    font-size: 1.05rem; 
    color: var(--text-main); 
}

.resource-card p { 
    margin: 0; 
    font-size: 0.85rem; 
    color: var(--text-muted); 
}

/* Footer */
footer { 
    text-align: center; 
    padding: 3rem 1rem; 
    color: var(--text-muted); 
    font-size: 0.85rem; 
    border-top: 1px solid #e2e8f0; 
    margin-top: 2rem; 
}