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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.navbar {
    background: white;
    padding: 15px 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.nav-brand {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: #333;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background 0.3s;
}

.nav-link:hover {
    background: #f0f0f0;
}

.nav-link.logout {
    background: #ff6b6b;
    color: white;
}

.nav-link.logout:hover {
    background: #ff5252;
}

.nav-user {
    font-weight: bold;
    color: #667eea;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 500px;
    width: 100%;
}

.login-title {
    color: #667eea;
    text-align: center;
    margin-bottom: 10px;
    font-size: 32px;
}

.login-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.login-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-large {
    padding: 15px 30px;
    font-size: 18px;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.error-message {
    background: #ff6b6b;
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.login-help {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    font-size: 14px;
}

.login-help code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.dashboard {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.welcome-section {
    text-align: center;
    margin-bottom: 30px;
}

.welcome-section h1 {
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 18px;
}

.earnbux-disclaimer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.earnbux-disclaimer p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
}

.earnbux-disclaimer strong {
    font-size: 18px;
}

.earnbux-disclaimer em {
    display: block;
    margin-top: 8px;
    font-style: italic;
    opacity: 0.95;
}

.review-module-alert {
    margin-bottom: 30px;
}

.review-module-card {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(67, 233, 123, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.review-module-card h2 {
    margin-bottom: 15px;
    font-size: 28px;
}

.review-module-card p {
    margin-bottom: 20px;
    font-size: 18px;
    opacity: 0.95;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
}

.stat-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 5px;
}

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

.badges-section {
    margin-bottom: 30px;
}

.badges-section h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.badge-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 3px solid #ffd93d;
}

.badge-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.badge-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.badge-desc {
    font-size: 12px;
    color: #666;
}

.modules-section h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.module-card {
    background: white;
    border: 3px solid;
    border-radius: 15px;
    padding: 20px;
    transition: transform 0.3s;
}

.module-card:hover {
    transform: translateY(-5px);
}

.module-math {
    border-color: #4ecdc4;
    background: linear-gradient(135deg, #4ecdc4 0%, #44a3a0 100%);
    color: white;
}

.module-science {
    border-color: #45b7d1;
    background: linear-gradient(135deg, #45b7d1 0%, #3a9ebd 100%);
    color: white;
}

.module-coding {
    border-color: #a78bfa;
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    color: white;
}

.module-physics {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.module-chemistry {
    border-color: #ec4899;
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    color: white;
}

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

.module-biology {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.module-reading {
    border-color: #ef4444;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.category-card {
    background: white;
    border: 3px solid;
    border-radius: 15px;
    padding: 25px;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.category-math {
    border-color: #4ecdc4;
}

.category-science {
    border-color: #45b7d1;
}

.category-coding {
    border-color: #a78bfa;
}

.category-physics {
    border-color: #f59e0b;
}

.category-chemistry {
    border-color: #ec4899;
}

.category-geography {
    border-color: #10b981;
}

.category-biology {
    border-color: #8b5cf6;
}

.category-reading {
    border-color: #ef4444;
}

.category-header h3 {
    color: #333;
    font-size: 22px;
    margin-bottom: 15px;
}

.category-progress {
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 14px;
    color: #666;
    text-align: center;
}

.category-footer {
    text-align: center;
}

.category-detail {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.category-header-section {
    margin-bottom: 30px;
}

.back-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    margin-bottom: 15px;
    font-weight: bold;
}

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

.category-header-section h1 {
    color: #667eea;
    margin-bottom: 10px;
}

.module-locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.module-completed .module-header h3::before {
    content: '✓ ';
    color: #10b981;
}

.module-status {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 15px;
    background: rgba(0,0,0,0.1);
}

.module-status.completed {
    background: #10b981;
    color: white;
}

.module-status.locked {
    background: #9ca3af;
    color: white;
}

.module-progress-mini {
    margin-top: 10px;
    font-size: 12px;
    opacity: 0.8;
    text-align: center;
}

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

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.module-header h3 {
    font-size: 20px;
}

.module-category {
    background: rgba(255,255,255,0.3);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    text-transform: uppercase;
}

.module-desc {
    margin-bottom: 15px;
    opacity: 0.95;
}

.module-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.difficulty {
    font-size: 14px;
    opacity: 0.9;
}

.module-page {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

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

.module-header-big h1 {
    color: #667eea;
    margin-bottom: 10px;
}

.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.question-box {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.question-text {
    color: #333;
    font-size: 24px;
    margin-bottom: 25px;
    text-align: center;
}

.question-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.option-btn {
    background: white;
    border: 3px solid #667eea;
    color: #667eea;
    padding: 15px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.option-btn:hover {
    background: #667eea;
    color: white;
    transform: translateX(10px);
}

.answer-input {
    width: 100%;
    padding: 15px;
    border: 3px solid #667eea;
    border-radius: 10px;
    font-size: 18px;
    margin-bottom: 10px;
}

.hint-btn {
    background: #ffd93d;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.hint-btn:hover {
    background: #ffc107;
    transform: scale(1.05);
}

.hint-area {
    margin-top: 15px;
}

.hint-box {
    background: #fff3cd;
    border-left: 4px solid #ffd93d;
    padding: 15px;
    border-radius: 8px;
    color: #856404;
}

.feedback-area {
    margin-top: 20px;
}

.feedback-box {
    padding: 30px;
    border-radius: 15px;
    text-align: center;
}

.feedback-correct {
    background: linear-gradient(135deg, #6bcf7f 0%, #4ecdc4 100%);
    color: white;
}

.feedback-incorrect {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: white;
}

.feedback-box h3 {
    font-size: 28px;
    margin-bottom: 15px;
}

.explanation {
    background: rgba(255,255,255,0.2);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: left;
}

.explanation h4 {
    margin-bottom: 10px;
}

.completed-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
}

.completed-box h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.review-stats {
    background: rgba(255, 255, 255, 0.2);
    padding: 25px;
    border-radius: 15px;
    margin: 25px 0;
}

.review-stats h3 {
    font-size: 22px;
    margin-bottom: 15px;
}

.score-big {
    font-size: 64px;
    font-weight: bold;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.earnbux-reward {
    font-size: 20px;
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 217, 61, 0.3);
    border-radius: 8px;
    font-weight: bold;
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.rewards-page {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.rewards-header {
    text-align: center;
    margin-bottom: 40px;
}

.rewards-header h1 {
    color: #667eea;
    margin-bottom: 10px;
}

.current-points {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    font-size: 24px;
}

.points-label {
    margin-right: 10px;
}

.points-value {
    font-weight: bold;
    font-size: 32px;
}

.rewards-list {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.reward-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-radius: 15px;
    border: 3px solid;
    transition: transform 0.3s;
}

.reward-unlocked {
    border-color: #6bcf7f;
    background: linear-gradient(135deg, #6bcf7f 0%, #4ecdc4 100%);
    color: white;
}

.reward-locked {
    border-color: #e0e0e0;
    background: #f8f9fa;
    color: #999;
}

.reward-card:hover {
    transform: translateX(10px);
}

.reward-points {
    background: rgba(255,255,255,0.3);
    padding: 15px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 18px;
    min-width: 120px;
    text-align: center;
}

.reward-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.reward-icon {
    font-size: 40px;
}

.reward-name {
    font-size: 20px;
    font-weight: bold;
    flex: 1;
}

.reward-status {
    font-size: 14px;
    opacity: 0.9;
}

.reward-status.unlocked {
    background: rgba(255,255,255,0.3);
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: bold;
}

.rewards-footer {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
}

.rewards-footer h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.rewards-footer p {
    color: #666;
    margin-bottom: 20px;
}

.reward-settings-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.reward-settings-section h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.reward-settings-form {
    max-width: 600px;
}

.reward-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reward-input-group .form-input {
    flex: 0 0 150px;
}

.input-suffix {
    font-weight: bold;
    color: #667eea;
}

.help-text {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.help-text-small {
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

.info-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 15px;
}

.info-banner a {
    color: white;
    text-decoration: underline;
    font-weight: bold;
}

.info-banner a:hover {
    opacity: 0.9;
}

/* Chart Sections */
.chart-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.chart-section h2 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 28px;
}

.chart-container {
    position: relative;
    height: 350px;
    max-width: 900px;
    margin: 0 auto;
}

/* Parent Charts Section */
.parent-charts-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.parent-charts-section h2 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 28px;
}

.children-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.child-chart-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.review-stats-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.review-stats-section h2 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 28px;
}

.review-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.review-stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.review-stat-card h3 {
    font-size: 22px;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 10px;
}

.review-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.review-metric {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.metric-value {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

.metric-label {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
}

.recent-scores {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.15);
    padding: 15px;
    border-radius: 10px;
}

.recent-scores p {
    margin: 0 0 10px 0;
    font-size: 14px;
}

.scores-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.score-badge {
    background: rgba(255, 255, 255, 0.3);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

.no-reviews {
    text-align: center;
    opacity: 0.8;
    font-style: italic;
    padding: 20px;
}

.child-chart-card h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 22px;
    text-align: center;
}

.child-earnbux {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #333;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    display: inline-block;
    margin-left: 10px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    white-space: nowrap;
}

.review-stat-card .child-earnbux {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    font-size: 15px;
    padding: 5px 12px;
}

.child-chart-card .chart-container {
    height: 300px;
}

.no-children-message {
    text-align: center;
    font-size: 18px;
    color: #666;
    padding: 40px;
    background: #f5f7fa;
    border-radius: 10px;
}

.no-children-message a {
    color: #667eea;
    font-weight: bold;
    text-decoration: none;
}

.no-children-message a:hover {
    text-decoration: underline;
}

/* Review History Table Styles */
.review-history-table {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
}

.review-history-table h4 {
    font-size: 18px;
    margin-bottom: 15px;
    color: white;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.review-results-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    overflow: hidden;
}

.review-results-table thead {
    background: rgba(0, 0, 0, 0.2);
}

.review-results-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: white;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.review-results-table td {
    padding: 12px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 15px;
}

.review-results-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
}

.score-cell {
    font-weight: 600;
    text-align: center;
}

.score-high {
    color: #4ade80;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.score-medium {
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.score-low {
    color: #fca5a5;
    text-shadow: 0 0 10px rgba(252, 165, 165, 0.5);
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        flex-direction: column;
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .modules-grid {
        grid-template-columns: 1fr;
    }
    
    .reward-card {
        flex-direction: column;
        text-align: center;
    }
    
    .children-charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .child-chart-card .chart-container {
        height: 250px;
    }
}
