/* ============================================================
   reminders.css — استایل مودال، فرم، و toast
   هماهنگ با calendar.css (رنگ طلایی، گردی، فونت)
   ============================================================ */

/* ============================================================
   Backdrop مشترک
   ============================================================ */
.rm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
}

.rm-backdrop.show {
  opacity: 1;
  visibility: visible;
}

/* ============================================================
   مودال اصلی
   ============================================================ */
.rm-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.rm-backdrop.show .rm-modal {
  transform: translateY(0);
}

.rm-modal-header {
  background: linear-gradient(180deg, #e9b423, #d69a0e);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 17px;
}

.rm-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rm-modal-close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  border-radius: 6px;
  transition: background 0.15s;
}

.rm-modal-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.rm-modal-body {
  padding: 5px 10px;
  overflow-y: auto;
  flex: 1;
}
.rm-global-badge {
  display: inline-block;
  padding: 2px 6px;
  margin-right: 6px;
  background: #e8f5e9;
  color: #2e7d32;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
}
.rm-modal-footer {
  padding: 12px 18px;
  background: #faf8f2;
  border-top: 1px solid #eee4c9;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ============================================================
   دکمه‌ها
   ============================================================ */
.rm-btn {
  border: 0;
  border-radius: 8px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s, background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rm-btn:hover { filter: brightness(0.95); }

.rm-btn-primary {
  background: linear-gradient(180deg, #e9b423, #d69a0e);
  color: #fff;
}

.rm-btn-success {
  background: linear-gradient(180deg, #43a047, #2e7d32);
  color: #fff;
}

.rm-btn-danger {
  background: linear-gradient(180deg, #e53935, #c62828);
  color: #fff;
}

.rm-btn-ghost {
  background: #f4f3ee;
  color: #555;
  border: 1px solid #e0ddd2;
}

.rm-btn-icon {
  background: transparent;
  border: 0;
  padding: 5px 8px;
  font-size: 15px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}

.rm-btn-icon:hover { background: #f4f3ee; }

/* ============================================================
   جدول رویدادها
   ============================================================ */
.rm-table-wrap {
  overflow-x: auto;
  border: 1px solid #eee4c9;
  border-radius: 10px;
}

.rm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.rm-table th {
  background: linear-gradient(180deg, #fef9ed, #fdf3dc);
  color: #5a4500;
  padding: 10px 8px;
  text-align: right;
  font-weight: 700;
  border-bottom: 1px solid #f0e6d0;
  white-space: nowrap;
}

.rm-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #f5f5f5;
  vertical-align: middle;
}

.rm-table tr:last-child td { border-bottom: 0; }

.rm-table tr:hover td { background: #fffdf7; }

.rm-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  background: #f0e6d0;
  color: #5a4500;
}

.rm-type-badge.once    { background: #e3f2fd; color: #1565c0; }
.rm-type-badge.daily   { background: #e8f5e9; color: #2e7d32; }
.rm-type-badge.monthly { background: #fff3e0; color: #e65100; }
.rm-type-badge.yearly  { background: #f3e5f5; color: #6a1b9a; }

.rm-empty {
  text-align: center;
  color: #999;
  padding: 30px 10px;
  font-size: 14px;
}

/* ============================================================
   فرم افزودن/ویرایش
   ============================================================ */
.rm-form-group {
  margin-bottom: 5px;
}

.rm-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #5a4500;
  margin-bottom: 6px;
}

.rm-form-group input[type="text"],
.rm-form-group input[type="time"],
.rm-form-group input[type="number"],
.rm-form-group input[type="password"],
.rm-form-group textarea,
.rm-form-group select {
  width: 80%;
  border: 1px solid #d7d0bd;
  border-radius: 8px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}

.rm-form-group input:focus,
.rm-form-group textarea:focus,
.rm-form-group select:focus {
  border-color: #e0a719;
  box-shadow: 0 0 0 3px rgba(224, 167, 25, 0.15);
}

.rm-form-group textarea {
  min-height: 70px;
  resize: vertical;
}

.rm-type-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.rm-type-options label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  border: 2px solid #e0ddd2;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #555;
  background: #fff;
  transition: all 0.15s;
  margin: 0;
}

.rm-type-options input[type="radio"] {
  display: none;
}

.rm-type-options input[type="radio"]:checked + span {
  color: #fff;
}

.rm-type-options label:has(input:checked) {
  background: linear-gradient(180deg, #e9b423, #d69a0e);
  border-color: #d69a0e;
  color: #fff;
}

.rm-date-info {
  background: #fffdf7;
  border: 1px dashed #e0d3a8;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: #5a4500;
  margin-bottom: 14px;
}

/* ============================================================
   Toast
   ============================================================ */
.rm-toast-container {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  pointer-events: none;
}

.rm-toast {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  border-right: 5px solid #e9b423;
  padding: 12px 14px;
  pointer-events: auto;
  animation: rmSlideIn 0.3s ease;
  direction: rtl;
}

.rm-toast.removing {
  animation: rmSlideOut 0.25s ease forwards;
}

@keyframes rmSlideIn {
  from { transform: translateX(-120%); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

@keyframes rmSlideOut {
  from { transform: translateX(0);     opacity: 1; }
  to   { transform: translateX(-120%); opacity: 0; }
}

.rm-toast-title {
  font-weight: 700;
  font-size: 14px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.rm-toast-title::before {
  content: "🔔";
  font-size: 15px;
}

.rm-toast-body {
  font-size: 13px;
  color: #555;
  line-height: 1.7;
  margin-bottom: 4px;
}

.rm-toast-meta {
  font-size: 11px;
  color: #999;
  margin-bottom: 8px;
}

.rm-toast-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.rm-toast-actions button {
  border: 0;
  border-radius: 6px;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s;
}

.rm-toast-actions button:hover { filter: brightness(0.95); }

.rm-toast-dismiss {
  background: #f4f3ee;
  color: #555;
}

.rm-toast-cancel {
  background: #e53935;
  color: #fff;
}
/* ============================================================
   بخش کلیک‌پذیر Toast
   ============================================================ */
.rm-toast-clickable {
  cursor: pointer;
  padding: 2px 0;
  border-radius: 6px;
  transition: background 0.15s;
}

.rm-toast-clickable:hover {
  background: #fffdf5;
}

.rm-toast-clickable:hover .rm-toast-title {
  color: #b8941e;
}

.rm-toast-clickable:active {
  background: #fff8e6;
}
.rm-toast-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   موبایل
   ============================================================ */
@media (max-width: 720px) {
  .rm-modal { max-height: 95vh; }

  .rm-type-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .rm-toast-container {
    left: 8px;
    right: 8px;
    max-width: none;
  }

  .rm-table th,
  .rm-table td {
    padding: 8px 6px;
    font-size: 12px;
  }
}