/* Universal modal komponenti. Foydalanish:
 *   <div class="rtd-modal">
 *     <div class="rtd-modal__card">
 *       <div class="rtd-modal__head">
 *         <strong class="rtd-modal__title">Sarlavha</strong>
 *         <button class="rtd-modal__close">×</button>
 *       </div>
 *       <div class="rtd-modal__body">...</div>
 *       <div class="rtd-modal__footer">
 *         <button class="rtd-modal__btn rtd-modal__btn--cancel">Отмена</button>
 *         <button class="rtd-modal__btn rtd-modal__btn--danger">Удалить</button>
 *       </div>
 *     </div>
 *   </div>
 */

.rtd-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.rtd-modal__card {
  background: #fff;
  border-radius: 10px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
}

.rtd-modal__head {
  padding: 14px 18px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rtd-modal__title { font-weight: 700; }
.rtd-modal__title--danger { color: #7a0c0c; }

.rtd-modal__close {
  background: none;
  border: 0;
  font-size: 20px;
  cursor: pointer;
  color: #666;
  line-height: 1;
}

.rtd-modal__body {
  padding: 14px 18px;
  overflow: auto;
}

.rtd-modal__footer {
  padding: 12px 18px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.rtd-modal__btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid #ccc;
  background: #eee;
}
.rtd-modal__btn--cancel { background: #eee; }
.rtd-modal__btn--danger { background: #7a0c0c; color: #fff; border: 0; }
.rtd-modal__btn:disabled { opacity: .6; cursor: not-allowed; }

/* Modal ichidagi ogohlantirish kartochkasi (warning banner) */
.rtd-modal__warning {
  background: #fff3cd;
  border: 1px solid #ffeeba;
  color: #856404;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 8px;
}
.rtd-modal__warning b { font-weight: 700; }

/* Preview (lightbox) — foto/video uchun ko'rsatish */
.rtd-modal--preview .rtd-modal__card.rtd-preview__card {
  max-width: min(92vw, 1100px);
  width: auto;
}
.rtd-preview__body {
  padding: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 80vh;
  overflow: hidden;
}
.rtd-preview__media {
  display: block;
  max-width: 92vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
}
/* Thumb tugmasi link o'rniga */
.rtd-file-item__link {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.rtd-file-item__link:focus-visible {
  outline: 2px solid var(--primary, #2c7be5);
  outline-offset: 2px;
}
