/* popup.css - نسخه نهایی با دکمه بستن */
:root {
  --pi-accent: #ff5a5f;
  --pi-accent-hover: #ff4146;
  --pi-bg-overlay: rgba(15, 23, 42, 0.65);
  --pi-radius: 16px;
  --pi-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  --pi-font-family: inherit;
  --pi-z-index: 999999;
}

@keyframes piFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes piSlideUp { from { opacity: 0; transform: translateY(20px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

.pi-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--pi-bg-overlay);
  z-index: calc(var(--pi-z-index) - 1);
  backdrop-filter: blur(5px);
  animation: piFadeIn 0.2s;
}

.pi-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 420px;
  background: white;
  border-radius: 12px;
  z-index: var(--pi-z-index);
  box-shadow: var(--pi-shadow);
  animation: piSlideUp 0.3s;
  font-family: var(--pi-font-family);
  direction: rtl;
}

.pi-modal-content {
  padding: 24px;
  position: relative; /* برای جایگذاری دکمه بستن */
}

.pi-modal h4 {
  margin: 0 0 10px;
  font-size: 18px;
  color: #1a1a1a;
}

.pi-modal p {
  margin: 0 0 20px;
  font-size: 14px;
  color: #666;
  line-height: 1.6;
}

/* دکمه بستن */
.pi-modal-close {
  position: absolute;
  top: 8px;
  left: 8px;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.pi-modal-close:hover {
  color: #333;
  background: #f5f5f5;
}

/* چک‌باکس */
.pi-modal-extra {
  margin-bottom: 20px;
}

.pi-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #555;
  cursor: pointer;
}

.pi-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* دکمه‌ها */
.pi-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.pi-btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
}

.pi-btn-primary {
  background: var(--pi-accent);
  color: white;
  box-shadow: 0 4px 10px rgba(255, 90, 95, 0.25);
}

.pi-btn-primary:hover {
  background: var(--pi-accent-hover);
  transform: translateY(-2px);
  color: white;
}

.pi-btn-ghost {
  background: transparent;
  color: #666;
  border-color: #eee;
}

.pi-btn-ghost:hover {
  background: #f9f9f9;
  color: #333;
}

@media (max-width: 600px) {
  .pi-modal-actions {
    flex-direction: column-reverse;
  }
  .pi-btn {
    width: 100%;
  }
  .pi-modal {
    max-width: 90%;
  }
}