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

:root {
  --primary: #FF4444;
  --primary-dark: #CC2222;
  --primary-light: #FFF0F0;
  --bg: #F7F8FA;
  --white: #FFFFFF;
  --text: #1A1A2E;
  --text-light: #6B7280;
  --border: #E5E7EB;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(255,68,68,0.15);
  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ───── Header ───── */
header {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(255,68,68,0.3);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 60px;
  padding: 0 20px;
  gap: 32px;
}

.logo {
  color: white;
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.logo span { opacity: 0.75; font-weight: 400; }

nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

nav a {
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  transition: background 0.15s;
  white-space: nowrap;
}

nav a:hover { background: rgba(255,255,255,0.18); color: white; }

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ───── Hero ───── */
.hero {
  background: linear-gradient(135deg, #FF4444 0%, #FF6B6B 100%);
  padding: 56px 20px 80px;
  text-align: center;
}

.hero h1 {
  color: white;
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.hero p {
  color: rgba(255,255,255,0.88);
  font-size: 1.05rem;
  max-width: 500px;
  margin: 0 auto;
}

/* ───── Tools Section ───── */
.tools-section {
  max-width: 1200px;
  margin: -36px auto 0;
  padding: 0 20px 80px;
}

.category-block { margin-bottom: 40px; }

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.category-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.category-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 16px;
}

.tool-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 16px 22px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid transparent;
  display: block;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(255,68,68,0.15);
}

.tool-icon {
  font-size: 2.8rem;
  margin-bottom: 14px;
  display: block;
}

.tool-name {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 7px;
  color: var(--text);
}

.tool-desc {
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.45;
}

/* ───── Tool Page Layout ───── */
.tool-page {
  max-width: 780px;
  margin: 40px auto 80px;
  padding: 0 20px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 28px;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

.tool-header {
  text-align: center;
  margin-bottom: 36px;
}

.tool-header-icon {
  font-size: 3.5rem;
  margin-bottom: 14px;
  display: block;
}

.tool-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.tool-header p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ───── Drop Zone ───── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 64px 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: white;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.drop-zone-icon { font-size: 3.5rem; margin-bottom: 14px; display: block; }

.drop-zone h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.drop-zone p {
  color: var(--text-light);
  font-size: 0.88rem;
  margin-bottom: 20px;
}

.btn-select {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 11px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  transition: background 0.15s;
}

.btn-select:hover { background: var(--primary-dark); }

/* ───── File List ───── */
.file-list-panel {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
  box-shadow: var(--shadow);
}

.file-list-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #F9FAFB;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.file-item:last-child { margin-bottom: 0; }

.file-item-icon { font-size: 1.4rem; flex-shrink: 0; }

.file-item-info { flex: 1; min-width: 0; }

.file-item-name {
  font-weight: 500;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item-size {
  font-size: 0.76rem;
  color: var(--text-light);
}

.file-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #CBD5E0;
  font-size: 1.2rem;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
  flex-shrink: 0;
}

.file-item-remove:hover { color: var(--primary); }

/* ───── Options Panel ───── */
.options-panel {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
  box-shadow: var(--shadow);
}

.options-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.option-row:last-child { margin-bottom: 0; }

.option-label {
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 100px;
  color: var(--text);
}

.option-control { flex: 1; }

.option-control select,
.option-control input[type="text"],
.option-control input[type="number"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: #F9FAFB;
  outline: none;
  transition: border-color 0.15s;
}

.option-control select:focus,
.option-control input:focus {
  border-color: var(--primary);
  background: white;
}

.radio-group {
  display: flex;
  gap: 20px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 0.9rem;
}

.radio-item input { cursor: pointer; accent-color: var(--primary); }

/* ───── Convert Button ───── */
.btn-convert {
  display: block;
  width: 100%;
  background: var(--primary);
  color: white;
  padding: 15px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 24px;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
  letter-spacing: 0.3px;
}

.btn-convert:hover { background: var(--primary-dark); }
.btn-convert:active { transform: scale(0.99); }

.btn-convert:disabled {
  background: #D1D5DB;
  cursor: not-allowed;
  transform: none;
}

/* ───── Progress ───── */
.progress-wrap {
  margin-top: 20px;
  display: none;
}

.progress-label {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.progress-bar {
  background: #E5E7EB;
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, var(--primary), #FF7B7B);
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
  width: 0%;
}

/* ───── Result Panel ───── */
.result-panel {
  background: white;
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 24px;
  box-shadow: var(--shadow);
  display: none;
  border-left: 4px solid #22C55E;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.result-icon { font-size: 1.8rem; }

.result-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.result-subtitle {
  font-size: 0.85rem;
  color: var(--text-light);
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #22C55E;
  color: white;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  font-family: inherit;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-download:hover { background: #16A34A; }

/* ───── Preview Grid ───── */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.preview-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  background: #F3F4F6;
  border: 1px solid var(--border);
}

.preview-item img {
  width: 100%;
  display: block;
  aspect-ratio: 3/4;
  object-fit: contain;
  background: white;
}

.preview-label {
  padding: 6px 8px;
  font-size: 0.72rem;
  text-align: center;
  color: var(--text-light);
  font-weight: 500;
}

/* ───── Features Strip ───── */
.features {
  background: white;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 40px 20px;
}

.features-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  text-align: center;
}

.feature-icon { font-size: 2rem; margin-bottom: 10px; }

.feature-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.feature-desc {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ───── Footer ───── */
footer {
  background: #1F2937;
  color: #9CA3AF;
  padding: 44px 20px 28px;
  margin-top: 60px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.footer-brand .logo-footer {
  color: white;
  font-size: 1.3rem;
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}

.footer-brand p {
  font-size: 0.83rem;
  line-height: 1.6;
  max-width: 260px;
}

.footer-links h4 {
  color: white;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.footer-links a {
  display: block;
  color: #9CA3AF;
  text-decoration: none;
  font-size: 0.83rem;
  margin-bottom: 8px;
  transition: color 0.15s;
}

.footer-links a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-bottom p { font-size: 0.8rem; }

.footer-bottom-links {
  display: flex;
  gap: 20px;
}

.footer-bottom-links a {
  color: #9CA3AF;
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.15s;
}

.footer-bottom-links a:hover { color: white; }

/* ───── Utility ───── */
.badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-top: 16px;
}

.alert-error {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
}

.alert-success {
  background: #F0FDF4;
  color: #16A34A;
  border: 1px solid #BBF7D0;
}

/* ───── Responsive ───── */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.65rem; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  nav { display: none; }
  .footer-top { flex-direction: column; }
  .option-row { flex-direction: column; align-items: flex-start; }
  .option-label { min-width: unset; }
}

@media (max-width: 480px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tool-card { padding: 20px 10px 16px; }
  .tool-icon { font-size: 2.2rem; }
  .drop-zone { padding: 40px 20px; }
  .hero { padding: 36px 20px 60px; }
}
