/* static/css/earth.css
   =========================================================================
   صفحة الأرض — قرص جيلسون (لوحتان متراكبتان) + لوحة تحكّم زمني.
   تعتمد متغيّرات الثيم العامة (style.css) لدعم الوضعين الليلي/النهاري.
   نقل تخطيط EarthPage في فلاتر: صورة بعرض كامل أعلى العمود، والأدوات تحتها.
   ========================================================================= */

.earth-page {
  display: flex;
  flex-direction: row;            /* الأرض يساراً واللوحة يميناً */
  align-items: center;
  justify-content: flex-start;
  gap: clamp(16px, 4vw, 48px);
  direction: ltr;                 /* تثبيت الترتيب يسار→يمين؛ النص العربي يستعيد rtl داخل اللوحة */
  width: 100%;
  margin: 0 auto;
  padding: 12px 20px 24px;
  font-family: var(--font-main);
  color: var(--text-main);
}

/* القرص: حاوية مربّعة تُقصّ دائرياً (مكافئ ClipOval) — أصغر قليلاً وتتّسع للشاشة */
.earth-map {
  position: relative;
  flex: 0 0 auto;
  width: min(48vw, 90vh);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
  box-shadow: var(--main-shadow, 0 8px 36px 0 rgba(74, 92, 124, 0.18));
}

/* اللوحتان تملآن الحاوية وتتراكبان */
.earth-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#earth-overlay {
  pointer-events: none; /* تمرير التفاعل للوحة السفلية إن لزم */
}

/* =======================================================================
   لوحة التحكّم الزمني
   ======================================================================= */
.earth-controls {
  flex: 1 1 auto;
  max-width: 440px;
  direction: rtl;                 /* استعادة اتجاه النص العربي داخل اللوحة */
  padding: 6px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* مساحة ثابتة لشارة «مباشر» كي لا يقفز المحتوى */
.earth-live-slot {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.earth-live-badge {
  display: none;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 82, 82, 0.9);
  border-radius: 10px;
}
.earth-live-slot.is-live .earth-live-badge {
  display: inline-block;
}

/* صفوف التسمية */
.earth-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.earth-khaliq-label {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-main);
}
.earth-khaliq-time {
  font-size: 30px;
  color: var(--text-main);
}
.earth-greg-label {
  font-size: 30px;
  font-weight: 600;
  color: var(--text-main);
}
.earth-greg-time {
  font-size: 30px;
  color: var(--text-main);
}
.earth-season {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, rgba(60, 70, 90, 0.7));
  margin-bottom: 8px;
}

/* قفزات للأمام */
.earth-jumps {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-bottom: 10px;
}
.earth-jump {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 6px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
  background: transparent;
  border: 1px solid var(--card-border, rgba(0, 0, 0, 0.18));
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.earth-jump:hover {
  background: var(--card-bg, rgba(0, 0, 0, 0.04));
}
.earth-jump i {
  font-size: 12px;
  opacity: 0.7;
}

/* السرعة + الآن */
.earth-speed-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.earth-speed-btn,
.earth-now-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.earth-speed-btn {
  color: var(--text-main);
  background: var(--card-bg, rgba(0, 0, 0, 0.06));
  border: 1px solid transparent;
}
.earth-speed-btn.is-active {
  color: #fff;
  background: var(--accent, #2a6df4);
}
.earth-now-btn {
  color: var(--text-main);
  background: transparent;
  border: 1px solid var(--card-border, rgba(0, 0, 0, 0.18));
}
.earth-now-btn:hover {
  background: var(--card-bg, rgba(0, 0, 0, 0.04));
}

/* الوضع الليلي: حدود وخلفيات أنعم */
:root[data-theme='dark'] .earth-jump,
:root[data-theme='dark'] .earth-now-btn {
  border-color: rgba(255, 255, 255, 0.18);
}
:root[data-theme='dark'] .earth-jump:hover,
:root[data-theme='dark'] .earth-now-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}
:root[data-theme='dark'] .earth-speed-btn {
  background: rgba(255, 255, 255, 0.08);
}

/* الشاشات المتوسطة/الضيقة: العودة للتكديس العمودي (الأرض فوق، اللوحة تحت) */
@media (max-width: 900px) {
  .earth-page {
    flex-direction: column;
    direction: rtl;
    align-items: center;
    max-width: 560px;
    padding: 6px 12px 24px;
  }
  .earth-map {
    width: min(92vw, 70vh);
  }
  .earth-controls {
    width: 100%;
    max-width: 100%;
  }
}

/* الهاتف */
@media (max-width: 600px) {
  .earth-page {
    padding: 4px 8px 20px;
  }
  .earth-jump {
    font-size: 13px;
    padding: 8px 4px;
  }
}
