/**
 * 관리자 모달 시스템 CSS
 */

/* Bootstrap 표준 모달 크기 확장 */
.admin-modal .modal-dialog {
  max-width: 600px;
}

.admin-modal .modal-dialog.modal-sm {
  max-width: 400px;
}

.admin-modal .modal-dialog.modal-lg {
  max-width: 900px;
}

.admin-modal .modal-dialog.modal-xl {
  max-width: 1200px;
}

.admin-modal .modal-content {
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.admin-modal.admin-modal-resizable .modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
}

.admin-modal .modal-header {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-bottom: 1px solid #dee2e6;
  border-radius: 0.75rem 0.75rem 0 0;
  padding: 1.25rem 1.5rem;
}

.admin-modal .modal-title {
  font-weight: 600;
  font-size: 1.125rem;
  color: #495057;
}

.admin-modal .modal-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.admin-modal.admin-modal-resizable .modal-body {
  max-height: none;
  flex: 1 1 auto;
  min-height: 0;
}

.admin-modal .modal-footer {
  border-top: 1px solid #dee2e6;
  padding: 1rem 1.5rem;
  background: #f8f9fa;
  border-radius: 0 0 0.75rem 0.75rem;
}

.admin-modal .admin-modal-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 22px;
  height: 22px;
  cursor: nwse-resize;
  z-index: 5;
}

.admin-modal .admin-modal-resize-handle::before {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(108, 117, 125, 0.8);
  border-bottom: 2px solid rgba(108, 117, 125, 0.8);
}

body.admin-modal-resizing {
  cursor: nwse-resize;
  user-select: none;
}

/* 모달 폼 스타일 */
.admin-modal-form .form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.admin-modal-form .required {
  color: #dc3545;
}

.admin-modal-form .form-text {
  font-size: 0.875rem;
  color: #6c757d;
}

/* 2컬럼 레이아웃 */
.admin-modal-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .admin-modal-2col {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* 라디오 그룹 */
.admin-modal-form .radio-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-modal-form .radio-group .form-check {
  margin: 0;
}

/* 입력 그룹 검색 */
.input-group-search {
  display: flex;
  gap: 0.5rem;
}

.input-group-search .form-control {
  flex: 1;
}

.input-group-search .btn {
  flex-shrink: 0;
}

/* 모달 알림 스타일 */
.admin-modal-alert {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  min-width: 300px;
  max-width: 500px;
}

.admin-modal-alert .alert {
  margin: 0;
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 로딩 오버레이 */
.admin-modal-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  border-radius: 0.75rem;
}

/* 확장된 모달 사이즈들 */
.admin-modal .modal-dialog.modal-xxl {
  max-width: 1400px;
  width: 95%;
}

.admin-modal .modal-dialog.modal-full {
  max-width: 95vw;
  width: 95vw;
  height: 95vh;
  margin: 2.5vh auto;
}

.admin-modal .modal-dialog.modal-full .modal-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.admin-modal .modal-dialog.modal-full .modal-body {
  flex: 1;
  overflow-y: auto;
}

.admin-modal .modal-dialog.modal-custom {
  /* 커스텀 사이즈는 JavaScript에서 인라인 스타일로 적용 */
}

/* 반응형 지원 */
@media (max-width: 768px) {
  .admin-modal .modal-dialog.modal-xxl,
  .admin-modal .modal-dialog.modal-full {
    max-width: 95%;
    width: 95%;
    margin: 1rem auto;
  }

  .admin-modal .modal-dialog.modal-full {
    height: 90vh;
  }

  .admin-modal .admin-modal-resize-handle {
    display: none;
  }
}
