/* Amadeus Coaching Board — Duolingo Style UI v2 */
:root {
  --green: #58cc02;
  --green-dark: #46a302;
  --blue: #1cb0f6;
  --blue-dark: #0a90d4;
  --purple: #a560e8;
  --purple-dark: #8a4fd0;
  --orange: #ff9600;
  --red: #ff4b4b;
  --yellow: #ffc800;
  --teal: #00b3a4;
  --bg: #f7f7f7;
  --card: #ffffff;
  --text: #3c3c3c;
  --text-light: #777777;
  --border: #e5e5e5;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Nunito', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; -webkit-font-smoothing: antialiased; }
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; }

/* Login */
.login-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-logo { font-size: 64px; margin-bottom: 8px; }
.login-title { font-size: 28px; font-weight: 900; margin-bottom: 4px; }
.login-subtitle { font-size: 16px; color: var(--text-light); margin-bottom: 32px; }
.login-card { background: var(--card); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 360px; box-shadow: var(--shadow); }
.input-group { margin-bottom: 16px; }
.input-group label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; color: var(--text-light); }
.input-group input, .input-group textarea, .input-group select {
  width: 100%; padding: 14px 16px; border: 2px solid var(--border); border-radius: 12px; font-size: 16px; font-family: inherit; transition: border-color 0.2s;
}
.input-group input:focus, .input-group textarea:focus, .input-group select:focus { outline: none; border-color: var(--blue); }
.btn { width: 100%; padding: 16px; border: none; border-radius: 12px; font-size: 16px; font-weight: 800; font-family: inherit; cursor: pointer; transition: transform 0.1s, filter 0.2s; text-transform: uppercase; letter-spacing: 0.5px; }
.btn:active { transform: translateY(2px); }
.btn-primary { background: var(--green); color: white; box-shadow: 0 4px 0 var(--green-dark); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-blue { background: var(--blue); color: white; box-shadow: 0 4px 0 var(--blue-dark); }
.btn-purple { background: var(--purple); color: white; box-shadow: 0 4px 0 var(--purple-dark); }
.btn-outline { background: white; color: var(--blue); border: 2px solid var(--blue); box-shadow: none; }
.login-error { color: var(--red); font-size: 14px; margin-top: 12px; text-align: center; }
.login-hint { font-size: 13px; color: var(--text-light); margin-top: 16px; text-align: center; }

/* Header */
.header { background: var(--card); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.header-user { display: flex; align-items: center; gap: 8px; }
.header-avatar { font-size: 28px; }
.header-name { font-weight: 800; font-size: 16px; }
.header-level { font-size: 13px; color: var(--text-light); }
.header-streak { display: flex; align-items: center; gap: 4px; font-weight: 800; font-size: 18px; color: var(--orange); }
.header-xp { display: flex; align-items: center; gap: 4px; font-weight: 800; font-size: 18px; color: var(--blue); }
.header-logout { background: none; border: none; font-size: 20px; cursor: pointer; padding: 4px; }

/* Tabs */
.tabs { display: flex; background: var(--card); position: sticky; top: 60px; z-index: 99; border-bottom: 1px solid var(--border); }
.tab { flex: 1; padding: 14px 8px; text-align: center; font-weight: 800; font-size: 13px; cursor: pointer; border-bottom: 3px solid transparent; transition: all 0.2s; }
.tab.active { border-bottom-color: var(--green); color: var(--green); }
.tab:hover { background: #f0f0f0; }

/* Dashboard */
.dashboard { padding: 16px; }

/* Level Card */
.level-card { background: var(--card); border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow); margin-bottom: 16px; }
.level-emoji { font-size: 48px; margin-bottom: 8px; }
.level-name { font-size: 22px; font-weight: 900; }
.level-num { font-size: 14px; color: var(--text-light); margin-bottom: 12px; }
.level-bar-bg { background: var(--border); border-radius: 12px; height: 16px; overflow: hidden; margin: 8px 0; }
.level-bar-fill { background: var(--green); height: 100%; border-radius: 12px; transition: width 0.5s ease; }
.level-xp-text { font-size: 13px; color: var(--text-light); }

/* Stats */
.stats-row { display: flex; gap: 12px; margin-bottom: 16px; }
.stat-card { flex: 1; background: var(--card); border-radius: var(--radius); padding: 16px; text-align: center; box-shadow: var(--shadow); }
.stat-icon { font-size: 28px; margin-bottom: 4px; }
.stat-value { font-size: 24px; font-weight: 900; }
.stat-label { font-size: 12px; color: var(--text-light); }
.stat-streak .stat-value { color: var(--orange); }
.stat-xp .stat-value { color: var(--blue); }
.stat-quests .stat-value { color: var(--green); }

/* Quest Card */
.quest-card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.quest-cat-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 8px; font-size: 12px; font-weight: 800; color: white; margin-bottom: 12px; }
.quest-title { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.quest-meta { font-size: 14px; color: var(--text-light); margin-bottom: 16px; }
.quest-video { width: 100%; aspect-ratio: 16/9; border-radius: 12px; border: none; margin-bottom: 16px; }
.quest-xp { display: inline-flex; align-items: center; gap: 4px; background: #e8f5e9; color: var(--green-dark); padding: 6px 12px; border-radius: 8px; font-weight: 800; font-size: 14px; margin-bottom: 16px; }
.quest-done-btn { width: 100%; padding: 18px; background: var(--green); color: white; border: none; border-radius: 14px; font-size: 18px; font-weight: 900; font-family: inherit; cursor: pointer; box-shadow: 0 4px 0 var(--green-dark); transition: transform 0.1s; text-transform: uppercase; letter-spacing: 0.5px; }
.quest-done-btn:active { transform: translateY(2px); }
.quest-done-btn:disabled { background: #ccc; box-shadow: 0 4px 0 #aaa; cursor: default; }
.quest-completed { text-align: center; padding: 24px; background: #e8f5e9; border-radius: 14px; font-size: 18px; font-weight: 800; color: var(--green-dark); }

/* Feedback */
.feedback-form { margin-top: 16px; }
.feedback-form label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; color: var(--text-light); }
.pain-scale { display: flex; gap: 8px; margin-bottom: 12px; }
.pain-btn { flex: 1; padding: 10px; border: 2px solid var(--border); border-radius: 10px; background: white; font-size: 20px; cursor: pointer; font-family: inherit; transition: all 0.2s; }
.pain-btn.selected { border-color: var(--blue); background: #e3f2fd; }
.pain-btn:hover { border-color: var(--blue); }
.feedback-notes { width: 100%; padding: 12px; border: 2px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; resize: vertical; min-height: 60px; margin-bottom: 12px; }
.feedback-notes:focus { outline: none; border-color: var(--blue); }

/* Onboarding */
.onboarding { padding: 16px; }
.onboarding-title { font-size: 24px; font-weight: 900; text-align: center; margin-bottom: 8px; }
.onboarding-subtitle { font-size: 16px; color: var(--text-light); text-align: center; margin-bottom: 24px; }
.category-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
.category-card { background: var(--card); border-radius: 14px; padding: 16px; text-align: center; cursor: pointer; border: 3px solid transparent; transition: all 0.2s; box-shadow: var(--shadow); }
.category-card.selected { border-color: var(--green); background: #f0f9e8; }
.category-card:hover { transform: translateY(-2px); }
.category-emoji { font-size: 36px; margin-bottom: 8px; }
.category-name { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.category-desc { font-size: 11px; color: var(--text-light); }

/* Goals Input */
.goals-section { margin-bottom: 24px; }
.goals-section h3 { font-size: 18px; font-weight: 800; margin-bottom: 12px; }
.goal-input-row { display: flex; gap: 8px; margin-bottom: 8px; }
.goal-input-row select { padding: 12px; border: 2px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; }
.goal-input-row input { flex: 1; padding: 12px; border: 2px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; }
.goal-input-row input:focus, .goal-input-row select:focus { outline: none; border-color: var(--blue); }
.goal-list { margin-top: 12px; }
.goal-item { background: var(--card); border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow); }
.goal-item-emoji { font-size: 20px; }
.goal-item-text { flex: 1; font-size: 14px; }
.goal-item-cat { font-size: 11px; color: var(--text-light); }

/* Badges */
.badges-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.badge { background: var(--card); border-radius: 12px; padding: 12px; text-align: center; box-shadow: var(--shadow); transition: transform 0.2s; }
.badge.earned { border: 2px solid var(--yellow); }
.badge.locked { opacity: 0.4; filter: grayscale(1); }
.badge-emoji { font-size: 32px; margin-bottom: 4px; }
.badge-name { font-size: 11px; font-weight: 700; }
.badge-desc { font-size: 10px; color: var(--text-light); }

/* Leaderboard */
.lb-row { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; box-shadow: var(--shadow); }
.lb-rank { font-size: 20px; font-weight: 900; width: 28px; text-align: center; }
.lb-rank-1 { color: var(--yellow); }
.lb-rank-2 { color: #aaa; }
.lb-rank-3 { color: #cd7f32; }
.lb-avatar { font-size: 24px; }
.lb-name { flex: 1; font-weight: 700; }
.lb-xp { font-weight: 900; color: var(--blue); }
.lb-cats { font-size: 11px; color: var(--text-light); }

/* XP List */
.xp-list { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.xp-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.xp-row:last-child { border-bottom: none; }
.xp-reason { font-size: 14px; }
.xp-amount { font-weight: 800; color: var(--green); }
.xp-time { font-size: 12px; color: var(--text-light); }

/* Celebration */
.celebration { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; animation: fadeIn 0.3s; }
.celebration-card { background: var(--card); border-radius: 24px; padding: 32px; text-align: center; max-width: 360px; width: 90%; animation: bounceIn 0.5s; }
.celebration-emoji { font-size: 64px; margin-bottom: 12px; }
.celebration-title { font-size: 24px; font-weight: 900; margin-bottom: 8px; }
.celebration-xp { font-size: 32px; font-weight: 900; color: var(--green); margin-bottom: 8px; }
.celebration-bonus { font-size: 16px; color: var(--orange); margin-bottom: 16px; }
.celebration-streak { font-size: 18px; font-weight: 800; color: var(--orange); margin-bottom: 16px; }
.celebration-btn { padding: 14px 32px; background: var(--green); color: white; border: none; border-radius: 12px; font-size: 16px; font-weight: 800; font-family: inherit; cursor: pointer; box-shadow: 0 4px 0 var(--green-dark); }
.level-up-card { border: 3px solid var(--yellow); }
.level-up-emoji { font-size: 72px; margin-bottom: 8px; animation: spin 1s; }

/* Custom Quest */
.custom-quest-card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.custom-quest-card h3 { font-size: 18px; font-weight: 800; margin-bottom: 12px; }
.custom-quest-row { display: flex; gap: 8px; margin-bottom: 8px; }
.custom-quest-row select { padding: 12px; border: 2px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; }
.custom-quest-row input { flex: 1; padding: 12px; border: 2px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; }
.custom-quest-row input:focus, .custom-quest-row select:focus { outline: none; border-color: var(--purple); }

/* Profile */
.profile-card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.profile-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.profile-cat-tag { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 700; color: white; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes bounceIn { 0% { transform: scale(0.3); } 50% { transform: scale(1.05); } 70% { transform: scale(0.95); } 100% { transform: scale(1); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

@media (max-width: 360px) {
  .badges-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row { flex-direction: column; }
  .category-grid { grid-template-columns: 1fr; }
}