/* =================== BisaME AI Global Styles =================== */
:root {
  --gold: #F4C430; --green: #006B3C; --red: #CE1126;
  --dark: #1a1a2e; --light-gold: #FFF5CC;
}
* { box-sizing: border-box; }
body { overflow-x: hidden; }

/* =========== LOADING =========== */
#loadingScreen { transition: opacity 0.6s ease, visibility 0.6s ease; }
#loadingScreen.fade-out { opacity: 0; visibility: hidden; }
.rotating-logo { animation: spin 2s linear infinite; }
.rotating-logo-small { animation: spin 2s linear infinite; display: inline-flex; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.dot-bounce { animation: bounce 1s ease infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* =========== KENTE =========== */
.kente-stripe-bar {
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--gold) 0px, var(--gold) 20px, var(--green) 20px, var(--green) 40px, var(--red) 40px, var(--red) 60px, #000 60px, #000 80px, var(--gold) 80px, var(--gold) 100px);
  background-size: 100px 4px;
  animation: kenteMarch 3s linear infinite;
}
@keyframes kenteMarch { from { background-position: 0 0; } to { background-position: 100px 0; } }
.kente-pattern-overlay {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(244,196,48,0.08) 0px, rgba(244,196,48,0.08) 2px, transparent 2px, transparent 20px),
    repeating-linear-gradient(-45deg, rgba(0,107,60,0.06) 0px, rgba(0,107,60,0.06) 2px, transparent 2px, transparent 20px);
  pointer-events: none;
}
.kente-border-loader {
  width: 80px; height: 80px; border-radius: 50%;
  border: 5px solid transparent;
  border-top-color: var(--red);
  border-right-color: var(--gold);
  border-bottom-color: var(--green);
  animation: spin 1s linear infinite;
}

/* =========== HERO =========== */
.hero-bg { background: radial-gradient(ellipse at 60% 40%, #1a3a2e 0%, #1a1a2e 50%, #0d0d1a 100%); }
.hero-text-appear { animation: fadeUp 0.8s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.hero-logo-bounce { animation: heroBounce 3s ease-in-out infinite; }
@keyframes heroBounce { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }
.pulse-glow { animation: pulseGlow 2.5s ease-in-out infinite; }
@keyframes pulseGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(244,196,48,0.4); } 50% { box-shadow: 0 0 0 16px rgba(244,196,48,0); } }
.scroll-indicator { animation: scrollBounce 2s ease-in-out infinite; transform: translateX(-50%); }
@keyframes scrollBounce { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(8px); } }

