/* General Game-feel & Arabic Typography styling */
:root {
  --prep-color-1: #FF5E7E; /* أول إعدادي: Warm Coral */
  --prep-color-2: #FF9233; /* ثاني إعدادي: Warm Tangerine */
  --prep-color-3: #FFBE0B; /* ثالث إعدادي: Bright Amber */
  
  --sec-color-1: #3A86FF;  /* أولى ثانوي: Vibrant Royal Blue */
  --sec-color-2: #8338EC;  /* ثاني ثانوي: Electric Violet/Purple */
  --sec-color-3: #06D6A0;  /* ثالث ثانوي: Bright Turquoise Mint */
}

body {
  font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* Background floating math signs animation */
@keyframes floatUp {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(10deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

.float-item {
  animation: floatUp 6s ease-in-out infinite;
}
.float-item:nth-child(2) { animation-delay: 1.5s; animation-duration: 7s; }
.float-item:nth-child(3) { animation-delay: 3s; animation-duration: 5.5s; }
.float-item:nth-child(4) { animation-delay: 2s; animation-duration: 8s; }
.float-item:nth-child(5) { animation-delay: 0.8s; animation-duration: 6.5s; }

/* 3 Harmonious Warm Colors for Preparatory Stage (الألوان الدافئة المتقاربة) */
.grade-prep-1 {
  background-color: var(--prep-color-1);
}
.grade-prep-2 {
  background-color: var(--prep-color-2);
}
.grade-prep-3 {
  background-color: var(--prep-color-3);
}

/* 3 Harmonious Cool Colors for Secondary Stage (الألوان الباردة الزاهية المتقاربة) */
.grade-sec-1 {
  background-color: var(--sec-color-1);
}
.grade-sec-2 {
  background-color: var(--sec-color-2);
}
.grade-sec-3 {
  background-color: var(--sec-color-3);
}

/* Custom Card & Button Pressed Physics */
.grade-card-btn {
  border: 4px solid rgba(255, 255, 255, 0.45);
}

/* Chat bubble styling */
.chat-bubble-peer {
  border-radius: 20px 20px 4px 20px;
}
.chat-bubble-self {
  border-radius: 20px 20px 20px 4px;
}
.chat-bubble-teacher {
  border-radius: 20px 20px 4px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #ede9fe 100%);
  border: 2px solid #c4b5fd;
}

/* Star pop animation */
@keyframes starPop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.star-pop {
  animation: starPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Custom Scrollbar for Chat */
#chat-messages-container::-webkit-scrollbar {
  width: 6px;
}
#chat-messages-container::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 8px;
}
#chat-messages-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 8px;
}
#chat-messages-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Active Grade Selected Pill */
.grade-pill-btn.active {
  ring-width: 3px;
  --tw-ring-color: #6366f1;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

/* Staged Image animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade {
  animation: fadeIn 0.25s ease-out;
}

/* Math message image hover enhancement */
.math-msg-image {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}
.math-msg-image:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.2);
}