/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', 'Noto Sans Tamil', sans-serif;
  background: #0a0e1a;
  color: #e2e8f0;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; font-family: inherit; }
select { font-family: inherit; }

/* ===== VARIABLES ===== */
:root {
  --primary: #6c63ff;
  --primary-light: #8b83ff;
  --accent: #00d4aa;
  --accent-light: #33e0be;
  --bg-dark: #0a0e1a;
  --bg-card: #131825;
  --bg-card-hover: #1a2035;
  --bg-chat: #0f1320;
  --text-primary: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #1e293b;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* ===== HEADER ===== */
.header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(10,14,26,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 2rem;
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { font-size: 1.5rem; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.logo-u { color: var(--primary); font-size: 1.8rem; font-weight: 800; }
.logo-tag {
  font-size: 0.65rem; background: var(--accent);
  color: #000; padding: 2px 6px; border-radius: 4px;
  font-weight: 600; margin-left: 8px;
}
.nav { display: flex; gap: 2rem; }
.nav a { font-size: 0.9rem; color: var(--text-muted); transition: color 0.2s; }
.nav a:hover { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.grade-badge {
  font-size: 0.75rem; background: var(--bg-card);
  padding: 4px 12px; border-radius: 20px;
  border: 1px solid var(--border); color: var(--text-muted);
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; padding: 10px 24px; border-radius: 8px;
  font-weight: 600; font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(108,99,255,0.4); }
.btn-outline {
  background: transparent; border: 2px solid var(--border);
  color: var(--text-primary); padding: 10px 24px; border-radius: 8px;
  font-weight: 600; font-size: 0.9rem;
  transition: border-color 0.2s, color 0.2s;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-subject {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; padding: 8px 20px; border-radius: 8px;
  font-weight: 600; font-size: 0.85rem; margin-top: 12px;
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
}
.subject-card:hover .btn-subject { opacity: 1; transform: translateY(0); }

/* ===== HERO ===== */
.hero {
  min-height: 100vh; padding: 120px 2rem 60px;
  display: flex; align-items: center; justify-content: center;
  gap: 4rem; max-width: 1400px; margin: 0 auto;
  flex-wrap: wrap;
}
.hero-content { flex: 1; min-width: 340px; }
.hero-eyebrow {
  font-size: 0.9rem; color: var(--accent);
  font-weight: 500; margin-bottom: 1rem;
}
.hero h1 { font-size: 3.5rem; font-weight: 800; line-height: 1.15; margin-bottom: 1.5rem; }
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub { font-size: 1.1rem; color: var(--text-muted); max-width: 520px; margin-bottom: 2rem; }
.hero-btns { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.hero-stats { display: flex; gap: 2rem; flex-wrap: wrap; }
.stat { text-align: center; }
.stat span { display: block; font-size: 1.8rem; font-weight: 700; color: var(--accent); }
.hero-visual { flex: 1; min-width: 340px; display: flex; justify-content: center; }

/* ===== CHAT PREVIEW ===== */
.chat-preview {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 2rem; width: 100%; max-width: 400px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.chat-bubble {
  padding: 12px 16px; border-radius: 14px;
  margin-bottom: 12px; max-width: 85%; font-size: 0.9rem;
  animation: fadeUp 0.5s ease forwards;
}
.chat-bubble.ai {
  background: var(--bg-card-hover); border: 1px solid var(--border);
  align-self: flex-start;
}
.chat-bubble.user {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; margin-left: auto;
}
.typing-indicator {
  display: flex; gap: 4px; padding: 12px 16px;
}
.typing-indicator span {
  width: 8px; height: 8px; background: var(--text-muted);
  border-radius: 50%; animation: blink 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%,60%,100% { opacity: 0.3; } 30% { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== SECTION COMMON ===== */
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 { font-size: 2.2rem; font-weight: 700; margin-bottom: 0.5rem; }
.section-header p { color: var(--text-muted); font-size: 1rem; }

/* ===== SUBJECTS GRID ===== */
.subjects-section { padding: 80px 2rem; max-width: 1400px; margin: 0 auto; }
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}
.subject-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  cursor: pointer; position: relative; overflow: hidden;
}
.subject-card:hover {
  transform: translateY(-4px); border-color: var(--primary);
  box-shadow: 0 8px 30px rgba(108,99,255,0.15);
}
.subject-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.subject-card h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.subject-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.8rem; }
.topics-count {
  font-size: 0.75rem; color: var(--accent); font-weight: 600;
  margin-bottom: 0.8rem;
}
.subject-topics { display: flex; flex-wrap: wrap; gap: 6px; }
.subject-topics span {
  font-size: 0.72rem; background: rgba(108,99,255,0.1);
  padding: 3px 8px; border-radius: 4px; color: var(--primary-light);
}
.tamil-script { font-size: 0.9rem; color: var(--accent); }

/* ===== FEATURES ===== */
.features-section { padding: 80px 2rem; max-width: 1200px; margin: 0 auto; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem;
  transition: border-color 0.3s;
}
.feature-card:hover { border-color: var(--accent); }
.feature-icon { font-size: 2rem; margin-bottom: 1rem; }
.feature-card h4 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.feature-card p { color: var(--text-muted); font-size: 0.9rem; }

/* ===== TUTOR SECTION ===== */
.tutor-section { padding: 80px 2rem; max-width: 1400px; margin: 0 auto; }
.tutor-container {
  display: grid; grid-template-columns: 280px 1fr;
  gap: 1.5rem; min-height: 600px;
}
.tutor-sidebar {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.tutor-sidebar h3 { font-size: 1rem; }
.subject-selector label { font-size: 0.8rem; color: var(--text-muted); display: block; margin-bottom: 4px; }
.subject-selector select {
  width: 100%; padding: 8px 12px; border-radius: 8px;
  background: var(--bg-dark); color: var(--text-primary);
  border: 1px solid var(--border); font-size: 0.9rem;
}

.quick-topics { display: flex; flex-direction: column; gap: 6px; max-height: 250px; overflow-y: auto; }
.quick-topics button {
  background: var(--bg-dark); border: 1px solid var(--border);
  padding: 8px 12px; border-radius: 8px; text-align: left;
  font-size: 0.8rem; color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
}
.quick-topics button:hover { background: var(--bg-card-hover); color: var(--accent); }
.sidebar-tips { margin-top: auto; }
.sidebar-tips h4 { font-size: 0.85rem; margin-bottom: 8px; }
.sidebar-tips ul { list-style: none; }
.sidebar-tips li {
  font-size: 0.78rem; color: var(--text-muted);
  padding: 4px 0; border-bottom: 1px solid var(--border);
}
.sidebar-tips li::before { content: "• "; color: var(--accent); }

/* ===== CHAT AREA ===== */
.tutor-chat {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); display: flex; flex-direction: column;
  overflow: hidden;
}
.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
}
.ai-avatar {
  width: 40px; height: 40px; background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.chat-header-info h3 { font-size: 1rem; }
.chat-header-info span { font-size: 0.75rem; color: var(--text-muted); }
.online-dot {
  display: inline-block; width: 8px; height: 8px;
  background: #22c55e; border-radius: 50%; margin-right: 4px;
}
.btn-clear {
  margin-left: auto; background: var(--bg-dark);
  padding: 6px 12px; border-radius: 6px;
  font-size: 0.8rem; color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-clear:hover { color: #ef4444; border-color: #ef4444; }

/* ===== MESSAGES ===== */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.message { display: flex; gap: 10px; animation: fadeUp 0.3s ease; }
.ai-message { align-items: flex-start; }
.user-message { align-items: flex-start; flex-direction: row-reverse; }
.message-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; flex-shrink: 0;
  background: var(--bg-dark); border: 1px solid var(--border);
}
.user-message .message-avatar { background: var(--primary); border: none; }
.message-bubble {
  background: var(--bg-dark); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 16px;
  max-width: 75%; font-size: 0.9rem; line-height: 1.6;
}
.user-message .message-bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; border: none;
}
.message-bubble code {
  background: rgba(108,99,255,0.15); padding: 2px 6px;
  border-radius: 4px; font-size: 0.85rem;
}
.message-bubble strong { color: var(--accent); }
.quick-starters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.quick-starters button {
  background: rgba(108,99,255,0.15); border: 1px solid var(--primary);
  padding: 6px 12px; border-radius: 20px;
  font-size: 0.75rem; color: var(--primary-light);
  transition: background 0.2s;
}
.quick-starters button:hover { background: var(--primary); color: #fff; }

/* ===== CHAT INPUT ===== */
.chat-input-area { padding: 1rem 1.5rem; border-top: 1px solid var(--border); }
.input-row { display: flex; gap: 10px; align-items: flex-end; }
.input-row textarea {
  flex: 1; background: var(--bg-dark); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 16px; color: var(--text-primary);
  font-size: 0.9rem; resize: none; min-height: 44px; max-height: 120px;
  font-family: inherit; line-height: 1.4;
}
.input-row textarea:focus { outline: none; border-color: var(--primary); }
.btn-send {
  width: 44px; height: 44px; background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s;
}
.btn-send:hover { transform: scale(1.05); }
.btn-send svg { width: 20px; height: 20px; color: #fff; }
.input-hints { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.input-hints span {
  font-size: 0.72rem; background: var(--bg-dark);
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--border); color: var(--text-muted);
  cursor: pointer; transition: border-color 0.2s, color 0.2s;
}
.input-hints span:hover { border-color: var(--accent); color: var(--accent); }

/* ===== LOADING ===== */
.loading-dots { display: flex; gap: 4px; padding: 8px 0; }
.loading-dots span {
  width: 8px; height: 8px; background: var(--primary);
  border-radius: 50%; animation: blink 1.2s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ===== PROGRESS ===== */
.progress-section { padding: 80px 2rem; max-width: 1200px; margin: 0 auto; }
.progress-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.progress-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}
.progress-card h4 { font-size: 1rem; margin-bottom: 0.5rem; }
.progress-bar-bg {
  height: 8px; background: var(--bg-dark); border-radius: 4px;
  overflow: hidden; margin: 8px 0;
}
.progress-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px; transition: width 0.5s ease;
}
.progress-label { font-size: 0.75rem; color: var(--text-muted); }

/* ===== FOOTER ===== */
.footer { border-top: 1px solid var(--border); padding: 3rem 2rem 1.5rem; margin-top: 4rem; }
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem; margin-bottom: 2rem;
}
.footer-brand p { color: var(--text-muted); font-size: 0.85rem; margin-top: 8px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links h4 { font-size: 0.9rem; margin-bottom: 4px; }
.footer-links a { font-size: 0.85rem; color: var(--text-muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { text-align: center; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.footer-bottom p { font-size: 0.8rem; color: var(--text-muted); }
.footer-bottom a { color: var(--accent); }
.footer-note { font-size: 0.7rem; margin-top: 4px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .tutor-container { grid-template-columns: 1fr; }
  .tutor-sidebar { display: none; }
  .nav { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .hero { padding: 100px 1.5rem 40px; }
  .hero h1 { font-size: 2.2rem; }
  .hero-visual { display: none; }
  .subjects-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .header-actions .grade-badge { display: none; }
  .message-bubble { max-width: 90%; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
