@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

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

body {
    background-color: #f3f4f6;
    color: #1f2937;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    background: #ffffff;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    position: relative;
    padding-bottom: 80px; /* space for sticky nav */
}

/* Header & Hero Image */
.app-header {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: #6366f1; /* fallback */
    position: relative;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.app-header-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.6));
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    display: flex;
    align-items: flex-end;
    padding: 20px;
}

.app-header-title {
    color: white;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.content-area {
    padding: 0 20px;
}

/* Back Button */
.header-row {
    margin-bottom: 15px;
    padding: 0 20px;
    margin-top: 20px;
}
.back-btn {
    display: inline-flex;
    align-items: center;
    color: #4f46e5;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    background: #eef2ff;
    padding: 8px 16px;
    border-radius: 20px;
    transition: 0.2s ease;
}
.back-btn:hover {
    background: #e0e7ff;
}

/* Titles */
.subtitle {
    font-size: 18px;
    font-weight: 700;
    margin: 10px 20px 20px 20px;
    color: #111827;
}

/* Cards */
.card-cat, .card-sub, .card-quiz {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #f3f4f6;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.card-cat:hover, .card-sub:hover, .card-quiz:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-cat.bg-dark { background: linear-gradient(135deg, #1f2937, #111827); color: white; border: none; }
.card-cat.bg-green { background: linear-gradient(135deg, #10b981, #059669); color: white; border: none; }
.card-cat.bg-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; border: none; }

.card-cat .info h3, .card-sub .info h3, .card-quiz .info h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.card-cat .info p, .card-sub .info p, .card-quiz .info p {
    font-size: 12px;
    opacity: 0.8;
}

.card-cat .icon-arrow, .card-sub .action, .card-quiz .action {
    font-weight: 700;
    font-size: 14px;
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 20px;
}

.card-sub .action, .card-quiz .action {
    background: #eef2ff;
    color: #4f46e5;
}
.card-cat .icon-arrow { color: white; }

/* Bottom Menu */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #9ca3af;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
}

.nav-item.active {
    color: #4f46e5;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    fill: currentColor;
}

/* Play Quiz Styles */
.play-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
}
.progress-pill {
    background: #f3f4f6;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
    color: #6b7280;
}
.quiz-question-card {
    background: white;
    padding: 30px 20px;
    border-radius: 16px;
    margin: 0 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    border: 1px solid #f3f4f6;
}
.quiz-question-card h2 {
    font-size: 20px;
    line-height: 1.4;
    color: #111827;
    margin-bottom: 25px;
    font-weight: 600;
}

.btn-option {
    display: block;
    width: 100%;
    text-align: left;
    background: white;
    border: 2px solid #e5e7eb;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-option:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}
.btn-option.correct {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}
.btn-option.wrong {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

#explanation {
    margin-top: 20px;
    padding: 15px;
    background: #eff6ff;
    border-radius: 12px;
    border-left: 4px solid #3b82f6;
    font-size: 14px;
    color: #1e3a8a;
    display: none;
    line-height: 1.5;
}
#explanation.show { display: block; }

.action-btn {
    display: block;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
    transition: 0.2s;
}
.action-btn.primary {
    background: #4f46e5;
    color: white;
}
.action-btn.primary:hover {
    background: #4338ca;
}

/* Report View */
.report-card {
    text-align: center;
    padding: 40px 20px;
}
.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(#10b981 0% 100%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.2);
}
.score-inner {
    width: 130px;
    height: 130px;
    background: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.score-inner h1 {
    font-size: 40px;
    color: #10b981;
    margin: 0;
}
.score-inner span {
    font-size: 12px;
    color: #6b7280;
    font-weight: 700;
}
.stats-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}
.stat-box {
    background: #f9fafb;
    padding: 15px;
    border-radius: 12px;
    width: 48%;
}
.stat-box h4 { font-size: 24px; margin-bottom: 5px; }
.stat-box p { font-size: 12px; color: #6b7280; font-weight: 600; }
.stat-box.green h4 { color: #10b981; }
.stat-box.red h4 { color: #ef4444; }

/* Admin Base */
.form-group { margin-bottom: 15px; }
label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 13px; color: #374151;}
.form-control { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; }
.btn-primary { background: #4f46e5; color: white; padding: 10px 20px; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; }
.btn-outline { background: white; color: #4f46e5; border: 2px solid #4f46e5; padding: 10px 20px; border-radius: 8px; font-weight: 600; cursor: pointer; display: block; width: 100%; text-align: center; }