/* =========== NAVBAR =========== */
.nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 10px; border-radius: 8px; color: #d1d5db; font-size: 10px; font-weight: 500;
  transition: all 0.2s; white-space: nowrap; border: none; background: none; cursor: pointer;
}
.nav-btn:hover, .nav-btn.active { background: rgba(244,196,48,0.15); color: #F4C430; }
.nav-btn svg { width: 18px; height: 18px; }
.mobile-nav-btn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 20px; color: #d1d5db; font-size: 14px; background: none; border: none; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.04); }
.mobile-nav-btn:hover { background: rgba(255,255,255,0.05); color: #F4C430; }
.mobile-nav-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* =========== LOGO =========== */
.logo-nav-img { filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }
.logo-hero-img { filter: drop-shadow(0 4px 16px rgba(0,0,0,0.5)); }
.logo-dark-bg { filter: drop-shadow(0 0 12px rgba(244,196,48,0.3)); }

/* =========== PASSWORD TOGGLE =========== */
.password-wrapper { position: relative; }
.password-wrapper .input-field { padding-right: 44px; }
.password-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: #9ca3af; font-size: 18px;
  line-height: 1; padding: 2px; transition: color 0.2s;
}
.password-toggle:hover { color: #374151; }

/* =========== CARDS & LAYOUT =========== */
.card { background: white; border-radius: 20px; padding: 24px; box-shadow: 0 4px 24px rgba(0,0,0,0.07); }
.stat-card { background: white; border-radius: 16px; padding: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); display: flex; flex-direction: column; gap: 4px; }
.page-section { min-height: calc(100vh - 80px); }

/* =========== BUTTONS =========== */
.btn-gold { background: var(--gold); color: var(--dark); font-weight: 700; padding: 10px 24px; border-radius: 12px; border: none; cursor: pointer; transition: all 0.2s; font-size: 14px; }
.btn-gold:hover { background: #e8b820; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(244,196,48,0.4); }
.btn-gold-large { background: var(--gold); color: var(--dark); font-weight: 800; padding: 16px 36px; border-radius: 16px; border: none; cursor: pointer; font-size: 18px; transition: all 0.2s; }
.btn-gold-large:hover { background: #e8b820; transform: translateY(-2px); box-shadow: 0 6px 24px rgba(244,196,48,0.5); }
.btn-green { background: var(--green); color: white; font-weight: 700; padding: 10px 24px; border-radius: 12px; border: none; cursor: pointer; transition: all 0.2s; font-size: 14px; }
.btn-green:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: #9ca3af; font-weight: 600; padding: 8px 16px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.15); cursor: pointer; transition: all 0.2s; font-size: 13px; }
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: white; }
.btn-outline-white { background: transparent; color: white; font-weight: 700; padding: 16px 36px; border-radius: 16px; border: 2px solid rgba(255,255,255,0.5); cursor: pointer; transition: all 0.2s; font-size: 16px; }
.btn-outline-white:hover { background: rgba(255,255,255,0.1); border-color: white; }

/* =========== INPUTS =========== */
.input-field { border: 2px solid #e5e7eb; border-radius: 12px; padding: 10px 14px; font-family: 'Poppins', sans-serif; font-size: 14px; outline: none; transition: border-color 0.2s; width: 100%; background: white; }
.input-field:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(244,196,48,0.15); }
.select-field { border: 2px solid #e5e7eb; border-radius: 12px; padding: 10px 14px; font-family: 'Poppins', sans-serif; font-size: 14px; outline: none; background: white; cursor: pointer; }
.select-field:focus { border-color: var(--gold); }

/* =========== HOME FEATURES =========== */
.feature-card {
  padding: 24px; border-radius: 20px; border: 1px solid #f3f4f6;
  transition: all 0.3s; position: relative; overflow: hidden; background: white;
}
.feature-card:hover { box-shadow: 0 12px 40px rgba(0,0,0,0.1); transform: translateY(-4px); border-color: var(--gold); }
.feature-icon { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.feature-badge { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 1px; padding: 3px 8px; border-radius: 6px; color: white; margin-top: 12px; }
.step-card { text-align: center; padding: 24px; border-radius: 20px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); }
.step-number { font-size: 48px; font-weight: 900; color: rgba(244,196,48,0.15); font-family: 'Playfair Display', serif; line-height: 1; margin-bottom: 8px; }

/* =========== KNOWLEDGE MAP =========== */
.knowledge-map-container { position: relative; width: 100%; height: 320px; background: linear-gradient(135deg, #f0f9ff 0%, #e8f5e9 50%, #fff8e1 100%); border-radius: 16px; overflow: hidden; border: 1px solid #e5e7eb; }
.knowledge-island {
  position: absolute; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transform: translate(-50%, -50%);
}
.knowledge-island:hover { transform: translate(-50%, -50%) scale(1.2); z-index: 10; box-shadow: 0 8px 30px rgba(0,0,0,0.3); }
.island-label { color: white; font-size: 10px; font-weight: 700; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,0.5); padding: 0 4px; }
.island-score { color: white; font-size: 12px; font-weight: 900; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.island-pulse-red { animation: pulseRed 2s ease-in-out infinite; }
@keyframes pulseRed { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); } 50% { box-shadow: 0 0 0 12px rgba(239,68,68,0); } }
.island-pulse-green { animation: pulseGreen 3s ease-in-out infinite; }
@keyframes pulseGreen { 0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.3); } 50% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } }
.heatmap-cell { border-radius: 12px; padding: 12px; text-align: center; color: white; cursor: pointer; transition: transform 0.2s; }
.heatmap-cell.strong { background: linear-gradient(135deg, #22c55e, #16a34a); }
.heatmap-cell.moderate { background: linear-gradient(135deg, #eab308, #ca8a04); }
.heatmap-cell.weak { background: linear-gradient(135deg, #ef4444, #dc2626); }
.heatmap-cell:hover { transform: scale(1.05); }

/* =========== QUIZ =========== */
.quiz-progress-bar { height: 8px; background: #f3f4f6; border-radius: 99px; overflow: hidden; }
.quiz-progress-fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--gold)); border-radius: 99px; transition: width 0.3s ease; }
.question-card { background: white; border-radius: 20px; padding: 28px; box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
.option-btn {
  width: 100%; text-align: left; padding: 14px 18px; border: 2px solid #e5e7eb;
  border-radius: 12px; background: white; cursor: pointer; font-size: 14px; font-family: 'Poppins', sans-serif;
  transition: all 0.2s; margin-bottom: 8px; font-weight: 500;
}
.option-btn:hover:not(:disabled) { border-color: var(--gold); background: #FFF9E6; }
.option-btn.correct { border-color: #22c55e; background: #f0fdf4; color: #15803d; font-weight: 700; }
.option-btn.wrong { border-color: #ef4444; background: #fef2f2; color: #dc2626; }
.confidence-btns { display: flex; gap: 8px; }
.conf-btn { flex: 1; padding: 8px 4px; border: 2px solid #e5e7eb; border-radius: 10px; background: white; cursor: pointer; font-size: 12px; font-family: 'Poppins', sans-serif; transition: all 0.2s; }
.conf-btn.active { border-color: var(--gold); background: var(--light-gold); font-weight: 700; }
.count-btn { padding: 8px 20px; border: 2px solid #e5e7eb; border-radius: 10px; background: white; cursor: pointer; font-weight: 700; font-family: 'Poppins', sans-serif; transition: all 0.2s; }
.count-btn.active { border-color: var(--gold); background: var(--gold); color: var(--dark); }
.misconception-card { background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px; padding: 12px; }

/* =========== SPACED REPETITION =========== */
.review-quality-btn {
  padding: 16px 8px; border-radius: 12px; border: 2px solid #e5e7eb; background: white;
  cursor: pointer; font-size: 28px; text-align: center; transition: all 0.2s; font-family: 'Poppins', sans-serif;
}
.review-quality-btn:hover { transform: translateY(-3px); }
.quality-1:hover { border-color: #dc2626; background: #fef2f2; }
.quality-2:hover { border-color: #f97316; background: #fff7ed; }
.quality-4:hover { border-color: #3b82f6; background: #eff6ff; }
.quality-5:hover { border-color: #22c55e; background: #f0fdf4; }

/* =========== ACHIEVEMENTS =========== */
.achievement-badge {
  border-radius: 16px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center;
  border: 2px solid; transition: all 0.2s; cursor: default; text-align: center;
}
.achievement-badge.earned { border-color: var(--gold); background: linear-gradient(135deg, #FFF9E6, #FFF3CC); }
.achievement-badge.locked { border-color: #e5e7eb; background: #f9fafb; opacity: 0.6; filter: grayscale(0.5); }
.achievement-badge.earned:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(244,196,48,0.3); }

/* =========== UPLOAD =========== */
.upload-zone {
  border: 2px dashed #d1d5db; border-radius: 20px; padding: 48px 24px; text-align: center;
  cursor: pointer; transition: all 0.3s; background: #fafafa;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--gold); background: var(--light-gold); }
.adinkra-upload-icon { font-size: 56px; margin-bottom: 16px; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.file-badge { background: #f3f4f6; color: #374151; border-radius: 8px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
.material-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: #f9fafb; border-radius: 12px; margin-bottom: 8px; }
.progress-bar-container { height: 8px; background: #f3f4f6; border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--green), var(--gold)); border-radius: 99px; transition: width 0.4s ease; }

/* =========== STUDY PLAN =========== */
.plan-type-btn { padding: 10px 16px; border: 2px solid #e5e7eb; border-radius: 12px; background: white; cursor: pointer; font-size: 13px; font-weight: 600; font-family: 'Poppins', sans-serif; transition: all 0.2s; }
.plan-type-btn.active { border-color: var(--gold); background: var(--gold); color: var(--dark); }
.day-card { background: white; border: 1px solid #f3f4f6; border-radius: 16px; padding: 20px; margin-bottom: 12px; border-left: 4px solid var(--green); }
.prediction-card { display: flex; align-items: center; gap-12px; gap: 12px; padding: 12px 16px; border-radius: 12px; background: #f9fafb; border: 1px solid #e5e7eb; }

/* =========== AI TUTOR =========== */
.chat-message { display: flex; gap: 12px; align-items: flex-start; }
.chat-message.user { flex-direction: row-reverse; }
.chat-bubble-ai { background: white; border: 1px solid #e5e7eb; border-radius: 18px 18px 18px 4px; padding: 12px 16px; max-width: 80%; font-size: 14px; line-height: 1.6; }
.chat-bubble-user { background: var(--dark); color: white; border-radius: 18px 18px 4px 18px; padding: 12px 16px; max-width: 80%; font-size: 14px; }
.chat-typing { display: flex; gap: 4px; align-items: center; padding: 4px 0; }
.chat-typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: typing 1.2s ease-in-out infinite; }
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-6px); opacity: 1; } }
.quick-prompt { background: #f3f4f6; color: #374151; border: none; border-radius: 20px; padding: 6px 14px; font-size: 12px; cursor: pointer; transition: all 0.2s; font-family: 'Poppins', sans-serif; }
.quick-prompt:hover { background: var(--light-gold); color: var(--dark); }
.speak-btn { background: none; border: none; font-size: 12px; cursor: pointer; color: #9ca3af; margin-top: 6px; padding: 2px; }
.speak-btn:hover { color: var(--green); }

/* =========== VOICE =========== */
.voice-btn { background: var(--dark); color: white; border: 2px solid rgba(255,255,255,0.2); border-radius: 50%; width: 38px; height: 38px; cursor: pointer; font-size: 16px; transition: all 0.2s; flex-shrink: 0; }
.voice-btn:hover { background: var(--green); border-color: var(--green); }
.voice-wave { display: flex; align-items: center; gap: 2px; height: 20px; }
.voice-wave span { width: 3px; border-radius: 2px; background: var(--gold); animation: waveAnim 0.8s ease-in-out infinite; }
.voice-wave span:nth-child(1) { height: 6px; animation-delay: 0s; }
.voice-wave span:nth-child(2) { height: 14px; animation-delay: 0.1s; }
.voice-wave span:nth-child(3) { height: 10px; animation-delay: 0.2s; }
.voice-wave span:nth-child(4) { height: 18px; animation-delay: 0.3s; }
.voice-wave span:nth-child(5) { height: 8px; animation-delay: 0.4s; }
@keyframes waveAnim { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.8); } }

/* =========== ESSAY GRADER =========== */
.score-ring-container { position: relative; width: 72px; height: 72px; margin: 0 auto; }
.score-ring { width: 72px; height: 72px; transform: rotate(-90deg); }
.score-ring-bg { fill: none; stroke: #f3f4f6; stroke-width: 8; }
.score-ring-fill { fill: none; stroke-width: 8; stroke-linecap: round; stroke-dasharray: 0 163; transition: stroke-dasharray 1s ease, stroke 0.5s; }
.score-ring-value { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-weight: 900; font-size: 16px; color: var(--dark); }

/* =========== LEADERBOARD =========== */
/* Uses existing card/stat-card styles */

/* =========== MODALS =========== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: white; border-radius: 24px; padding: 28px; width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto; animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes modalIn { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-close { background: #f3f4f6; border: none; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; font-size: 14px; color: #6b7280; transition: background 0.2s; }
.modal-close:hover { background: #e5e7eb; }

/* =========== ANIMATIONS =========== */
@keyframes slideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
.animate-in { animation: slideIn 0.4s ease both; }

/* =========== MOBILE RESPONSIVE =========== */
@media (max-width: 640px) {
  .card { padding: 16px; border-radius: 16px; }
  .stat-card { padding: 14px; }
  .modal-box { padding: 20px; border-radius: 20px; }
  .btn-gold-large { padding: 14px 24px; font-size: 16px; }
  .hero-logo-bounce { width: 160px !important; }
  .question-card { padding: 18px; }
  .upload-zone { padding: 28px 16px; }
  .review-quality-btn { padding: 12px 6px; font-size: 22px; }
  .chat-bubble-ai, .chat-bubble-user { max-width: 92%; font-size: 13px; }
  .knowledge-map-container { height: 240px; }
  h1.text-3xl { font-size: 1.5rem; }
  main { padding-top: 72px; }
}
@media (max-width: 400px) {
  .nav-btn { padding: 4px 7px; font-size: 9px; }
  .nav-btn svg { width: 15px; height: 15px; }
  .hero-logo-bounce { width: 130px !important; }
}
