:root {
    --primary: #0f172a;       /* Dark Slate */
    --accent: #2563eb;        /* Royal Blue */
    --bg: #f8fafc;            /* Light Gray */
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    
    /* Category Colors */
    --afb1: #10b981;  /* Green */
    --afb2: #8b5cf6;  /* Purple */
    --afb3: #ef4444;  /* Red */
    --abitur: #f97316; /* Orange */
    --tools: #06b6d4; /* Cyan */
    --grading: #ec4899; /* Pink */
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body { background-color: var(--bg); color: var(--text-main); line-height: 1.6; padding-bottom: 80px; }

/* --- HEADER --- */
header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white; padding: 4rem 2rem 5rem; text-align: center;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%); margin-bottom: 1rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
header h1 { font-size: 3rem; font-weight: 800; letter-spacing: -1px; margin-bottom: 0.5rem; }
header p { font-size: 1.2rem; opacity: 0.9; font-weight: 300; }

.origin-badge {
    display: inline-block; background-color: rgba(255,255,255,0.2); backdrop-filter: blur(5px);
    color: #fff; font-size: 0.85rem; padding: 6px 14px;
    border-radius: 20px; margin-bottom: 20px; font-weight: 600; letter-spacing: 0.5px;
}

/* --- CTA BUTTONS (Kaufen & Code einlösen) --- */
.cta-button-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

.cta-button {
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    min-width: 200px;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.cta-button:active {
    transform: translateY(0);
}

.cta-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.cta-primary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.cta-secondary {
    background: #3b82f6;
    color: white;
}

.cta-secondary:hover {
    background: #2563eb;
}

/* Mobile: Stack buttons vertically */
@media (max-width: 640px) {
    .cta-button-container {
        flex-direction: column;
    }
    
    .cta-button {
        width: 100%;
        max-width: 320px;
    }
}

/* --- INTRO & AFB KARTEN (OBEN) --- */
/* Das sind die Styles, die vorher gefehlt haben! */

.intro-section {
    max-width: 900px; margin: 0 auto 20px auto; text-align: center; padding: 0 20px;
}
.intro-text {
    color: #4b5563; line-height: 1.6; margin-bottom: 30px; font-size: 1.05rem;
}

.afb-explainer {
    display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; 
}

/* Grunddesign der oberen Karten (Wiederhergestellt) */
.afb-card {
    flex: 1;
    min-width: 220px;
    padding: 20px;
    border-radius: 12px;         /* Macht sie rund */
    border: 2px solid #e5e7eb;   /* Der Rahmen */
    text-align: left;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden; /* Wichtig für den Farbbalken */
}

/* Hover Effekt */
.afb-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    border-color: #cbd5e1;
}

/* Aktiv Status (Blauer Rahmen) */
.afb-card.active {
    background-color: #f0f7ff !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2) !important;
}

/* Das Häkchen bei Aktiv */
.afb-card.active::after {
    content: "✓"; position: absolute; top: 10px; right: 15px;
    font-size: 1.2rem; color: var(--accent); font-weight: bold;
}

/* Typografie in den AFB Karten */
.afb-card strong {
    display: block; margin-bottom: 5px; color: #1e293b; font-weight: 800; font-size: 1.1rem;
}
.afb-desc {
    color: #64748b; font-size: 0.9rem; line-height: 1.4; display: block;
}
.afb-desc em {
    display: block; margin-top: 8px; font-style: normal; font-weight: 600;
    color: #334155; background: #f1f5f9; padding: 4px 8px;
    border-radius: 6px; display: inline-block;
}

/* Farbige Balken oben (AFB I=Grün, II=Lila, III=Rot, Abitur=Orange, Tools=Cyan, Grading=Pink) */
.afb-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 6px;
    background: #e2e8f0; transition: background 0.3s ease;
}
.afb-explainer .afb-card:nth-child(1)::before { background: var(--afb1); }
.afb-explainer .afb-card:nth-child(2)::before { background: var(--afb2); }
.afb-explainer .afb-card:nth-child(3)::before { background: var(--afb3); }
.afb-explainer .afb-card:nth-child(4)::before { background: var(--abitur); } 
.afb-explainer .afb-card:nth-child(5)::before { background: var(--tools); }
.afb-explainer .afb-card:nth-child(6)::before { background: var(--grading); }


