:root {
    --primary-color: #0891b2;
    --primary-dark: #0e7490; --primary-light: #67e8f9;
    --secondary-color: #f97316; --secondary-dark: #ea580c;
    --text-primary: #1e293b; --text-secondary: #475569; --text-light: #6b7280; --text-dark: #1e293b;
    --bg-card: #ffffff; --bg-light: #f1f5f9;
    --white: #ffffff;
    --success-color: #10b981; --error-color: #ef4444; 
    --border-color: #e2e8f0;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.08); --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}
* { margin: 0; padding: 0; box-sizing: border-box;
}
body {
    font-family: 'Noto Sans Sinhala', 'Poppins', sans-serif;
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    min-height: 100vh;
    color: var(--text-dark);
}
.login-wrapper {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
    padding: 20px; z-index: 100;
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    transition: opacity 0.5s ease-out;
}
.login-container {
    width: 100%;
    max-width: 420px; background: var(--white); border-radius: 20px;
    box-shadow: var(--shadow); overflow: hidden; animation: fadeIn 0.5s ease-out; min-height: 500px;
}
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95);
} to { opacity: 1; transform: scale(1); } }
.login-header {
    background: var(--primary-dark);
    padding: 25px; text-align: center; color: var(--white);
}
.login-header h1 { font-size: 1.5rem;
font-weight: 700; margin-bottom: 5px; }
.login-header p { font-size: 0.9rem; opacity: 0.9;
}
.auth-form, .greeting-container { padding: 30px;
}
.input-group { margin-bottom: 20px;
}
.input-group label { display: block; font-weight: 500; margin-bottom: 8px; font-size: 0.9rem;
}
.input-field {
    width: 100%;
    padding: 12px 15px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 1rem;
    font-family: 'Poppins', 'Noto Sans Sinhala', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-field:focus { outline: none; border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.2); }
.login-button {
    width: 100%;
    padding: 14px; border: none; border-radius: 10px; background: var(--primary-color);
    color: var(--white); font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}
