: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; }

html {
    min-height: 100%;
}

body { 
    background-color: var(--bg); 
    color: var(--text-main); 
    line-height: 1.6; 
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#app {
    flex: 1;
}

/* --- 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%);
    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;
}

.info-badge {
    display: inline-block; background-color: rgba(255,255,255,0.2); backdrop-filter: blur(5px);
    color: #fff; font-size: 1.1rem; padding: 8px 16px;
    border-radius: 20px; margin: 16px 0 20px; font-weight: 400; letter-spacing: 0.3px;
    line-height: 1.5; max-width: 600px;
}

.info-badge-wide {
    display: block; 
    background-color: rgba(59, 130, 246, 0.1);
    backdrop-filter: blur(5px);
    color: var(--text-main); 
    font-size: 1.1rem; 
    padding: 12px 24px;
    border-radius: 12px; 
    margin: 0 auto 30px; 
    font-weight: 400; 
    letter-spacing: 0.3px;
    line-height: 1.6; 
    max-width: 900px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    text-align: center;
}

/* --- 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: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
}

.cta-secondary:hover {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}

/* 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 --- */
#cards-container {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem; 
    max-width: 1400px; 
    margin: 0 auto; 
    padding: 0 2rem;
}

.grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem; max-width: 1400px; margin: 0 auto; padding: 0 2rem;
}

.card,
.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%;
}

.card:hover,
.skill-card:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); 
}

/* Locked cards styling */
.card-locked {
    opacity: 0.7;
}

.card-locked:hover {
    transform: translateY(-4px);
    opacity: 0.85;
}

/* Card header with badge and lock icon */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.lock-icon {
    font-size: 1.2rem;
}

/* Card title and short description */
.card-title {
    font-size: 1.5rem; 
    margin-bottom: 0.5rem; 
    color: var(--text-main); 
    font-weight: 700;
}

.card-short {
    color: var(--text-muted); 
    font-size: 0.95rem; 
    flex-grow: 1; 
    margin-bottom: 1.5rem;
}

/* Farbbalken Cards */
.card::before,
.skill-card::before { 
    content: ''; position: absolute; top: 0; left: 0; 
    width: 100%; height: 6px; background: #cbd5e1; 
}

.card:has(.badge[style*="10b981"])::before,
.skill-card:has(.badge[style*="10b981"])::before { background: var(--afb1); }

.card:has(.badge[style*="8b5cf6"])::before,
.skill-card:has(.badge[style*="8b5cf6"])::before { background: var(--afb2); }

.card:has(.badge[style*="ef4444"])::before,
.skill-card:has(.badge[style*="ef4444"])::before { background: var(--afb3); }

.card:has(.badge[style*="f97316"])::before,
.skill-card:has(.badge[style*="f97316"])::before { background: var(--abitur); }

.card:has(.badge[style*="06b6d4"])::before,
.skill-card:has(.badge[style*="06b6d4"])::before { background: var(--tools); }

.card:has(.badge[style*="ec4899"])::before,
.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; color: white;
}

/* Empty state */
.empty-state {
    text-align: center !important;
    grid-column: 1 / -1;
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 100% !important;
    margin: 0 auto !important;
    width: 100% !important;
}

.empty-state p {
    margin: 0;
}

/* --- MODAL --- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.modal-open {
    display: flex;
}

.modal-overlay {
    position: fixed; 
    inset: 0; 
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(5px); 
    z-index: 9998;
}

.modal-content {
    position: relative;
    z-index: 9999;
    background: white; 
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    display: flex; 
    flex-direction: column;
    border-radius: 20px; 
    overflow-y: auto;
    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; 
}

.modal-close {
    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;
    z-index: 21;
}

.modal-close:hover { 
    background: var(--grading); 
    color: white; 
    transform: rotate(90deg); 
}

.modal-body {
    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;
}

.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: all 0.2s;
    color: #64748b;
}

.close-modal:hover {
    background: #ec4899;
    color: white;
    transform: rotate(90deg);
}

@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;
}

/* Email Input Styles */
#paywall-email-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Stripe Button Styles */
#stripe-pay-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

#stripe-pay-btn:disabled:hover {
    transform: none !important;
    box-shadow: 0 4px 14px rgba(99, 91, 255, 0.3) !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; }
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* LANDING PAGE STYLES */
/* ═══════════════════════════════════════════════════════════════════════ */

