/* ==========================================================================
   Sudan National Results Portal — shared styles
   Design tokens follow DESIGN.md (Stitch export). Works in both AR (RTL)
   and EN (LTR) since layout relies on Tailwind logical utilities
   (ms-/me-/ps-/pe-/text-start/text-end) rather than hard-coded left/right.
   ========================================================================== */

html {
  scroll-behavior: smooth;
}

body {
  font-family: "IBM Plex Sans Arabic", "Inter", sans-serif;
  background-color: #fcf9f8;
  transition: background-color 0.2s ease, color 0.2s ease;
}

html.dark body {
  background-color: #161515;
  color: #f3f0ef;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  vertical-align: middle;
  line-height: 1;
}

/* Directional "next" arrows: authored as arrow_back (points toward reading-start,
   i.e. left) which is correct for RTL. Mirror it in LTR so it points right. */
[dir="ltr"] .dir-flip {
  display: inline-block;
  transform: scaleX(-1);
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.national-watermark,
.certificate-watermark {
  pointer-events: none;
  opacity: 0.035;
}

.sand-pattern {
  background-image: radial-gradient(#e5bdbc 0.5px, transparent 0.5px);
  background-size: 24px 24px;
  opacity: 0.12;
}

html.dark .sand-pattern {
  background-image: radial-gradient(#4a3f3f 0.5px, transparent 0.5px);
}

.loading-spinner {
  border: 2px solid #ffffff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.bento-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bento-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.tab-active {
  border-color: #a70025;
  color: #a70025;
  font-weight: 600;
}

html.dark .tab-active {
  color: #ffb3b2;
  border-color: #ffb3b2;
}

/* Simple fade/slide-in used for language & route transitions */
.fade-in {
  animation: fadeIn 0.35s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  background: #a70025;
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 100;
  border-radius: 0 0 0.5rem 0.5rem;
}

.skip-link:focus {
  inset-inline-start: 0;
}

/* Print styles for the result certificate */
.print-only { display: none; }

@media print {
  .no-print { display: none !important; }
  .print-only { display: block; }
  .certificate-card {
    box-shadow: none !important;
    border: 1px solid #d1d1d1 !important;
  }
  body { background: #fff !important; }
}

/* Language toggle pill */
.lang-toggle {
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Scrollbar (webkit) - subtle */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: #e5bdbc;
  border-radius: 9999px;
}
html.dark ::-webkit-scrollbar-thumb {
  background-color: #3d3a3a;
}

/* The Tailwind Forms plugin bakes its <select> chevron in at a fixed
   "right" position, which collides with right-aligned Arabic option text
   in RTL. Flip the chevron to the logical end side per direction. */
select {
  background-position: right 0.75rem center !important;
  padding-inline-end: 2.75rem;
  padding-inline-start: 1rem;
}
[dir="rtl"] select {
  background-position: left 0.75rem center !important;
}

/* Simple CSS bar/pie chart primitives used on the statistics page */
.bar-track {
  background-color: #ebe7e7;
  border-radius: 9999px;
  overflow: hidden;
}
html.dark .bar-track {
  background-color: #2b2a2a;
}
.bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 1s ease;
}

.pie-chart {
  border-radius: 9999px;
  aspect-ratio: 1 / 1;
}
