@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

body {
  background-color: #ffffff;
  box-shadow: none; /* خلفية بيضاء نقية مطابقة للصورة */
  color: #262729;
  overflow-x: clip;
}

.single-course-nav-section {
  width: 100%;
  padding: 24px 40px 0 40px;
  background-color: transparent !important;
  box-shadow: none;
}

.pricing-calculator-section {
  padding: 45px 20px 100px 20px;
  width: 100%;
}

.pricing-container {
  max-width: 650px;
  margin: 0 auto;
}

/* ================= الهيدر العلوي ================= */
.pricing-header {
  text-align: center;
  margin-bottom: 30px;
}

.pricing-top-badge {
  display: inline-block;
  background-color: #fdf2d8;
  color: #e29600;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 6px 14px;
  border-radius: 50px;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.pricing-main-title {
  font-size: 44px;
  font-weight: 700;
  color: #313131;
  line-height: 1.15;
  margin: 0 0 12px 0;
  letter-spacing: -0.6px;
}

.pricing-subtitle {
  font-size: 15px;
  color: #464545b2;
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
}

/* ================= شريط التبديل (Monthly plan / Lesson package) ================= */
.pricing-tabs-wrapper {
  display: flex;
  background-color: #f3f3f3;
  border-radius: 10px;
  padding: 5px;
  max-width: 420px;
  margin: 0 auto 32px auto;
}

.pricing-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 500;
  color: #7a7a7a;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.pricing-tab-btn.active {
  background-color: #e39a06;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(226, 150, 0, 0.25);
}

/* ================= الكارت الأبيض الرئيسي ================= */
.subscription-card-box {
  box-shadow: none;
  border-radius: 20px;
  padding: 36px 34px;
  border: 1px solid #f2f2f2;
  box-shadow: 0 10px 45px rgba(0, 0, 0, 0.05);
}

.box-inner-title {
  font-size: 18px;
  font-weight: 800;
  color: #262729;
  margin: 0 0 26px 0;
  letter-spacing: -0.2px;
}

/* إظهار وإخفاء محتوى التبويبات */
.plan-view-content {
  display: none;
}

.plan-view-content.active {
  display: block;
}

/* ================= الحقول والأزرار داخل الكارت ================= */
.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 400;
  color: #3a3a3a;
  margin-bottom: 10px;
}

.required-star {
  color: #e53935;
  margin-left: 2px;
  font-weight: 600;
}

.label-with-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.label-with-hint .form-label {
  margin-bottom: 0;
}

.recommended-hint {
  font-size: 11.5px;
  font-weight: 700;
  color: #066064;
}

/* 1. أزرار Lesson duration (خلفية بيضاء وإطار رمادي خفيف، والنشط تييل) */
.duration-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.duration-btn {
  box-shadow: none;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  padding: 13px 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: #3a3a3a;
  cursor: pointer;
  transition: all 0.2s ease;
}

.duration-btn:hover {
  border-color: #046868;
}

.duration-btn.active {
  background-color: #046868;
  border-color: #046868;
  color: #ffffff;
}

/* 2. أزرار Preferred teacher (خلفية رمادية فاتحة بدون إطار، والنشط تييل) */
.teacher-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.teacher-btn {
  background-color: #f2f3f5;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 13px 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: #6b6e75;
  cursor: pointer;
  transition: all 0.2s ease;
}

.teacher-btn:hover {
  background-color: #e8eaed;
}

.teacher-btn.active {
  background-color: #046868;
  color: #ffffff;
  font-weight: 700;
}

/* 3. أزرار الأيام من 1 إلى 7 */
.days-number-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.day-num-btn {
  box-shadow: none;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  height: 46px;
  font-size: 16px;
  font-weight: 700;
  color: #7c7c7c;
  cursor: pointer;
  transition: all 0.2s ease;
}

.day-num-btn:hover {
  border-color: #046868;
  color: #046868;
}

.day-num-btn.active {
  background-color: #046868;
  border-color: #046868;
  color: #ffffff;
}

.billing-info-text {
  font-size: 11.5px;
  color: #8c8c8c;
  margin: -6px 0 24px 0;
}

/* ================= تنسيقات التبويب الثاني: Lesson package ================= */
.package-counter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #ebebeb;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 12px;
  box-shadow: none;
}

.counter-bar-info h4 {
  font-size: 13.5px;
  font-weight: 800;
  color: #262729;
  margin: 0 0 3px 0;
}

.counter-bar-info p {
  font-size: 11px;
  color: #8c8c8c;
  margin: 0;
}

.counter-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.counter-btn {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: none;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: opacity 0.2s ease;
}

.counter-btn:hover {
  opacity: 0.88;
}

.btn-minus {
  background-color: #e29600;
}

.btn-plus {
  background-color: #046868;
}

.counter-value {
  font-size: 14px;
  font-weight: 800;
  color: #262729;
  min-width: 18px;
  text-align: center;
}

/* شبكة الباقات الـ 4 */
.package-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.package-preset-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #ebebeb;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.package-preset-card:hover,
.package-preset-card.active {
  border-color: #046868;
  background-color: #f7fbfb;
}

.preset-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.preset-info h4 {
  font-size: 13.5px;
  font-weight: 800;
  color: #262729;
  margin: 0 0 3px 0;
}

.preset-title-row h4 {
  margin: 0;
}

