:root {
  --bg-color: #f8f9fa;
  --accent: #111;
  --border: #ddd;
  --font: 'Noto Sans KR', sans-serif;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background-color: var(--bg-color);
  color: var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  transition: all 0.3s ease;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: white;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.05);
  text-align: center;
  width: 400px;
  transition: 0.3s ease;
}

.title {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 25px;
  letter-spacing: -0.5px;
}

.upload-area {
  width: 100%;
  height: 250px;
  border: 2px dashed var(--border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #fafafa;
  font-size: 0.95rem;
  color: #777;
  transition: all 0.25s ease;
}

.upload-area:hover {
  border-color: var(--accent);
  background-color: #f1f1f1;
  color: var(--accent);
}

#fileInput {
  display: none;
}

img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  object-fit: cover;
}

button {
  margin-top: 25px;
  background-color: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 28px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  letter-spacing: 0.5px;
}

button:hover {
  background-color: #333;
}

.result {
  margin-top: 20px;
  font-size: 1rem;
  color: #444;
}

footer {
  width: 100%;
  margin-top: 20px;
  font-size: 0.9rem;
  color: #888;
  text-align: center;
}

.label {
  margin: 2px 0;
  font-size: 12px;
}

.creator {
  text-align: center;
}

.source {
  margin-top: 8px;
}

.source a {
  color: #000000;
  text-decoration: underline;
  font-weight: bold;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-box {
  background: #ffffff;
  border-radius: 14px;
  padding: 24px;
  width: 320px;
  text-align: left;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0; transform: scale(0.92);
  }

  to {
    opacity: 1; transform: scale(1);
  }
}

.modal-content p {
  font-size: 16px;
  margin: 6px 0;
}

.modal-close {
  width: 100%;
  margin-top: 18px;
  padding: 10px 0;
  background: black;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
}

.modal-close:hover {
  background: #333;
}

.bar {
  margin: 14px 0;
}

.bar-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.bar-score {
  font-size: 15px;
  font-weight: 600;
}

.bar-label {
  font-size: 16px;
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.bar-bg {
  width: 100%;
  height: 14px;
  background: #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #000 0%, #666 100%);
  border-radius: 8px;
  transition: width 0.7s ease-out;
}

.input-field {
  width: 100%;
  position: relative;
  margin-top: 24px;
}

.input-field input {
  width: 100%;
  padding: 14px 12px;
  border: 2px solid #00000020;
  border-radius: 8px;
  outline: none;
  font-size: 14px;
  color: #333333;
  box-sizing: border-box;
  transition: box-shadow 0.2s, background 0.2s;
}

.input-field label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: rgba(0, 0, 0, 0.5);
  pointer-events: none;
  transition: all 0.2s ease;
}

.input-field input:focus + label,
.input-field input:not(:placeholder-shown) + label {
  top: -2px;
  left: 12px;
  font-size: 14px;
  color: #000000;
  background: #ffffff;
  padding: 0 4px;
  border-radius: 4px;
}

.input-field input:focus {
  background: #ffffff;
  border: 2px solid #000000;
}

button.loading {
  pointer-events: none;
  background-color: #444 !important;
  position: relative;
  color: transparent !important;
}

button.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  border: 3px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@media (max-width: 768px) {
  .container {
    width: 85%;
    padding: 30px;
  }

  .upload-area {
    height: 200px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0 64px;
  }

  .container {
    width: 100%;
  }

  .title {
    font-size: 1.4rem;
  }

  .upload-area {
    height: 160px;
  }

  button {
    width: 100%;
  }
}

@media (max-width: 470px) {
  .title p {
    font-size: 14px !important;
  }

  .creator {
    text-align: center;
  }
}

@media (max-width: 358px) {
  .container {
    padding: 20px;
  }

  .upload-area {
    height: 140px;
    font-size: 14px;
  }

  button {
    font-size: 0.9rem;
    padding: 10px 20px;
  }
}