/* ========================================
   SAT/ACT Study Planner - Global Styles
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #1e3a5f;
  --primary-light: #2d5f9e;
  --accent: #27ae60;
  --accent-light: #2ecc71;
  --warning: #f39c12;
  --danger: #e74c3c;
  --bg: #f0f4f8;
  --card: #ffffff;
  --text: #1a2332;
  --text-muted: #6b7a8d;
  --border: #dde3ec;
  --shadow: 0 2px 12px rgba(30,58,95,0.10);
  --shadow-lg: 0 8px 32px rgba(30,58,95,0.15);
  --radius: 12px;
  --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
}

/* ── HEADER ── */
.app-header {
  background: var(--primary);
  color: #fff;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.app-header .brand span { font-size: 1.5rem; }
.header-right { display: flex; align-items: center; gap: 16px; }
.user-badge {
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 500;
}
.btn-logout {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s;
}
.btn-logout:hover { background: rgba(255,255,255,0.25); }

/* ── MAIN LAYOUT ── */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ── CARDS ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  border: 1px solid var(--border);
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── GRID ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); }
.btn-success {
  background: var(--accent);
  color: #fff;
}
.btn-success:hover { background: var(--accent-light); }
.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
}

/* ── STAT BOXES ── */
.stat-box {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-align: center;
}
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── PROGRESS BAR ── */
.progress-wrap { margin: 10px 0; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-weight: 500;
}
.progress-bar {
  height: 10px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transition: width 0.6s ease;
}
.progress-fill.green {
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
}

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-orange { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #ede9fe; color: #5b21b6; }

/* ── MOTIVATION BANNER ── */
.motivation-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.motivation-emoji { font-size: 2.5rem; }
.motivation-text h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.motivation-text p { font-size: 0.88rem; opacity: 0.9; }

/* ── TOPIC TAGS ── */
.topic-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  background: #eef2ff;
  color: #3730a3;
  margin: 3px;
}

/* ── DAILY PLAN LIST ── */
.day-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
  transition: box-shadow 0.2s;
}
.day-card:hover { box-shadow: var(--shadow); }
.day-card-header {
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
}
.day-card-header.today { background: var(--accent); }
.day-card-header.past { background: #94a3b8; }
.day-card-body { padding: 14px 16px; background: #fff; }
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.88rem;
}
.task-item:last-child { border-bottom: none; }
.task-check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
  transition: all 0.2s;
}
.task-check.checked { background: var(--accent); border-color: var(--accent); }
.task-text { flex: 1; line-height: 1.4; }
.task-duration {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-top: 2px;
}

/* ── SECTION HEADERS ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── TABS ── */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: -2px;
  transition: all 0.2s;
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── RESOURCE LINKS ── */
.resource-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  margin-bottom: 8px;
  transition: all 0.2s;
  background: #fff;
}
.resource-link:hover {
  border-color: var(--primary-light);
  background: #f0f4ff;
  transform: translateX(3px);
}
.resource-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.resource-info { flex: 1; }
.resource-info strong { font-size: 0.88rem; display: block; }
.resource-info span { font-size: 0.78rem; color: var(--text-muted); }

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f2040 0%, #1e3a5f 50%, #2d5f9e 100%);
  padding: 24px;
}
.login-box {
  background: #fff;
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo .emoji { font-size: 3rem; }
.login-logo h1 { font-size: 1.4rem; font-weight: 800; color: var(--primary); margin-top: 8px; }
.login-logo p { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }
.login-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}
.login-creds-hint {
  background: #f0f4ff;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 20px;
}
.login-creds-hint p { font-size: 0.78rem; color: #3730a3; font-weight: 600; margin-bottom: 6px; }
.login-creds-hint ul { font-size: 0.75rem; color: #4338ca; padding-left: 16px; }
.login-creds-hint li { margin-bottom: 3px; }

/* ── SETUP WIZARD ── */
.setup-wizard {
  background: linear-gradient(135deg, #eef2ff 0%, #f0fdf4 100%);
  border: 2px solid #c7d2fe;
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}
.setup-wizard h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}
.setup-wizard p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; }
.exam-picker { display: flex; gap: 12px; margin-bottom: 16px; }
.exam-option {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.exam-option:hover { border-color: var(--primary-light); }
.exam-option.selected {
  border-color: var(--primary);
  background: #eef2ff;
}
.exam-option .exam-emoji { font-size: 1.8rem; }
.exam-option .exam-name { font-size: 0.88rem; font-weight: 700; color: var(--primary); margin-top: 4px; }
.exam-option .exam-desc { font-size: 0.75rem; color: var(--text-muted); }

/* ── CALENDAR GRID ── */
.week-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.week-nav button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.week-label { font-weight: 600; font-size: 0.9rem; color: var(--primary); flex: 1; }

/* ── COUNTDOWN ── */
.countdown-box {
  background: linear-gradient(135deg, #1e3a5f, #2d5f9e);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.countdown-number { font-size: 3rem; font-weight: 800; line-height: 1; }
.countdown-label { font-size: 0.85rem; opacity: 0.8; margin-top: 4px; }
.countdown-date { font-size: 0.78rem; opacity: 0.6; margin-top: 8px; }

/* ── STUDENT CARD (parent view) ── */
.student-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.student-card-header {
  padding: 20px 24px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
}
.student-card-header.grade12 { background: linear-gradient(135deg, #1e3a5f, #2d5f9e); }
.student-card-header.grade11 { background: linear-gradient(135deg, #065f46, #059669); }
.student-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.student-card-header h3 { font-size: 1.1rem; font-weight: 700; }
.student-card-header p { font-size: 0.82rem; opacity: 0.85; margin-top: 2px; }
.student-card-body { padding: 20px 24px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .main-content { padding: 16px; }
  .app-header { padding: 0 16px; }
  .login-box { padding: 32px 24px; }
}

/* ── ANIMATIONS ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease; }

/* ── ALERT ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.88rem;
  font-weight: 500;
}
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--accent); }
.alert-info { background: #dbeafe; color: #1e40af; border-left: 4px solid var(--primary-light); }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid var(--warning); }
