:root {
  /* Colors - Gamified SaaS Aesthetic */
  --primary: #6366f1; /* Indigo */
  --primary-light: #818cf8;
  --secondary: #f43f5e; /* Rose/Pink */
  --accent: #10b981; /* Emerald */
  --warning: #f59e0b; /* Amber */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 4rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.025em;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* Layout */
.app-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-md);
}

/* Nav Bar */
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: white;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  display: flex;
  gap: var(--space-md);
}

.nav-link {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

/* Onboarding Specific */
.onboarding-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, #eef2ff 0%, #ffffff 100%);
  padding: var(--space-md);
}

.onboarding-card {
  background: white;
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 100%;
  text-align: center;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.progress-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: var(--space-lg);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-color);
}

.dot.active {
  background: var(--primary);
  width: 24px;
  border-radius: 4px;
}

/* Forms */
.form-group {
  text-align: left;
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--text-main);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-block {
  width: 100%;
}

/* Choice Chips */
.chip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.chip {
  padding: var(--space-sm);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  border-color: var(--primary-light);
  background: #f5f3ff;
}

.chip.selected {
  border-color: var(--primary);
  background: #eef2ff;
  color: var(--primary);
}

/* Home Components */
.welcome-hero {
  padding: var(--space-xl) 0;
  text-align: center;
}

.welcome-hero h1 {
  font-size: 3rem;
  margin-bottom: var(--space-sm);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.course-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.course-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-light);
}

.course-thumb {
  height: 160px;
  background: #f1f5f9;
  position: relative;
}

.course-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
}

.course-info {
  padding: var(--space-md);
}

.course-title {
  font-size: 1.1rem;
  margin-bottom: var(--space-xs);
}

.course-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.progress-bar-container {
  height: 8px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
}

/* Dash Bar Section */
.dash-bar {
  background: white;
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-lg);
  border: 1px solid var(--border-color);
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 48px;
  height: 48px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
}

/* Info Board Page */
.info-board-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.info-board-hero {
  height: 50vh;
  background: var(--primary);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--space-xl);
}

.info-board-hero h1 {
  font-size: 3.5rem;
  margin-bottom: var(--space-md);
}

/* Placeholders */
.placeholder-icon {
  width: 24px;
  height: 24px;
  color: currentColor;
}

.placeholder-avatar {
  width: 40px;
  height: 40px;
  background: #e2e8f0;
  border-radius: 50%;
}

.placeholder-image {
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #f1f5f9, #e2e8f0);
}

/* Animation Utilities */
.float {
  animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

@keyframes grow { from { width: 0%; } to { width: 75%; } }

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(99, 102, 241, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

@keyframes typeIn {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

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

/* Component Styles */
.video-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.video-player {
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.video-placeholder-ui {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: linear-gradient(0deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
}

.video-card {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    margin-bottom: var(--space-sm);
    border: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.video-card:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

.video-card-thumb {
    width: 100px;
    height: 60px;
    background: #e2e8f0;
    border-radius: 4px;
    flex-shrink: 0;
}

.flashcard-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.flashcard {
    perspective: 1000px;
    height: 150px;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
}

.flashcard:hover .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    text-align: center;
    border-radius: var(--radius-md);
    font-weight: 600;
}

.flashcard-front {
    background: white;
    color: var(--text-main);
}

.flashcard-back {
    background: var(--primary);
    color: white;
    transform: rotateY(180deg);
}

.quiz-container {
    max-width: 700px;
    margin: var(--space-xl) auto;
    padding: var(--space-lg);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.quiz-option {
    padding: var(--space-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.quiz-option:hover {
    border-color: var(--primary-light);
    background: #f8fafc;
}

.quiz-option.correct {
    border-color: var(--accent);
    background: #ecfdf5;
    color: #065f46;
}

.quiz-option.wrong {
    border-color: var(--secondary);
    background: #fff1f2;
    color: #9f1239;
    animation: shake 0.4s;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.lives {
    display: flex;
    gap: 4px;
}

.heart {
    color: var(--secondary);
}

.celebration-bg {
    position: fixed;
    inset: 0;
    background: #ecfdf5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 2000;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary);
    animation: fall 3s linear infinite;
}

.chat-container {
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: var(--space-md);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    background: #f8fafc;
}

.message {
    max-width: 80%;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    line-height: 1.4;
}

.message-bot {
    align-self: flex-start;
    background: white;
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.message-user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-input-area {
    padding: var(--space-md);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

/* AI Bot */
.ai-bot-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  z-index: 1000;
  transition: transform 0.2s;
}

.ai-bot-bubble:hover {
  transform: scale(1.1);
}
