/* /var/www/html/assets/css/image-resize.css : 이미지 리사이즈 페이지 전용 스타일 */

.rz-tool {
  margin-top: 8px;
}

/* 업로드 드롭존 */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 180px;
  padding: 28px 20px;
  text-align: center;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  border: 2px solid currentColor;
  border-radius: 10px;
  position: relative;
  opacity: 0.85;
}

.dropzone-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 22%;
  width: 3px;
  height: 46%;
  background: currentColor;
  transform: translateX(-50%);
}

.dropzone-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 22%;
  width: 16px;
  height: 16px;
  border-left: 3px solid currentColor;
  border-top: 3px solid currentColor;
  transform: translate(-50%, 0) rotate(45deg);
}

.dropzone-title {
  font-weight: 700;
  font-size: 1rem;
}

.dropzone-sub {
  font-size: 0.85rem;
  color: var(--muted);
}

/* 리사이즈 설정 패널 */
.rz-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px 16px;
  margin: 18px 0 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.rz-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rz-field[hidden] { display: none; }

.rz-field label {
  font-size: 0.82rem;
  color: var(--muted);
}

.rz-field select,
.rz-field input[type="number"] {
  appearance: none;
  width: 100%;
  padding: 9px 10px;
  font-size: 0.9rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.rz-field select:focus,
.rz-field input:focus {
  outline: none;
  border-color: var(--text);
}

.rz-field input[type="range"] {
  width: 100%;
  accent-color: var(--text);
}

.rz-field output {
  color: var(--text);
  font-weight: 700;
}

/* 비율 유지 체크박스 */
.rz-field-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  align-self: end;
  padding-bottom: 9px;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}

.rz-field-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--text);
  cursor: pointer;
}

/* 상단 도구 바 */
.rz-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 6px;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--text);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--text);
  color: #111;
  border-color: var(--text);
}

.btn-primary:hover:not(:disabled) {
  background: #ffffff;
}

.btn-ghost {
  background: transparent;
}

.rz-counter {
  margin-left: auto;
  font-size: 0.88rem;
  color: var(--muted);
}

.rz-note {
  min-height: 1.2em;
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

/* 이미지 카드 그리드 */
.rz-grid {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.rz-item {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  overflow: hidden;
}

.rz-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  background: transparent;
}

.rz-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.rz-status {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
}

.rz-status[data-status="done"] { background: #1f7a3d; }
.rz-status[data-status="processing"] { background: #9a6a00; }
.rz-status[data-status="error"] { background: #a32020; }

.rz-item-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 12px;
}

.rz-item-name {
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rz-item-dims {
  font-size: 0.8rem;
  color: var(--muted);
}

.rz-item-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rz-item-actions-row {
  display: flex;
  gap: 8px;
}

.rz-item-actions .btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 0.82rem;
  white-space: nowrap;
}

/* 처리중 스피너 */
.rz-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: rz-spin 0.8s linear infinite;
}

@keyframes rz-spin {
  to { transform: rotate(360deg); }
}

/* 안내/FAQ 영역 */
.rz-guide {
  margin-top: 34px;
}

.rz-guide h2 {
  font-size: 1.15rem;
  margin: 0 0 12px;
}

.rz-guide h3 {
  font-size: 0.98rem;
  margin: 16px 0 4px;
}

.rz-guide p,
.rz-guide li {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.6;
}

.rz-guide ol,
.rz-guide ul {
  margin: 0;
  padding-left: 20px;
}

@media (max-width: 520px) {
  .rz-counter { margin-left: 0; width: 100%; }
  .rz-toolbar .btn { flex: 1; }
}

/* ---------- 개별 이미지 편집 모달 ---------- */
.rz-editor {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.68);
}

.rz-editor[hidden] { display: none; }

.rz-editor-panel {
  width: min(560px, 100%);
  max-height: 92vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text);
}

.rz-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rz-editor-head h2 { margin: 0; font-size: 1.1rem; }

.rz-editor-close {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.rz-editor-hint {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.rz-editor-preview {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 46vh;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.rz-editor-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.rz-editor-controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 12px 16px;
}

.rz-editor-info {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.rz-editor-actions {
  display: flex;
  gap: 10px;
}

.rz-editor-actions .btn { flex: 1; }

@media (max-width: 520px) {
  .rz-editor-controls { grid-template-columns: 1fr 1fr; }
  .rz-editor-controls .rz-field-check { grid-column: 1 / -1; align-self: start; padding-bottom: 0; }
}
