* {
    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;
}

/* Auth Container Styles */
.container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
    margin: 50px auto;
}

.logo-container {
    text-align: center;
    margin-bottom: 20px;
}

.logo {
    font-size: 3em;
    margin-bottom: 10px;
}

.tagline {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

h1 {
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

h2 {
    color: #555;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

label {
    color: #555;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: -10px;
}

input, textarea {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    resize: vertical;
}

button {
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

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

button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.secondary-button {
    background: #95a5a6;
}

.secondary-button:hover {
    background: #7f8c8d;
}

.primary-button {
    background: #667eea;
}

.primary-button:disabled {
    background: #2ecc71;
    cursor: default;
    transform: none;
    opacity: 0.85;
}

.hidden {
    display: none !important;
}

.error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

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

p {
    color: #666;
    margin-top: 15px;
}

.container p {
    text-align: center;
}

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

a:hover {
    text-decoration: underline;
}

/* Dashboard Styles */
.dashboard-container {
    min-height: 100vh;
    background: #f5f7fa;
}

.dashboard-header {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.logo-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-emoji {
    font-size: 1.8em;
}

.header-content h1 {
    margin: 0;
    font-size: 1.8em;
}

/* XP Display */
.xp-display {
    display: flex;
    align-items: center;
    gap: 15px;
}

.level-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 15px;
    border-radius: 10px;
    text-align: center;
    min-width: 80px;
}

.level-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    opacity: 0.9;
}

.level-number {
    display: block;
    font-size: 24px;
    font-weight: bold;
}

.xp-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.xp-bar-container {
    width: 200px;
    height: 12px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.xp-bar {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    transition: width 0.5s ease;
    border-radius: 10px;
}

.xp-text {
    font-size: 12px;
    color: #666;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.welcome-text {
    color: #555;
    font-size: 14px;
}

.icon-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    padding: 0;
    background: #f0f0f0;
}

.icon-button:hover {
    background: #667eea;
    transform: scale(1.1);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 40px;
}

.toggle-btn {
    padding: 15px 40px;
    font-size: 1.1em;
    border-radius: 10px;
    background: white;
    color: #666;
    transition: all 0.3s;
}

.toggle-btn:hover {
    background: #f0f0f0;
}

.toggle-btn.active {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

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

.welcome-section h2 {
    color: #333;
    font-size: 2em;
    margin-bottom: 10px;
}

.welcome-section p {
    color: #666;
    font-size: 1.1em;
}

/* Path Selection Cards */
.path-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.path-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.path-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.path-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.path-card h3 {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 20px;
}

.path-progress {
    margin-top: 20px;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    transition: width 0.5s ease;
    border-radius: 10px;
}

.progress-text {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

/* Path View */
.path-view {
    max-width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
}

.path-container {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.back-button {
    background: #95a5a6;
    padding: 10px 20px;
    font-size: 14px;
    margin-bottom: 30px;
}

.path-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.path-icon-large {
    font-size: 4em;
    margin-bottom: 15px;
}

.path-header h2 {
    color: #333;
    font-size: 2em;
    margin-bottom: 10px;
}

.path-subtitle {
    color: #666;
    font-size: 1em;
}

/* Horizontal Lesson Path with Rectangles */
.lesson-path {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 40px 20px;
    overflow-x: auto;
    overflow-y: visible;
}

/* Scrollbar styling */
.lesson-path::-webkit-scrollbar {
    height: 8px;
}

.lesson-path::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.lesson-path::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.lesson-path::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.lesson-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 25px;
    min-width: 250px;
    background: white;
    border-radius: 15px;
    transition: all 0.3s;
    flex-shrink: 0;
    border: 3px solid transparent;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Completed state - Green */
.lesson-node.completed {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
}

.lesson-node.completed .node-circle {
    background: #28a745;
    color: white;
}

/* Unlocked state - Yellow/Gold */
.lesson-node.unlocked {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-color: #f39c12;
    cursor: pointer;
}

.lesson-node.unlocked:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(243, 156, 18, 0.3);
}

.lesson-node.unlocked .node-circle {
    background: #f39c12;
    color: white;
}

/* Locked state - Gray */
.lesson-node.locked {
    background: #f8f9fa;
    border-color: #dee2e6;
    opacity: 0.5;
}

.lesson-node.locked .node-circle {
    background: #dee2e6;
    color: #6c757d;
}

.node-circle {
    width: 70px;
    height: 70px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.node-content {
    text-align: center;
    width: 100%;
}

.node-content h4 {
    color: #333;
    font-size: 1.2em;
    margin-bottom: 8px;
    font-weight: 600;
}

.node-content p {
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
    margin-bottom: 12px;
}

.xp-badge {
    display: inline-block;
    padding: 6px 14px;
    background: #667eea;
    color: white;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

/* Arrow Connectors */
.lesson-connector {
    width: 60px;
    height: 4px;
    background: #dee2e6;
    flex-shrink: 0;
    position: relative;
    border-radius: 2px;
}

.lesson-connector.completed {
    background: #28a745;
}

.lesson-connector::after {
    content: '→';
    position: absolute;
    right: -20px;
    top: -12px;
    font-size: 24px;
    color: #dee2e6;
}

.lesson-connector.completed::after {
    color: #28a745;
}

/* Lesson Viewer */
.lesson-viewer {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.lesson-container {
    background: white;
    padding: 50px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.lesson-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.lesson-topic-badge {
    display: inline-block;
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
}

.lesson-header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.lesson-subtitle {
    color: #666;
    font-size: 1.2em;
    font-style: italic;
}

.lesson-content {
    line-height: 1.8;
    color: #444;
}

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

.lesson-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.lesson-section p {
    text-align: left;
    margin-bottom: 15px;
    line-height: 1.8;
}

.lesson-section ul {
    margin-left: 30px;
    margin-bottom: 15px;
}

.lesson-section li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.lesson-example {
    background: #e8f4f8;
    padding: 25px;
    border-radius: 10px;
    margin: 30px 0;
    border-left: 4px solid #667eea;
}

.lesson-example h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.lesson-example p {
    text-align: left;
    margin-bottom: 10px;
    line-height: 1.8;
}

.lesson-tips {
    background: #fff9e6;
    padding: 25px;
    border-radius: 10px;
    margin: 30px 0;
    border-left: 4px solid #f39c12;
}

.lesson-tips h4 {
    color: #e67e22;
    margin-bottom: 15px;
}

.lesson-tips ul {
    margin-left: 30px;
}

.lesson-tips li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.lesson-footer {
    display: flex;
    gap: 15px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.lesson-footer button {
    flex: 1;
    padding: 15px;
}

/* Topics Grid (Practice View) */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* ===== DAILY GOAL BAR ===== */
.daily-goal-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea22 0%, #764ba222 100%);
    border: 2px solid #667eea44;
    border-radius: 14px;
    margin-bottom: 24px;
}
.dg-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.dg-flame { font-size: 1.8em; }
.dg-flame.done { animation: flamePulse 1s infinite; }
@keyframes flamePulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.2)} }
.dg-info strong { display: block; font-size: 0.95em; color: #333; }
.dg-info span { font-size: 0.82em; color: #888; }
.dg-progress-wrap { flex: 1; min-width: 80px; }
.dg-progress-bar { height: 10px; background: #e0e0e0; border-radius: 10px; overflow: hidden; }
.dg-progress-fill { height: 100%; background: linear-gradient(90deg, #667eea, #764ba2); border-radius: 10px; transition: width 0.6s ease; }

/* ===== PRACTICE ACTION CARDS ROW ===== */
.practice-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 30px;
}
@media (max-width: 600px) { .practice-action-row { grid-template-columns: 1fr; } }
.practice-action-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    border: none;
    font-family: inherit;
}
.practice-action-card:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}
.practice-action-card:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}
.quick-action { background: linear-gradient(135deg, #f6d365 0%, #fda085 100%); color: #5a3e1b; }
.retry-action { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); color: #3a4a5a; }
.pac-icon { font-size: 1.8em; flex-shrink: 0; }
.pac-text { flex: 1; }
.pac-text strong { font-size: 1em; display: block; margin-bottom: 2px; }
.pac-text span { font-size: 0.82em; opacity: 0.8; }
.pac-arrow { font-size: 1.3em; font-weight: bold; opacity: 0.4; }

/* ===== TOPIC CARDS WITH MASTERY RINGS ===== */
.topic-card {
    background: white;
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    border: 3px solid transparent;
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.topic-card.active {
    border-color: #667eea;
    background: #f0f4ff;
}

.topic-card-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 12px;
}
.topic-icon { font-size: 3em; }
.topic-card h3 { color: #333; margin-bottom: 10px; font-size: 1.4em; }
.topic-card p { color: #777; font-size: 14px; margin-bottom: 15px; }
.topic-stats { padding-top: 15px; border-top: 1px solid #eee; display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.stat { color: #888; font-size: 13px; }

/* Mastery Ring */
.mastery-ring {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}
.mastery-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mastery-bg { fill: none; stroke: #e8e8e8; stroke-width: 3; }
.mastery-fg {
    fill: none;
    stroke: #667eea;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 0.8s ease;
}
.mastery-pct {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.65em;
    font-weight: 800;
    color: #555;
}

/* Mastery color thresholds */
.mastery-ring.low .mastery-fg { stroke: #e74c3c; }
.mastery-ring.mid .mastery-fg { stroke: #f39c12; }
.mastery-ring.high .mastery-fg { stroke: #2ecc71; }
.mastery-ring.perfect .mastery-fg { stroke: #667eea; }

/* Practice View Headings */
.pv-heading {
    text-align: center;
    color: #333;
    margin-bottom: 16px;
    font-size: 1.25em;
}
.optional-tag {
    font-size: 0.55em;
    color: #aaa;
    font-weight: normal;
    display: block;
    margin-top: 2px;
}

/* Quick Practice (now uses .practice-action-row above) */

/* Subtopic Chips */
.subtopic-section { margin-bottom: 28px; }
.subtopic-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.subtopic-chip {
    padding: 8px 18px;
    border-radius: 20px;
    background: white;
    border: 2px solid #ddd;
    cursor: pointer;
    font-size: 0.88em;
    transition: all 0.2s;
    color: #555;
}
.subtopic-chip:hover:not(.locked) {
    border-color: #667eea;
    color: #667eea;
    background: #f5f7ff;
}
.subtopic-chip.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}
.subtopic-chip.locked {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f5f5f5;
}
.subtopic-chip .chip-lock { font-size: 0.75em; margin-left: 3px; }

/* Practice Settings Row */
.practice-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
    padding: 24px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
@media (max-width: 768px) {
    .practice-settings { grid-template-columns: 1fr; gap: 20px; }
}
.setting-group { text-align: center; }
.setting-label {
    display: block;
    font-weight: 700;
    color: #555;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Mode Buttons */
.mode-buttons { display: flex; gap: 10px; justify-content: center; }
.mode-button {
    background: white;
    padding: 14px 12px;
    border-radius: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
    flex: 1;
    max-width: 140px;
    border: 2px solid transparent;
}
.mode-button:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.mode-button.active { background: #667eea; color: white; border-color: #667eea; }
.mode-icon { font-size: 1.5em; }
.mode-label { font-size: 0.95em; font-weight: bold; }
.mode-desc { font-size: 11px; opacity: 0.7; }

/* Difficulty Buttons */
.difficulty-buttons { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.difficulty-btn {
    padding: 10px 18px;
    font-size: 0.95em;
    border-radius: 9px;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 90px;
    justify-content: center;
    border: 2px solid transparent;
}
.difficulty-btn.easy { background: #2ecc71; }
.difficulty-btn.easy:hover { background: #27ae60; }
.difficulty-btn.medium { background: #f39c12; }
.difficulty-btn.medium:hover { background: #e67e22; }
.difficulty-btn.hard { background: #e74c3c; }
.difficulty-btn.hard:hover { background: #c0392b; }
.difficulty-btn.active { transform: scale(1.08); box-shadow: 0 3px 10px rgba(0,0,0,0.25); border-color: rgba(255,255,255,0.6); }

/* Count Buttons */
.count-buttons { display: flex; gap: 8px; justify-content: center; }
.count-btn {
    padding: 10px 22px;
    font-size: 1.15em;
    font-weight: bold;
    border-radius: 9px;
    background: white;
    color: #555;
    cursor: pointer;
    border: 2px solid #ddd;
    transition: all 0.2s;
    min-width: 55px;
}
.count-btn:hover { border-color: #667eea; color: #667eea; }
.count-btn.active { background: #667eea; color: white; border-color: #667eea; }

/* Start Section */
.start-section { text-align: center; margin-top: 10px; margin-bottom: 40px; }
.start-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 18px 50px;
    font-size: 1.25em;
    border-radius: 50px;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}
.start-button:hover:not(:disabled) {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    transform: translateY(-3px);
}

/* --- Session Enhancements --- */

/* Streak Pill */
.session-streak {
    display: flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #ff9a56, #ff6b6b);
    padding: 6px 14px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    font-size: 0.95em;
    animation: streakPop 0.3s ease-out;
}
.streak-fire { font-size: 1.1em; }
@keyframes streakPop {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* XP Float Animation */
.xp-float {
    position: absolute;
    top: 70px;
    right: 40px;
    background: linear-gradient(135deg, #f6d365, #fda085);
    color: #5a3e1b;
    font-weight: bold;
    font-size: 1.05em;
    padding: 6px 16px;
    border-radius: 20px;
    pointer-events: none;
    z-index: 100;
}
.xp-float.animate {
    animation: xpUp 1.2s ease-out forwards;
}
@keyframes xpUp {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-50px); }
}

/* --- Summary Enhancements --- */
.streak-stat .summary-stat-value { color: #ff6b6b; }

.summary-review { margin-top: 20px; text-align: left; }
.review-heading {
    font-size: 0.95em;
    color: #999;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 600;
}
.summary-breakdown {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 340px;
    overflow-y: auto;
    margin-bottom: 20px;
}
.breakdown-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.9em;
}
.breakdown-item:hover { background: rgba(0,0,0,0.02); }
.breakdown-item.correct-item { background: #edf9ed; border-left: 4px solid #2ecc71; }
.breakdown-item.incorrect-item { background: #fef0f0; border-left: 4px solid #e74c3c; }
.breakdown-item.timeout-item { background: #fef9f0; border-left: 4px solid #f39c12; }
.breakdown-icon { font-size: 1.1em; flex-shrink: 0; margin-top: 2px; }
.breakdown-content { flex: 1; }
.breakdown-q { color: #333; line-height: 1.4; }
.breakdown-toggle {
    font-size: 0.78em;
    color: #667eea;
    margin-top: 3px;
    display: inline-block;
}
.breakdown-explain {
    margin-top: 8px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.04);
    border-radius: 8px;
    font-size: 0.9em;
    color: #555;
    line-height: 1.5;
    display: none;
}
.breakdown-item.open .breakdown-explain { display: block; }
.breakdown-item.open .breakdown-toggle { color: #999; }

/* Profile View */
.profile-view {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.profile-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.profile-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.profile-picture {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #667eea;
}

.profile-info {
    flex: 1;
}

.profile-info h3 {
    margin-bottom: 5px;
    color: #333;
}

.email-text {
    font-size: 14px;
    color: #999;
    text-align: left;
    margin-top: 5px;
}

.profile-stats {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-icon {
    font-size: 1.2em;
}

.stat-value {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

/* Badges Section */
.badges-section {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.badges-section h4 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
}

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

.badge-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s;
}

.badge-item.earned {
    border: 2px solid #2ecc71;
    cursor: pointer;
}

.badge-item.earned:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.badge-item.locked {
    opacity: 0.4;
    border: 2px solid #ddd;
}

.badge-icon {
    font-size: 2.5em;
    margin-bottom: 8px;
}

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

.badge-desc {
    font-size: 10px;
    color: #777;
}

.profile-bio {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.profile-bio h4 {
    color: #555;
    margin-bottom: 10px;
}

.profile-bio p {
    text-align: left;
    color: #555;
    line-height: 1.6;
    margin-top: 5px;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.button-group button {
    flex: 1;
}

/* Leaderboard View */
.leaderboard-view {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.leaderboard-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s;
}

.leaderboard-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.leaderboard-item.top-1 {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    font-weight: bold;
}

.leaderboard-item.top-2 {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
}

.leaderboard-item.top-3 {
    background: linear-gradient(135deg, #cd7f32, #e8a87c);
}

.rank {
    font-size: 1.5em;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 5px;
}

.user-stats {
    font-size: 0.9em;
    color: #666;
}

.user-badges {
    font-size: 1.1em;
    color: #666;
}

.loading-message {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Lesson Guided Practice */
.lesson-practice-block {
    margin: 35px 0;
    padding: 30px;
    background: #f8f0ff;
    border-radius: 14px;
    border: 2px solid #e0d0f0;
}

.lesson-practice-block.generated {
    background: #f0f7ff;
    border-color: #d0e0f8;
}

.practice-block-title {
    color: #6c3fa0;
    font-size: 1.3em;
    margin-bottom: 25px;
    text-align: center;
}

.lesson-practice-item {
    background: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 2px solid #eee;
    transition: border-color 0.3s;
}

.lesson-practice-item:last-child {
    margin-bottom: 0;
}

.lp-question-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.lp-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.3s;
}

.lp-number-correct {
    background: #2ecc71 !important;
}

.lp-number-incorrect {
    background: #e74c3c !important;
}

.lp-question {
    font-size: 1em;
    color: #333;
    line-height: 1.6;
    padding-top: 4px;
}

.lp-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.lp-choice {
    padding: 14px 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95em;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lp-choice:hover:not(.lp-disabled) {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-1px);
}

.lp-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #eee;
    color: #555;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.lp-choice.lp-correct {
    border-color: #2ecc71;
    background: #d4edda;
    color: #155724;
}

.lp-choice.lp-correct .lp-label {
    background: #2ecc71;
    color: white;
}

.lp-choice.lp-incorrect {
    border-color: #e74c3c;
    background: #f8d7da;
    color: #721c24;
}

.lp-choice.lp-incorrect .lp-label {
    background: #e74c3c;
    color: white;
}

.lp-choice.lp-disabled {
    cursor: default;
    opacity: 0.65;
    transform: none !important;
}

.lp-choice.lp-disabled.lp-correct {
    opacity: 1;
}

.lp-feedback {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.7;
    margin-top: 12px;
}

.lp-feedback-correct {
    background: #d4edda;
    border-left: 4px solid #2ecc71;
    color: #155724;
}

.lp-feedback-incorrect {
    background: #f8d7da;
    border-left: 4px solid #e74c3c;
    color: #721c24;
}

.lp-fb-icon {
    font-size: 1.1em;
    margin-right: 6px;
}

/* Lesson Practice Progress Bar */
.lesson-practice-bar {
    margin-top: 35px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea15, #764ba215);
    border-radius: 12px;
    border: 2px solid #667eea30;
}

.lpb-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.lpb-icon {
    font-size: 1.3em;
}

.lpb-text {
    flex: 1;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.lpb-counter {
    font-size: 14px;
    font-weight: 700;
    color: #667eea;
    background: white;
    padding: 4px 12px;
    border-radius: 20px;
}

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

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

/* Practice Session */
.practice-session {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px;
}

.practice-session-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.session-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 2px solid #f0f0f0;
    flex-wrap: wrap;
}

.session-info {
    display: flex;
    gap: 8px;
}

.session-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: #667eea;
    color: white;
}

.session-diff-badge.easy { background: #2ecc71; }
.session-diff-badge.medium { background: #f39c12; }
.session-diff-badge.hard { background: #e74c3c; }

.session-progress-section {
    flex: 1;
    min-width: 150px;
    max-width: 300px;
    text-align: center;
}

#session-progress-text {
    font-size: 13px;
    color: #666;
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
}

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

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

.session-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.session-score-display {
    font-size: 14px;
    color: #555;
}

.session-timer {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: white;
    border-radius: 10px;
    font-weight: 700;
    font-size: 16px;
    color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.session-timer.warning { color: #e67e22; }
.session-timer.danger { color: #e74c3c; animation: pulse 0.5s infinite alternate; }

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

.timer-icon { font-size: 18px; }

/* Problem Area */
.problem-area {
    padding: 40px 30px 30px;
}

.problem-question {
    font-size: 1.3em;
    color: #333;
    line-height: 1.7;
    margin-bottom: 30px;
    text-align: center;
    min-height: 60px;
}

.problem-question .math-expression {
    display: inline-block;
    background: #f0f4ff;
    padding: 12px 24px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    font-weight: 700;
    color: #333;
    margin: 10px 0;
    border: 2px solid #dce3ff;
}

.problem-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.choice-btn {
    padding: 18px 20px;
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.choice-btn:hover:not(.disabled) {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.choice-btn.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.choice-btn.correct {
    border-color: #2ecc71;
    background: #d4edda;
    color: #155724;
}

.choice-btn.incorrect {
    border-color: #e74c3c;
    background: #f8d7da;
    color: #721c24;
}

.choice-btn.disabled {
    cursor: default;
    opacity: 0.7;
}

.choice-btn.disabled.correct {
    opacity: 1;
}

.choice-label {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    border-radius: 50%;
    background: #e8e8e8;
    color: #555;
    font-size: 13px;
    font-weight: 700;
    margin-right: 10px;
    text-align: center;
    vertical-align: middle;
}

.choice-btn.selected .choice-label,
.choice-btn.correct .choice-label {
    background: rgba(255,255,255,0.3);
    color: inherit;
}

/* Feedback Area */
.feedback-area {
    padding: 0 30px 20px;
}

.feedback-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 12px;
}

.feedback-banner.correct {
    background: #d4edda;
    color: #155724;
}

.feedback-banner.incorrect {
    background: #f8d7da;
    color: #721c24;
}

.feedback-banner.timeout {
    background: #fff3cd;
    color: #856404;
}

.feedback-icon { font-size: 1.4em; }

.feedback-explanation {
    padding: 16px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.7;
    color: #555;
    border-left: 4px solid #667eea;
}

/* Session Actions */
.session-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-top: 2px solid #f0f0f0;
}

.next-btn {
    padding: 14px 30px;
    font-size: 1em;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

.next-btn:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.quit-btn {
    padding: 10px 20px;
    font-size: 14px;
    background: #f0f0f0;
    color: #888;
    border-radius: 8px;
}

.quit-btn:hover {
    background: #e74c3c;
    color: white;
    transform: translateY(-1px);
}

/* Session Summary */
.session-summary {
    max-width: 650px;
    margin: 0 auto;
    padding: 40px 20px;
}

.summary-container {
    background: white;
    padding: 50px 40px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
}

.summary-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

.summary-container h2 {
    color: #333;
    font-size: 2em;
    margin-bottom: 8px;
}

.summary-subtitle {
    color: #888;
    font-size: 1em;
    margin-bottom: 30px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.summary-stat {
    padding: 20px 10px;
    background: #f8f9fa;
    border-radius: 12px;
}

.summary-stat.xp-stat {
    background: linear-gradient(135deg, #667eea20, #764ba220);
}

.summary-stat-value {
    display: block;
    font-size: 1.8em;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.summary-stat.xp-stat .summary-stat-value {
    color: #667eea;
}

.summary-stat-label {
    display: block;
    font-size: 13px;
    color: #888;
    font-weight: 600;
}

.summary-breakdown {
    text-align: left;
    margin-bottom: 30px;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 14px;
}

.breakdown-item.correct-item { background: #d4edda; color: #155724; }
.breakdown-item.incorrect-item { background: #f8d7da; color: #721c24; }
.breakdown-item.timeout-item { background: #fff3cd; color: #856404; }

.breakdown-icon { font-size: 1.2em; flex-shrink: 0; }
.breakdown-text { flex: 1; }

.summary-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.summary-actions button {
    padding: 15px 35px;
    font-size: 1em;
    border-radius: 10px;
}
.retry-summary-btn {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%) !important;
    color: #3a4a5a !important;
    font-weight: 700;
    border: none;
}
.retry-summary-btn:hover { box-shadow: 0 4px 14px rgba(168,237,234,0.5); transform: translateY(-2px); }

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .xp-display {
        width: 100%;
    }

    .xp-bar-container {
        width: 100%;
    }

    .user-menu {
        width: 100%;
        justify-content: space-between;
    }

    .path-selection {
        grid-template-columns: 1fr;
    }

    .lesson-path {
        padding: 20px 10px;
        gap: 20px;
    }

    .lesson-node {
        min-width: 200px;
        padding: 25px 20px;
    }

    .node-circle {
        width: 60px;
        height: 60px;
        font-size: 1.6em;
    }

    .node-content h4 {
        font-size: 1.1em;
    }

    .lesson-connector {
        width: 40px;
    }

    .topics-grid {
        grid-template-columns: 1fr;
    }
    
    .mode-buttons {
        grid-template-columns: 1fr;
    }
    
    .difficulty-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .lesson-container {
        padding: 30px 20px;
    }

    .view-toggle {
        flex-direction: column;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-stats {
        justify-content: center;
        flex-wrap: wrap;
    }

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

    .lesson-footer {
        flex-direction: column;
    }

    .session-header {
        flex-direction: column;
        align-items: stretch;
    }

    .session-progress-section {
        max-width: 100%;
    }

    .session-header-right {
        justify-content: space-between;
    }

    .problem-choices {
        grid-template-columns: 1fr;
    }

    .lp-choices {
        grid-template-columns: 1fr;
    }

    .lp-question-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .lpb-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-actions {
        flex-direction: column;
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 16px 24px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: bottom 0.3s ease;
    font-weight: 600;
    min-width: 300px;
    text-align: center;
}

.toast.show {
    bottom: 30px;
}

.toast-success {
    border-left: 4px solid #2ecc71;
    color: #27ae60;
}

.toast-error {
    border-left: 4px solid #e74c3c;
    color: #c0392b;
}

.toast-info {
    border-left: 4px solid #3498db;
    color: #2980b9;
}