.landing-page {
    /* Removed max-width to allow full-width header and footer */
    margin: 0;
    padding: 0;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    margin-bottom: 2rem;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.3rem;
    opacity: 0.95;
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1rem;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto;
}

/* State Selector */
.state-selector, .subject-selector {
    margin: 2rem auto;
    max-width: 1200px;
    padding: 0 2rem;
}

.state-selector h2, .subject-selector h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    text-align: center;
}

.state-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.state-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.state-card:hover:not(.disabled) {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.state-card.selected {
    border-color: var(--accent);
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.state-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* State flag container */
.state-flag {
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 2px solid #e2e8f0;
}

.state-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* State info section */
.state-info {
    padding: 1.25rem;
    text-align: left;
}

.state-card h3 {
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.state-population {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 0.75rem;
    display: block;
}

/* Availability badges */
.state-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.state-badge.available {
    background: #d1fae5;
    color: #065f46;
}

.state-badge.coming-soon {
    background: #fef3c7;
    color: #92400e;
}

.state-badge.future {
    background: #e0e7ff;
    color: #3730a3;
}

/* Subject Cards */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.subject-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.subject-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.subject-icon {
    font-size: 4.5rem;
    display: block;
    margin-bottom: 1rem;
}

.subject-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.subject-info {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.subject-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1rem;
}

.subject-cta {
    color: var(--accent);
    font-weight: 600;
}

/* Preview Section */
.preview-section {
    margin: 2rem auto 1rem;
    padding: 0 2rem;
    max-width: 1200px;
}

.preview-section h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .preview-grid {
        grid-template-columns: 1fr;
    }
}

.preview-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.preview-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.preview-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.preview-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Back Button */
.back-button {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    display: inline-block;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

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

/* Products Overview */
.products-overview {
    margin: 4rem 0;
}

.products-overview h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.product-icon {
    font-size: 1.5rem;
}

.product-state {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 12px;
}

.product-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.product-categories {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--afb1);
    margin-bottom: 0.5rem;
}

.product-cta {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* 404 PAGE STYLES */
/* ═══════════════════════════════════════════════════════════════════════ */

.error-page {
    max-width: 600px;
    margin: 4rem auto;
    padding: 0 1rem;
    text-align: center;
}

.error-content h1 {
    font-size: 6rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.error-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.error-content p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.error-suggestions {
    margin-top: 3rem;
    text-align: left;
}

.error-suggestions h3 {
    margin-bottom: 1rem;
}

.suggestions-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.suggestion-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.suggestion-card:hover {
    background: #f1f5f9;
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* TOAST NOTIFICATIONS */
/* ═══════════════════════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 350px;
}

.toast-visible {
    transform: translateX(0);
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast-icon {
    font-size: 1.2rem;
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 4px;
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* LOADING STATES */
/* ═══════════════════════════════════════════════════════════════════════ */

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-message {
    color: var(--text-muted);
    margin-top: 1rem;
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* UTILITY CLASSES */
/* ═══════════════════════════════════════════════════════════════════════ */

.btn-primary {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-weight: 600;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

.back-link {
    display: inline-block;
    color: rgba(255,255,255,0.95);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.back-link:hover {
    color: white;
    background: rgba(255,255,255,0.15);
    transform: translateX(-4px);
}

.test-badge {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 10px;
}

/* Empty state */
.empty-state {
    text-align: center !important;
    grid-column: 1 / -1;
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 100% !important;
    margin: 0 auto !important;
    width: 100% !important;
}

.empty-state p {
    margin: 0;
}

.no-subjects {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════ */
/* PAYMENT BUTTONS */
/* ═══════════════════════════════════════════════════════════════════════ */

.payment-buttons {
    margin: 1.5rem 0;
}

.pay-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.pay-btn:hover:not(:disabled) {
    border-color: var(--accent);
    background: #f8fafc;
}

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

.pay-btn-stripe {
    border-color: #635bff;
    background: linear-gradient(135deg, #635bff 0%, #8b5cf6 100%);
    color: white;
}

.pay-btn-stripe:hover:not(:disabled) {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-color: #4f46e5;
}

.pay-icon {
    font-size: 1.5rem;
}

.pay-text {
    display: flex;
    flex-direction: column;
}

.pay-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.pay-subtitle {
    font-size: 0.8rem;
    opacity: 0.8;
}

.pay-divider {
    text-align: center;
    color: var(--text-muted);
    margin: 1rem 0;
    font-size: 0.9rem;
}

#paypal-button-container {
    min-height: 45px;
}
