/* ==========================================================================
   WORLD TEST - Test Page Common Styles
   ========================================================================== */

/* ---------- Base Override ---------- */
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background-color: var(--color-bg, #FAFBFC);
  color: var(--color-text, #1F2937);
}

/* ---------- Section Title ---------- */
.section {
  text-align: center;
  padding: 1rem 0;
}
.title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text, #1F2937);
  letter-spacing: -0.02em;
}
.subtitle {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text-secondary, #6B7280);
  margin-top: 0.3rem;
}
.ex {
  font-size: 0.78rem;
  color: var(--color-text-muted, #9CA3AF);
  padding: 0.5rem 0;
  text-align: right;
}
.text_no_save {
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-text-muted, #9CA3AF);
  margin-bottom: 1rem;
}

/* ---------- File Upload Area ---------- */
.file-upload {
  max-width: 540px;
  margin: 0 auto;
  padding: 1.5rem;
  background: var(--color-surface, #FFFFFF);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.image-upload-wrap {
  border: 2px dashed var(--color-border, #E5E7EB);
  border-radius: 12px;
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  position: relative;
  width: 100%;
  margin: 0 auto;
}
.image-upload-wrap:hover,
.image-dropping {
  border-color: #6366F1;
  background: rgba(99,102,241,0.04);
}

.file-upload-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  padding: 0;
}

.drag-text {
  padding: 0.5rem;
}
.drag-text h3, .upload-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary, #6B7280);
  line-height: 1.5;
}
.upload {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.8rem;
  opacity: 0.5;
}

/* ---------- Upload Result ---------- */
.file-upload-content {
  display: none;
  text-align: center;
}
.file-upload-image {
  max-width: 70%;
  max-height: 300px;
  margin: 0 auto;
  border-radius: 12px;
  object-fit: cover;
}
.image-title-wrap {
  padding: 1rem 0;
}
.remove-button {
  display: none;
}

/* Result Text */
.result-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.result-massege {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text-secondary, #6B7280);
  margin-bottom: 1rem;
  word-break: keep-all;
}
.result-massege h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Retry Button */
.remove-image {
  display: inline-block;
  padding: 0.7rem 2rem;
  background: #6366F1;
  color: #fff !important;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  margin-top: 0.5rem;
  white-space: nowrap;
  overflow: visible;
  width: auto;
  max-width: none;
  line-height: 1.4;
}
.remove-image:hover {
  background: #818CF8;
  transform: translateY(-1px);
}

/* ---------- Progress Bar ---------- */
#label-container {
  margin: 1rem 0;
  font-size: 0.85rem;
  color: var(--color-text, #1F2937);
}
#label-container > div {
  margin-bottom: 0.5rem;
}
.progress {
  display: flex;
  height: 0.5rem;
  background-color: #E5E7EB;
  border-radius: 9999px;
  overflow: hidden;
  width: 100%;
  margin: 0.25rem 0 0.5rem;
}
.progress-bar {
  border-radius: 9999px;
  transition: width 0.4s ease;
}
/* Bootstrap color override */
.progress-bar.bg-danger { background: #F87171 !important; }
.progress-bar.bg-dark { background: #374151 !important; }
.progress-bar.bg-warning { background: #FBBF24 !important; }
.progress-bar.bg-info { background: #60A5FA !important; }
.progress-bar.bg-success { background: #34D399 !important; }
.progress-bar.bg-secondary { background: #9CA3AF !important; }
.progress-bar.bg-primary { background: #6366F1 !important; }

/* ---------- Loading Overlay ---------- */
.load {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
}
.load > img {
  width: 60px;
  height: auto;
}

.image-loding {
  display: none;
  text-align: center;
  padding: 1.5rem 0;
}
.image-loding h3 {
  font-size: 0.9rem;
  color: var(--color-text-secondary, #6B7280);
  margin-bottom: 0.5rem;
}
.image-loding img {
  width: 40px;
  margin: 0 auto;
}

/* ---------- Popup (재시도 광고) ---------- */
#pop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  height: 100%;
  display: none;
  text-align: center;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
}
#pop > article {
  width: min(300px, 85vw);
  position: relative;
  z-index: 2;
  background: var(--color-surface, #FFFFFF);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  border-radius: 16px;
  margin: 30vh auto;
  padding: 1rem;
  cursor: pointer;
}
#pop > article h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #6366F1;
  margin-top: 0.5rem;
}

/* ---------- Share Buttons ---------- */
.share-buttons {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1.2rem 0;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  color: #fff;
  line-height: 1;
}
.share-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.share-btn:active {
  transform: translateY(0);
}
.share-btn svg {
  flex-shrink: 0;
}
.share-btn--native { background: #6366F1; }
.share-btn--kakao  { background: #FEE500; color: #191919; }
.share-btn--x      { background: #000; }
.share-btn--fb     { background: #1877F2; }
.share-btn--copy   { background: #6B7280; }

/* Copy Toast */
.copy-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1F2937;
  color: #fff;
  padding: 0.7rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Circular Chart (celebrity-face, appearance, hair) ---------- */
.flex-wrapper {
  display: flex;
  flex-flow: row nowrap;
}
.single-chart {
  width: 100%;
  justify-content: space-around;
}
.circular-chart {
  display: block;
  margin: 10px auto;
  max-width: 80%;
  max-height: 200px;
}
.circle-bg {
  fill: none;
  stroke: #E5E7EB;
  stroke-width: 3.8;
}
.circle {
  fill: none;
  stroke-width: 2.8;
  stroke-linecap: round;
  animation: progress 1s ease-out forwards;
}
@keyframes progress {
  0% { stroke-dasharray: 0 100; }
}
.circular-chart.orange .circle { stroke: #FBBF24; }
.circular-chart.green .circle { stroke: #34D399; }
.circular-chart.blue .circle { stroke: #60A5FA; }
.circular-chart.red .circle { stroke: #F87171; }
.percentage {
  fill: var(--color-text, #1F2937);
  font-size: 0.5em;
  text-anchor: middle;
}
.circleChart {
  float: left;
  width: 25%;
  font-size: 1rem;
  text-align: center;
}
.banner_image {
  width: 10%;
}
.sub_title {
  font-size: 1.1rem;
  font-weight: 600;
}

/* ---------- Face Form (hair pages) ---------- */
.faceForm {
  margin: 0 auto;
}

/* ---------- Kakao Ad ---------- */
.kakao_ad, .kakaoPopAd {
  text-align: center;
  margin: 0 auto;
}

/* ---------- Webcam container ---------- */
#webcam-container {
  display: none;
}

/* ---------- Responsive ---------- */
@media screen and (max-width: 736px) {
  .file-upload { padding: 1rem; }
  .image-upload-wrap { padding: 2rem 0.8rem; }
  .file-upload-image { max-width: 85%; }
  .title { font-size: 1.25rem; }
  .subtitle { font-size: 0.9rem; }
  .remove-image { padding: 0.6rem 1.5rem; font-size: 0.85rem; }
  .circleChart { width: 50%; margin-bottom: 0.5rem; }
}

@media screen and (max-width: 480px) {
  .file-upload { margin: 0 -0.5rem; border-radius: 12px; }
  .result-massege { font-size: 0.85rem; }
}