/* ==================================================
   FOSCP – Small & Compact Bottom-Right Popup (RTL)
================================================== */

:root {
  /* Glassmorphism Variables */
  --foscp-blur: 10px;
  --foscp-bg-color: rgba(30, 41, 59, 0.75); /* Slate-800 slightly less transparent */
  --foscp-border-color: rgba(255, 255, 255, 0.15);
  --foscp-text: #e2e8f0; /* Slate-200 */
  --foscp-title: #ffffff;
  --foscp-accent: #ff830f; /* 👈 نارنجی */
  --foscp-radius: 14px; /* کوچک‌تر */
}



/* ✅ Popup - Positioning: BOTTOM-RIGHT for Desktop */
.foscp-popup {
  position: fixed;
  bottom: 20px; /* فاصله از پایین */
  right: 20px;  /* فاصله از راست */
  width: min(90vw, 350px); /* کوچک و جمع و جور */
  padding: 20px; /* کاهش پدینگ */
  border-radius: var(--foscp-radius);
  
  /* Glassmorphism Core */
  background: var(--foscp-bg-color); 
  backdrop-filter: blur(var(--foscp-blur));
  -webkit-backdrop-filter: blur(var(--foscp-blur));
  border: 1px solid var(--foscp-border-color);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--foscp-border-color);

  color: var(--foscp-text);
  direction: rtl;
  font-family: 'Vazirmatn', system-ui, sans-serif; /* استفاده از فونت موجود در فایل شما */
  z-index: 99999;

  animation: foscp-slide-in 0.4s ease-out; /* انیمیشن جدید برای اسلاید از پایین */
}

/* ✅ Animation (Slide from Bottom-Right) */
@keyframes foscp-slide-in {
  from {
    opacity: 0;
    transform: translate(20px, 20px); /* شروع از پایین و راست */
  }
  to {
    opacity: 1;
    transform: translate(0, 0);
  }
}

/* ✅ Close Button - Small (30x30px) */
.foscp-close {
  position: absolute;
  top: 8px;
  right: 8px; 
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none; 
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}

.foscp-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

/* ✅ Content Adjustments for Compact Look */
.foscp-content {
  text-align: center;
}

.foscp-title {
  margin: 0 0 10px; /* کاهش فضا در بالا */
  font-size: 17px; /* کوچک‌تر */
  font-weight: 900;
  color: var(--foscp-title);
}

/* ✅ Text - Perfect Center Alignment & Layout Balance */
.foscp-text {
  display: block;
  max-width: 90%;
  margin: 0 auto 15px; /* وسط‌چین و فاصله متعادل پایین */
  font-size: 13px;
  line-height: 2.2;
  text-align: center; /* حتماً وسط‌چین شود */
  color: var(--foscp-text);
  opacity: 0.9;

  padding: 0 4px;
}


/* ✅ Button - Minimal Glassmorphism Orange (Compact Version) */
.foscp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 160px; /* 👈 عرض مناسب و مینیمال */
  min-height: 42px;
  padding: 0 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;

  background: linear-gradient(135deg, #ff830f 15%, #ff9e50 85%);
  color: #101010;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.2px;

  box-shadow: 0 4px 12px rgba(255, 131, 15, 0.35), inset 0 0 6px rgba(255,255,255,0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  transition: all 0.2s ease;
}

.foscp-btn:hover {
  filter: brightness(1.18);
  transform: scale(1.03) translateY(-2px);
  box-shadow: 0 6px 14px rgba(255, 131, 15, 0.45), inset 0 0 8px rgba(255,255,255,0.2);
}

.foscp-btn:active {
  transform: scale(0.97);
  box-shadow: 0 3px 8px rgba(255, 131, 15, 0.25) inset;
}



/* ✅ Loader & Counter */
.foscp-loader-container {
    gap: 8px; 
    margin-bottom: 15px; 
}

.foscp-loader-bar {
    height: 4px; /* نوار باریک‌تر */
}

.foscp-counter {
    font-size: 12px; /* کوچک‌تر */
}

/* ✅ Mobile Adjustments: Revert to Center for better UX on small screens */
@media (max-width: 767px) {
  .foscp-popup {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* مرکزیت در موبایل */
    bottom: auto; 
    right: auto;
    width: min(92vw, 360px);
    padding: 25px;
  }
  @keyframes foscp-slide-in {
    from {
        opacity: 0;
        transform: translate(-50%, -55%); /* حرکت از بالا برای موبایل */
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
  }
}
