/* Custom Base & Graphic Grid for Math Notebook vibe */
body {
  background-color: #FAF9F5;
  background-image: 
    linear-gradient(to right, rgba(203, 213, 225, 0.22) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(203, 213, 225, 0.22) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* RTL Number formatting helper */
.dir-ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

/* Animations */
@keyframes scaleUp {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-scaleUp {
  animation: scaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Mentor Speech Bubble Arrow */
.mentor-speech-bubble {
  position: relative;
}

.mentor-speech-bubble::before {
  content: '';
  position: absolute;
  top: -8px;
  right: 28px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #E9D5FF;
}

/* Active scale micro-interaction */
.active\:scale-98:active {
  transform: scale(0.98);
}

/* Button & Card interactive styling */
.unit-card {
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.05);
}

.unit-card:hover {
  transform: translateY(-2px);
}

/* Option Buttons for questions */
.option-btn {
  transition: all 0.18s ease-in-out;
}

.option-btn:hover:not(:disabled) {
  border-color: #3B82F6;
  background-color: #F8FAFC;
  transform: translateX(-4px);
}

.option-btn.selected-correct {
  border-color: #10B981 !important;
  background-color: #ECFDF5 !important;
  color: #065F46 !important;
}

.option-btn.selected-wrong {
  border-color: #EF4444 !important;
  background-color: #FEF2F2 !important;
  color: #991B1B !important;
}

/* Printable Sheet styles when invoking window.print() */
@media print {
  body * {
    visibility: hidden;
  }
  #printableArea, #printableArea * {
    visibility: visible;
  }
  #printableArea {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 20px;
    background: white !important;
    display: block !important;
  }
}