@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;700&display=swap");

:root {
  --bg1: #f6f8fb;
  --bg2: #e9eef7;
  --card: #ffffff;
  --text: #1a2433;
  --muted: #5a6b86;
  --primary: #0e5ab7;
  --primary-strong: #0a4286;
  --line: #d6dfed;
  --danger: #c53030;
  --done: #1f8f51;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 10%, #ffffff 0%, var(--bg1) 38%, var(--bg2) 100%);
  min-height: 100vh;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px 16px;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 30px rgba(23, 42, 67, 0.08);
}

h2 {
  margin: 0 0 8px;
}

.drop-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #2a3f61;
}

.drop-desc {
  margin: 0;
  color: var(--muted);
}

.file-label {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
}

.file-label:hover {
  background: var(--primary-strong);
}

.file-limit {
  margin: 0;
  color: var(--muted);
}

.actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  border: none;
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.15;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.primary:hover:not(:disabled) {
  background: var(--primary-strong);
}

.secondary {
  background: #edf2fa;
  color: #1f3557;
}

.preview-card {
  min-height: 720px;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.preview-header h2 {
  margin: 0;
}

.download-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-dropzone {
  margin-top: 10px;
  border: 2px dashed #9fb4d8;
  border-radius: 14px;
  background: #f7fbff;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
  cursor: pointer;
  padding: 10px;
  min-height: 870px;
  height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-dropzone.drag-over {
  border-color: var(--primary);
  background: #eef5ff;
  transform: translateY(-2px);
}

.preview-dropzone.preview-locked {
  cursor: default;
}

.preview-dropzone.preview-ready .preview-viewport {
  cursor: text;
}

.preview-status {
  flex: 0 0 auto;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
  color: #29446e;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 10px;
}

.preview-status.error {
  color: var(--danger);
}

.preview-empty {
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  color: var(--muted);
  background: #f8fbff;
}

.preview-wrap-inner {
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-viewport {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border-radius: 8px;
  background: #eef3fb;
  padding: 12px;
}

.preview-iframe {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  cursor: text;
}

.mobile-preview-fallback {
  height: 100%;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f1f6ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px;
  text-align: center;
  color: #29446e;
}

.mobile-preview-fallback p {
  margin: 0;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 960px) {
  .container {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .card {
    position: static;
  }
}

@media (max-width: 959px) {
  .preview-dropzone {
    min-height: 620px;
    height: 70vh;
  }
}