.preset-info p {
  font-size: 11px;
  color: #8c8c8c;
  margin: 0;
}

.best-value-badge {
  background-color: #046868;
  color: #ffffff;
  font-size: 8.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 50px;
  letter-spacing: 0.3px;
}

.discount-pill {
  background-color: #fdf2d8;
  color: #d88c00;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 50px;
  flex-shrink: 0;
}

.package-validity-note {
  font-size: 11.5px;
  color: #888888;
  margin: 4px 0 24px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.validity-check {
  color: #666666;
  font-weight: 700;
}

/* ================= زر التأكيد (Confirm Subscription) ================= */
.btn-confirm-subscription {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background-color: #e39a06;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 15px 20px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}

.btn-confirm-subscription:hover {
  background-color: #cc8600;
  transform: translateY(-1px);
}

.confirm-badge-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ================= المربع المنبثق في منتصف الشاشة (Modal) ================= */
.subscription-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
  padding: 20px;
}

.subscription-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.subscription-modal-box {
  box-shadow: none;
  width: 100%;
  max-width: 520px;
  min-height: 280px;
  border-radius: 20px;
  padding: 32px;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
  transform: scale(0.92);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.subscription-modal-overlay.active .subscription-modal-box {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background-color: #f3f3f3;
  color: #444;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background-color: #e5e5e5;
}

.modal-placeholder-content h3 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 10px;
  color: #262729;
}

.modal-placeholder-content p {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
}

/* ================= Media Queries ================= */
@media (max-width: 680px) {
  .subscription-card-box {
    padding: 24px 18px;
  }
  .pricing-main-title {
    font-size: 30px;
  }
  .duration-grid,
  .teacher-grid,
  .package-cards-grid {
    grid-template-columns: 1fr;
  }
  .days-number-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .label-with-hint {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ================= المربع المنبثق في منتصف الشاشة (YOUR PLAN Modal) ================= */
.subscription-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.28s ease,
    visibility 0.28s ease;
  padding: 20px;
}

.subscription-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.plan-summary-modal {
  background-color: #056365;
  color: #ffffff;
  width: 100%;
  max-width: 570px;
  border-radius: 16px;
  padding: 32px 34px 30px 34px;
  position: relative;
  box-shadow:
    0 18px 50px rgba(5, 99, 101, 0.48),
    0 0 35px rgba(5, 99, 101, 0.28);
  transform: translateY(12px) scale(0.96);
  transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1);
  text-align: left;
}

.subscription-modal-overlay.active .plan-summary-modal {
  transform: translateY(0) scale(1);
}

.plan-modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.your-plan-badge {
  display: inline-block;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 5px 16px;
  border-radius: 50px;
  text-transform: uppercase;
}

.plan-format-text {
  font-size: 15px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.95);
}

.plan-price-block {
  margin-bottom: 24px;
}

.plan-price-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}

.plan-total-price {
  font-size: 46px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  letter-spacing: -1px;
}

.plan-billing-cycle {
  font-size: 16px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
}

.plan-cycle-note {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  font-weight: 400;
}

.plan-modal-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  margin: 0 0 22px 0;
}

.plan-breakdown-list {
  list-style: none;
  padding: 0;
  margin: 0 0 28px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.plan-breakdown-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.breakdown-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-check-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.92);
  color: #056365;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.modal-check-circle svg {
  width: 15px;
  height: 15px;
}

.breakdown-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.breakdown-value {
  font-size: 14.5px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.92);
}

.btn-modal-confirm {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background-color: #e29600;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}

.btn-modal-confirm:hover {
  background-color: #cc8600;
  transform: translateY(-2px);
}

.confirm-badge-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ================= مربع نجاح الطلب (Success Modal) ================= */
.success-modal {
  max-width: 440px;
  padding: 40px 34px 34px 34px;
  text-align: center;
}

.success-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 24px auto;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-icon svg {
  width: 56px;
  height: 56px;
}

/* الدايرة الدهبي بتترسم وبعدها علامة الصح */
.success-circle {
  stroke: #e29600;
  stroke-width: 3;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
}

.success-check {
  stroke: #ffffff;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
}

.subscription-modal-overlay.active .success-icon {
  animation: success-pulse 1.4s ease-out 0.9s;
}

.subscription-modal-overlay.active .success-circle {
  animation: success-draw 0.6s ease-out 0.2s forwards;
}

.subscription-modal-overlay.active .success-check {
  animation: success-draw 0.4s ease-out 0.7s forwards;
}

.success-title {
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.success-text {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 28px;
}

/* شريط بيتملي لحد التحويل للرئيسية (نفس مدة الـ setTimeout في main.js) */
.success-progress {
  height: 5px;
  border-radius: 50px;
  background-color: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.success-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 50px;
  background-color: #e29600;
}

.subscription-modal-overlay.active .success-progress span {
  animation: success-progress 3s linear forwards;
}

@keyframes success-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes success-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(226, 150, 0, 0.45);
  }
  100% {
    box-shadow: 0 0 0 22px rgba(226, 150, 0, 0);
  }
}

@keyframes success-progress {
  to {
    width: 100%;
  }
}

@media (max-width: 540px) {
  .plan-summary-modal {
    padding: 24px 20px;
  }
  .success-title {
    font-size: 24px;
  }
  .plan-total-price {
    font-size: 38px;
  }
  .breakdown-title {
    font-size: 14.5px;
  }
}
