/* ============================================================
   R Mithran — Main Stylesheet
   ============================================================ */

:root {
  --primary: #4f46e5;
  --primary-light: #818cf8;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  --dark: #1e293b;
  --light-bg: #f8fafc;
  --card-radius: 1rem;
  --font-main: 'Inter', sans-serif;
  --font-display: 'Poppins', sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-main);
  background: #ffffff;
  color: var(--dark);
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
}

.brand-icon {
  font-size: 1.3rem;
  margin-right: 4px;
}

/* ============================================================
   HERO
   ============================================================ */
.hero-section {
  position: relative;
  padding: 100px 0 80px;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 50%, rgba(79,70,229,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(6,182,212,0.1) 0%, transparent 50%);
  pointer-events: none;
}

.min-vh-hero { min-height: 70vh; }

.hero-badge .badge {
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.bg-primary-soft { background: rgba(79,70,229,0.15); }

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.hero-tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--primary-light);
  font-weight: 500;
  margin-bottom: 1rem;
}

.hero-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.7) !important;
  max-width: 480px;
}

.interest-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50px;
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  font-weight: 500;
  backdrop-filter: blur(8px);
  transition: all 0.2s;
}
.interest-chip:hover {
  background: rgba(79,70,229,0.3);
  border-color: var(--primary-light);
  color: #fff;
}

/* Profile photo */
.hero-photo-wrap {
  position: relative;
  width: 320px;
  height: 320px;
  flex-shrink: 0;
}

.hero-photo {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  transform: scale(1.4);
  display: block;
  border: 4px solid #4f8ef7;
  box-shadow:
    0 0 0 6px rgba(79, 142, 247, 0.25),
    0 0 30px rgba(79, 142, 247, 0.45),
    0 0 70px rgba(79, 142, 247, 0.2),
    0 20px 60px rgba(0, 0, 0, 0.5);
  animation: float 6s ease-in-out infinite;
}

/* Fallback initials circle — hidden by default, shown via onerror */
.hero-photo-fallback {
  display: none;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a5f 0%, #4f46e5 100%);
  border: 4px solid #4f8ef7;
  box-shadow:
    0 0 0 6px rgba(79, 142, 247, 0.25),
    0 0 30px rgba(79, 142, 247, 0.45),
    0 0 70px rgba(79, 142, 247, 0.2),
    0 20px 60px rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 2px;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}

@media (max-width: 991px) {
  .hero-photo-wrap { width: 200px; height: 200px; }
  .hero-photo { width: 200px; height: 200px; }
  .hero-photo-fallback { width: 200px; height: 200px; font-size: 3.5rem; }
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-card { transition: transform 0.2s; }

.interest-card {
  background: var(--light-bg);
  transition: all 0.2s;
  cursor: default;
}
.interest-card:hover {
  background: #ede9fe;
  transform: translateY(-3px);
}
.interest-icon {
  font-size: 2rem;
  line-height: 1;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--card-radius);
  padding: 1.5rem 1rem;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}
.stat-icon {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--dark);
}
.stat-label {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.25rem;
}

/* ============================================================
   ACHIEVEMENTS
   ============================================================ */
.achievement-card { transition: all 0.2s; }
.achievement-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
}

.achievement-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.achievement-chess  { background: #dbeafe; }
.achievement-math   { background: #dcfce7; }
.achievement-piano  { background: #fae8ff; }
.achievement-academics { background: #fef9c3; }
.achievement-sports { background: #fee2e2; }
.achievement-other  { background: #f1f5f9; }

.badge-chess      { background: #dbeafe; color: #1d4ed8; }
.badge-math       { background: #dcfce7; color: #15803d; }
.badge-piano      { background: #fae8ff; color: #7e22ce; }
.badge-academics  { background: #fef9c3; color: #854d0e; }
.badge-sports     { background: #fee2e2; color: #b91c1c; }
.badge-other      { background: #f1f5f9; color: #475569; }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), transparent);
}
.timeline-item {
  position: relative;
  margin-bottom: 1rem;
}
.timeline-dot {
  position: absolute;
  left: -24px; top: 12px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--primary);
  background: var(--primary);
}
.timeline-dot-chess   { background: #3b82f6; box-shadow: 0 0 0 2px #3b82f6; }
.timeline-dot-math    { background: #22c55e; box-shadow: 0 0 0 2px #22c55e; }
.timeline-dot-piano   { background: #a855f7; box-shadow: 0 0 0 2px #a855f7; }
.timeline-dot-sports  { background: #ef4444; box-shadow: 0 0 0 2px #ef4444; }
.timeline-dot-other   { background: #94a3b8; box-shadow: 0 0 0 2px #94a3b8; }
.timeline-content { transition: all 0.2s; }
.timeline-content:hover { transform: translateX(4px); }

/* ============================================================
   LOGIN
   ============================================================ */
.login-page { background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%); }
.login-wrapper { padding: 1rem; }
.login-card { width: 100%; max-width: 420px; }
.login-header {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
}
.login-chess-icon { font-size: 2.5rem; color: rgba(255,255,255,0.9); }

/* ============================================================
   KID DASHBOARD
   ============================================================ */
.kid-dashboard { background: #f0f4ff; }
.kid-nav { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important; }

.kid-hero {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-bottom: none;
}

.kid-card {
  transition: transform 0.2s;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.kid-card:hover { transform: translateY(-3px); }

.card-today   { border-top: 4px solid var(--primary) !important; }
.card-accuracy { border-top: 4px solid var(--success) !important; }
.card-streak  { border-top: 4px solid var(--warning) !important; }
.card-best    { border-top: 4px solid #f59e0b !important; }
.card-weekly  { border-top: 4px solid var(--info) !important; }

.kid-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--light-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.fw-black { font-weight: 900; }

.acc-meter {
  height: 10px;
  background: #e2e8f0;
  border-radius: 50px;
  overflow: hidden;
}
.acc-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #84cc16);
  border-radius: 50px;
  transition: width 1s ease;
}

/* Day chips */
.weekly-days { }
.day-chip {
  width: 52px;
  text-align: center;
  padding: 8px 4px;
  border-radius: 10px;
  font-size: 0.8rem;
}
.day-done    { background: #dcfce7; color: #166534; }
.day-partial { background: #fef9c3; color: #854d0e; }
.day-empty   { background: #f1f5f9; color: #94a3b8; }
.day-name    { font-weight: 600; font-size: 0.7rem; text-transform: uppercase; }
.day-count   { font-size: 1.2rem; font-weight: 800; }

/* ============================================================
   PARENT DASHBOARD
   ============================================================ */
.parent-hero { }

.kpi-card {
  transition: all 0.2s;
  border-bottom: 3px solid #e2e8f0 !important;
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08) !important;
}
.kpi-icon { font-size: 1.6rem; }
.kpi-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
}
.kpi-label {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tracking-wide { letter-spacing: 0.05em; }

.result-win  { background: #dcfce7; color: #166534; }
.result-loss { background: #fee2e2; color: #991b1b; }
.result-draw { background: #fef9c3; color: #854d0e; }
.result-unknown { background: #f1f5f9; color: #64748b; }

.color-dot { font-size: 1.1rem; }
.color-dot.white { color: #1e293b; }
.color-dot.black { color: #475569; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid #334155; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 576px) {
  .hero-section { padding: 60px 0 50px; }
  .min-vh-hero { min-height: auto; padding: 1rem 0; }
  .stat-value { font-size: 1.8rem; }
  .kpi-value { font-size: 1.5rem; }
}
