@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  font-family: 'Vazirmatn', sans-serif;
  background: #0c0f20;
  color: #ffffff;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 420px; /* canvas بزرگ چپ، کارت‌ها راست */
  height: 100vh;
}

/* چپ: ویژوال */
.visual-panel {
  padding: 32px;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.space-info {
  margin-bottom: 16px;
  font-size: 30px;
  background: linear-gradient(90deg, #48c6ff, #ff4fd8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
}

.slider-nav {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
}

.nav-btn {
  pointer-events: all;
  background: rgba(16, 18, 40, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #48c6ff;
  font-size: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 0 30px rgba(72, 198, 255, 0.6);
}

.nav-btn:hover {
  background: linear-gradient(135deg, #48c6ff, #ff4fd8);
  color: #0b0e1e;
  transform: scale(1.1);
}

.canvas-wrapper {
  flex: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#canvas-holder {
  width: 90%;
  height: 90%;
  background: rgba(16, 18, 40, 0.6);
  border-radius: 40px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.4), 0 0 40px rgba(72, 198, 255, 0.5), 0 0 80px rgba(255, 78, 216, 0.3);
  border: 2px solid rgba(72, 198, 255, 0.4);
}

/* راست: کارت‌ها */
.analysis-panel {
  padding: 28px;
  overflow-y: auto;
  background: rgba(16, 18, 40, 0.55);
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.18); /* این خط مهمه — مرز چپ یعنی نوار در راست است */
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.card {
  background: rgba(16, 18, 40, 0.55);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.card:last-child {
  margin-bottom: 0;
}

.card h3 {
  font-size: 24px;
  background: linear-gradient(90deg, #48c6ff, #ff4fd8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}

.hint {
  font-size: 15px;
  color: #cdd5ff;
  margin-bottom: 16px;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

input[type="range"] {
  flex: 1;
  height: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.15);
  appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #48c6ff, #ff4fd8);
  box-shadow: 0 0 20px rgba(255, 78, 216, 0.8);
  cursor: pointer;
}

#depthCard {
  display: none;
}

.definitions {
  max-height: 380px; /* افزایش از 260px به 380px — فضای بیشتر برای فرمول‌ها */
  min-height: 300px; /* حداقل ارتفاع تا کارت فشرده نشه */
  overflow-y: auto;
  overflow-x: auto; /* اسکرول افقی حفظ بشه */
  padding: 20px; /* کمی بیشتر برای راحتی */
  background: rgba(16, 18, 40, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  box-sizing: border-box;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px; /* فاصله بهتر بین تعریف‌ها */
}

.def-row {
  margin-bottom: 0; /* حاشیه پایین رو به gap کارت واگذار کن */
}

.math {
  direction: ltr;
  overflow-x: auto;
  white-space: nowrap; /* فرمول‌ها در یک خط بمونن */
  padding: 14px;
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
  font-size: 17px; /* کمی بزرگ‌تر برای خوانایی */
  scrollbar-width: thin;
  scrollbar-color: #48c6ff rgba(0,0,0,0.3);
}

.math::-webkit-scrollbar {
  height: 10px;
}

.math::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
}

.math::-webkit-scrollbar-thumb {
  background: #48c6ff;
  border-radius: 10px;
}

.math::-webkit-scrollbar-thumb:hover {
  background: #ff4fd8;
}