:root {
  /* ڕەنگەکان بەپێی لۆگۆی MOHS IN */
  --brand-color: #8c163b; /* ڕەنگی مارۆنی */
  --accent-color: #00adee; /* ڕەنگی شینی ناو لۆگۆ */
  --bg-color: #f8f9fa;
}

* { box-sizing: border-box; }

body {
  background-color: var(--bg-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  /* بۆ شاردنەوەی سەرەتایی پێش ئەنیمەیشن */
  opacity: 0; 
  transition: opacity 1s ease;
  overflow-x: hidden;
}

/* ---- SPLASH / FOOTER Animation ---- */
#splash-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--brand-color);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

#moving-logo {
  width: 70%;
  max-width: 500px;
  animation: pulseLogo 2s infinite alternate;
  transition: all 1.2s ease-in-out;
}

@keyframes pulseLogo {
  0% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(0,0,0,0.3)); }
  100% { transform: scale(1.05); filter: drop-shadow(0 0 25px rgba(0,173,238,0.6)); }
}

/* State when Loaded (Footer Mode) */
body.loaded {
  opacity: 1;
}

body.loaded #splash-overlay {
  height: 60px; /* دەبێتە فووتەر */
  top: auto;
  bottom: 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}

body.loaded #moving-logo {
  width: 100px; /* لۆگۆکە بچووک دەبێتەوە */
  animation: none;
  filter: none;
}

/* ---- CONTROLS UI ---- */
.controls {
  background: white;
  padding: 15px 30px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  margin: 30px 0;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  border: 1px solid #eee;
}

.input-grp {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  color: #333;
  font-weight: bold;
}

input, select, button {
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
  outline: none;
  margin-top: 5px;
}
input { width: 80px; }

button {
  background: var(--brand-color);
  color: white;
  border: none;
  font-weight: bold;
  cursor: pointer;
  padding: 10px 25px;
  margin-top: 15px; /* Alignment fix */
}
button:hover { background: #6b0f2d; transform: translateY(-2px); }

/* ---- COMPACT GRID SYSTEM (ZERO MARGIN) ---- */
#export-wrapper {
  background-color: #fff;
  border: 1px solid #000;
  padding: 0;
  margin: 0;
  margin-bottom: 100px; /* Space for footer */
  display: inline-block;
  width: fit-content;
}

#grid-container {
  width: auto;
  column-gap: 5px; 
  column-rule: 1px solid #000;
  padding: 2px;
}

.row {
  display: flex;
  align-items: center;
  break-inside: avoid;
  height: 24px;
  border-bottom: 1px dashed #ccc;
  margin: 0;
}
.row:last-child { border-bottom: none; }

.q-num {
  font-weight: bold;
  font-size: 13px;
  width: 25px;
  text-align: center;
  line-height: 1;
  padding: 0; margin: 0;
}

.bubbles-area {
  display: flex;
  gap: 3px;
  margin: 0;
}

.circle {
  width: 18px;
  height: 18px;
  border: 1px solid #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: bold;
  direction: ltr; 
}

/* RTL / LTR Helpers */
.rtl { direction: rtl; }
.rtl .q-num { margin-left: 2px; } 

.ltr { direction: ltr; }
.ltr .q-num { margin-right: 2px; }