/* --- CONTROLS (BUTTONS) --- */
.controls {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 10px;
    padding: 0 20px 40px; position: sticky; top: 20px; z-index: 100;
}
.divider-text {
    display: block; width: 100%; text-align: center; margin: 5px 0 5px 0;
    font-size: 0.8rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; font-weight: bold;
}
.filter-btn {
    background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px);
    border: 1px solid #e2e8f0; padding: 10px 20px; border-radius: 30px;
    cursor: pointer; font-weight: 600; color: var(--text-muted);
    transition: all 0.2s; box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.filter-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 15px rgba(0,0,0,0.1); color: var(--primary); }
.filter-btn.active { 
    background: var(--primary) !important; color: white !important; border-color: transparent; 
}

/* --- GRID & SKILL CARDS --- */
.grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem; max-width: 1400px; margin: 0 auto; padding: 0 2rem;
}
.skill-card {
    background: var(--card-bg); border-radius: 20px; padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); transition: all 0.3s ease;
    cursor: pointer; border: 1px solid #f1f5f9; display: flex; flex-direction: column;
    position: relative; overflow: hidden; height: 100%;
}
.skill-card:hover { transform: translateY(-8px); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); }

/* Farbbalken Skill-Cards */
.skill-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 6px; background: #cbd5e1; }
.skill-card:has(.badge[style*="10b981"])::before { background: var(--afb1); }
.skill-card:has(.badge[style*="8b5cf6"])::before { background: var(--afb2); }
.skill-card:has(.badge[style*="ef4444"])::before { background: var(--afb3); }
.skill-card:has(.badge[style*="f97316"])::before { background: var(--abitur); }
.skill-card:has(.badge[style*="06b6d4"])::before { background: var(--tools); }
.skill-card:has(.badge[style*="ec4899"])::before { background: var(--grading); }

.badge {
    align-self: flex-start; padding: 5px 10px; border-radius: 8px;
    font-size: 0.7rem; font-weight: 800; text-transform: uppercase; margin-bottom: 1rem; color: white;
}
.skill-card h3 { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--text-main); font-weight: 700; }
.skill-card p { color: var(--text-muted); font-size: 0.95rem; flex-grow: 1; margin-bottom: 1.5rem; }

/* --- MODAL --- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(5px); z-index: 1000;
    display: none; /* Steuerung via app.js .open */
    align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
    background: white; 
    width: 95%;           /* Nutzt fast die volle Breite */
    max-width: 1400px;    /* Maximale Breite erhöht */
    max-height: 90vh;
    margin: 20px;
    display: flex; flex-direction: column;
    border-radius: 20px; overflow-y: auto; position: relative;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}
.modal-header {
    padding: 2rem 3rem; background: #fff; border-bottom: 1px solid #f1f5f9;
    position: sticky; top: 0; z-index: 20;
}
.modal-header h2 { font-size: 2rem; color: var(--primary); margin: 0; }
.modal-header .sub { color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 0.9rem; }

.close-modal {
    position: absolute; top: 2rem; right: 2rem; background: #f1f5f9; border: none;
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 1.5rem;
    display: flex; align-items: center; justify-content: center; transition: 0.2s;
}
.close-modal:hover { background: var(--grading); color: white; transform: rotate(90deg); }