.login-button:hover { background: var(--primary-dark); transform: translateY(-2px);
}
.login-footer { text-align: center; padding: 20px; background-color: var(--bg-light); border-top: 1px solid #e5e7eb;
}
.login-footer p { font-size: 0.85rem; color: var(--text-light);
}
.error-message { color: var(--error-color); font-size: 0.875rem; margin-top: 10px; text-align: center; min-height: 20px;
}
.greeting-container {
    display: none;
    flex-direction: column; align-items: center; justify-content: center;
    text-align: center; height: 280px;
}
#greeting-text { font-size: 1.8rem; font-weight: 700; color: var(--primary-dark); margin-bottom: 10px;
}
#greeting-name { font-size: 1.2rem; color: var(--text-light); margin-bottom: 30px;
}
.loader {
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary-dark); border-radius: 50%;
    width: 40px; height: 40px; animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg);
} }
/* Dashboard styles remain the same */
.main-content-wrapper { padding: 20px;
}
.container { max-width: 1200px; margin: 0 auto;
}
.header { background: white; border-radius: 20px; padding: 30px; margin-bottom: 30px; box-shadow: var(--shadow-lg);
position: relative; overflow: hidden; }
.header-welcome-message { font-size: 1rem; font-weight: 500; color: var(--primary-dark);
margin-bottom: 10px; }
.header::before { content: ''; position: absolute; top: 0; left: 0;
right: 0; height: 5px; background: linear-gradient(90deg, var(--primary-light), var(--primary-dark), var(--secondary-color)); }
.header h1 { font-size: 36px;
font-weight: 800; color: var(--primary-dark); margin-bottom: 10px; }
.header p { color: var(--text-secondary);
font-size: 18px; }
.stats-bar, .settings-panel, .achievements, .chart-section { background: white; border-radius: 15px;
padding: 20px; margin-bottom: 30px; box-shadow: var(--shadow-md); }
.stats-bar { display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.stat-item { text-align: center; padding: 15px;
border-radius: 10px; background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); }
.stat-value { font-size: 28px;
font-weight: bold; color: var(--primary-dark); }
.stat-label { font-size: 14px; color: var(--text-secondary); margin-top: 5px;
}
.settings-title, .features-title, .chart-title { font-weight: 700; margin-bottom: 15px; color: var(--text-primary); font-size: 24px;
}
.chart-container { position: relative; height: 350px;
}
.setting-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0;
border-bottom: 1px solid var(--border-color); }
.setting-item:last-child { border-bottom: none;
}
.btn { padding: 6px 16px; border-radius: 8px; border: none; font-weight: 600;
font-size: 14px; cursor: pointer; transition: all 0.3s; }
.btn-reset { background-color: #fee2e2;
color: #b91c1c; } .btn-reset:hover { background-color: #fecaca; }
.btn-logout { background-color: #e0f2fe;
color: #075985; } .btn-logout:hover { background-color: #bae6fd; }
.section-title { font-size: 28px;
font-weight: 700; color: white; text-align: center; margin-top: 40px; margin-bottom: 25px; text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.lessons-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 25px; margin-bottom: 30px;
}
.lesson-card-link { text-decoration: none;
}
.lesson-card { background: white; border-radius: 15px; overflow: hidden; box-shadow: var(--shadow-md);
transition: all 0.3s ease; position: relative; height: 100%; }
.lesson-card:hover { transform: translateY(-5px);
box-shadow: var(--shadow-lg); }
.lesson-card-header { padding: 20px; color: white; position: relative;
background: linear-gradient(135deg, var(--card-theme-color, #0ea5e9) 0%, var(--card-theme-dark, #0284c7) 100%); }
.lesson-number, .card-icon { position: absolute;
right: 20px; top: 20px; font-size: 48px; opacity: 0.2; font-weight: 800;
}
.card-icon { font-size: 36px;
}
.lesson-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; position: relative; z-index: 1;
color: white; }
.lesson-description { font-size: 14px; opacity: 0.95; position: relative; z-index: 1;
color: white; }
.lesson-card-body { padding: 20px; color: var(--text-primary);
}
.star-rating { display: flex; gap: 5px; margin-bottom: 15px; font-size: 22px;
}
.star { color: #ddd; } .star.filled { color: #fbbf24;
}
.progress-section { margin-bottom: 15px;
}
.progress-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-secondary); margin-bottom: 8px;
}
.progress-bar-container { height: 10px; background: #f0f0f0; border-radius: 5px; overflow: hidden;
}
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--card-theme-color), var(--card-theme-dark)); border-radius: 5px;
transition: width 0.5s ease; }
.paper-score-display { margin-top: 15px; padding-top: 15px;
border-top: 1px solid var(--border-color); text-align: center; }
.paper-score-display .score-label { font-weight: 500;
color: var(--text-secondary); font-size: 0.9rem; }
.paper-score-display .score-value { font-weight: 700; color: var(--secondary-dark);
font-size: 1.2rem; margin-left: 8px; }
#revision-checklist ul { list-style: none; padding: 0;
text-align: left; }
#revision-checklist li { display: flex; align-items: center; margin-bottom: 8px;
}
#revision-checklist svg { width: 20px; height: 20px; margin-right: 8px;
}
.theme-cyan { --card-theme-color: #22d3ee; --card-theme-dark: #0891b2; } .theme-orange { --card-theme-color: #fb923c;
--card-theme-dark: #f97316; }
.theme-pink { --card-theme-color: #f472b6; --card-theme-dark: #db2777;
} .theme-amber { --card-theme-color: #fcd34d; --card-theme-dark: #ca8a04; }
.theme-violet { --card-theme-color: #a78bfa;
--card-theme-dark: #7c3aed; }
.theme-paper { --card-theme-color: #f59e0b; --card-theme-dark: #d97706;
}
.theme-green { --card-theme-color: #34d399; --card-theme-dark: #059669;
}
.achievements { margin-top: 30px;
}
.achievement-badges { display: flex; gap: 15px; flex-wrap: wrap; margin-top: 15px;
}
.badge { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center;
justify-content: center; font-size: 24px; position: relative; cursor: pointer; transition: all 0.3s ease;
}
.badge::after { content: attr(data-tooltip); position: absolute; bottom: -35px; left: 50%; transform: translateX(-50%);
background: var(--text-primary); color: white; padding: 5px 10px; border-radius: 5px; font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.3s;
z-index: 10; }
.badge:hover::after { opacity: 1;
}
.badge.earned { background: linear-gradient(135deg, #fbbf24, #f59e0b);
box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3); transform: scale(1.1);
}
.badge.locked { background: #e5e5e5; color: #a1a1aa; opacity: 0.7;
}
.level-up-tiers { background: white; border-radius: 15px; padding: 20px; margin-top: 30px; box-shadow: var(--shadow-md);
}
.level-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin-top: 15px;
}
.level-card { padding: 20px 15px; border-radius: 12px; color: white; text-align: center;
box-shadow: 0 4px 10px rgba(0,0,0,0.1); transition: transform 0.3s ease; }
.level-card:hover { transform: translateY(-5px);
}
.level-card-stars { font-size: 1.2rem; margin-bottom: 8px; text-shadow: 0 1px 2px rgba(0,0,0,0.2);
letter-spacing: 2px; }
.level-card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px;
}
.level-card-count { font-size: 1.8rem; font-weight: 800; background-color: rgba(0,0,0,0.15); border-radius: 8px;
padding: 2px 8px; display: inline-block; }
.gradient-genius { background-image: linear-gradient(135deg, #fca5a5, #ef4444);
}
.gradient-expert { background-image: linear-gradient(135deg, #c084fc, #f472b6);
}
.gradient-scholar { background-image: linear-gradient(135deg, #60a5fa, #38bdf8);
}
.gradient-learner { background-image: linear-gradient(135deg, #4ade80, #22c55e);
}
.gradient-beginner { background-image: linear-gradient(135deg, #9ca3af, #6b7280);
}
@media (max-width: 768px) { .header h1 { font-size: 28px;
} .lessons-grid { grid-template-columns: 1fr; } .stats-bar { grid-template-columns: repeat(2, 1fr);
} }