.modal-content { padding: 3rem; font-size: 1.1rem; color: #334155; line-height: 1.7; }

/* Content Typography */
.modal-content h3 { color: var(--accent); margin: 2.5rem 0 1rem; font-size: 1.6rem; border-left: 5px solid var(--accent); padding-left: 1rem; }
.modal-content h3:first-child { margin-top: 0; }
.modal-content h4 { color: var(--primary); margin: 1.5rem 0 0.5rem; font-size: 1.2rem; font-weight: 700; }
.modal-content ul, .modal-content ol { padding-left: 1.5rem; margin-bottom: 1.5rem; }
.modal-content li { margin-bottom: 0.5rem; }

.highlight-box { background: #eff6ff; border: 1px solid #bfdbfe; padding: 1.5rem; border-radius: 12px; margin: 2rem 0; color: #1e3a8a; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 2rem 0; border: 1px solid #e2e8f0; border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 1000px; font-size: 0.95rem; background: white; }
th, td { padding: 14px 18px; text-align: left; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
th { background: #f8fafc; color: var(--primary); font-weight: 700; position: sticky; top: 0; }
tr:hover td { background: #f1f5f9; }

/* Grading Tables */
.grading-table th { background: var(--primary); color: white; text-align: center; border: 1px solid rgba(255,255,255,0.2); }
.grading-table td { border: 1px solid #cbd5e1; }

/* ═══════════════════════════════════════════════════════════════════════ */
/* PAYWALL STYLES */
/* ═══════════════════════════════════════════════════════════════════════ */

/* Unlock Button (oben rechts im Header) */
.unlock-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    color: #1e3a8a;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.unlock-button:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Gesperrte Karte */
.locked-card {
    position: relative;
    opacity: 0.8; /* Weiter erhöht für maximale Lesbarkeit */
    background: linear-gradient(135deg, rgba(255,255,255,0.99) 0%, rgba(248,250,252,0.99) 100%); /* Noch heller */
    cursor: pointer; /* Zeigt an, dass es klickbar ist */
    border: 2px dashed #cbd5e1; /* Gestrichelte Linie für gesperrte Karten */
}

.locked-card:hover {
    opacity: 1;
    border-color: #3b82f6; /* Ändert Farbe beim Hover */
    transform: translateY(-6px);
    box-shadow: 0 15px 30px rgba(59, 130, 246, 0.15);
}

.locked-card h3 {
    color: var(--text-main); /* #1e293b – gleiche Farbe wie freie Karten */
}

.locked-card p {
    color: var(--text-muted); /* #64748b – gleiche Farbe wie freie Karten */
}

/* Schloss-Icon oben rechts */
.lock-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    opacity: 0.6;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.locked-card:hover .lock-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* Paywall Modal */
.paywall-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.paywall-content {
    background: white;
    width: 100%;
    max-width: 600px;
    border-radius: 24px;
    padding: 40px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.4s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.paywall-header {
    text-align: center;
    margin-bottom: 30px;
}

.paywall-header h2 {
    color: #1e293b;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.paywall-header p {
    color: #64748b;
    font-size: 1.05rem;
    line-height: 1.6;
}

.paywall-features {
    background: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}

.paywall-features .feature {
    padding: 12px 0;
    color: #334155;
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 1px solid #e2e8f0;
}

.paywall-features .feature:last-child {
    border-bottom: none;
}

.paywall-price {
    text-align: center;
    margin: 30px 0;
}

.price-tag {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 20px 40px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.price-label {
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0.9;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -1px;
}

.price-note {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 10px;
}

.paywall-info {
    margin: 20px 0;
}

.paywall-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.paywall-footer a {
    text-decoration: none;
    transition: color 0.2s;
}

.paywall-footer a:hover {
    color: #3b82f6 !important;
}

/* PayPal Button Container */
#paypal-button-container {
    min-height: 45px;
}

/* Responsive Paywall */
@media (max-width: 768px) {
    .paywall-content {
        padding: 30px 20px;
        max-height: 95vh;
    }

    .paywall-header h2 {
        font-size: 1.5rem;
    }

    .price-amount {
        font-size: 2rem;
    }

    .unlock-button {
        top: 15px;
        right: 15px;
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* END PAYWALL STYLES */
/* ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    header h1 { font-size: 2.2rem; }
    .modal-content { padding: 1.5rem; }
    .modal-header { padding: 1.5rem; }
    .grid { grid-template-columns: 1fr; padding: 0 1rem; }
}
