/* Non-critical styles loaded after initial render */

/* Fade in animation for smooth transitions */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #374151;
}

.upload-hint {
  margin-top: 1rem;
  color: #6b7280;
  font-size: 0.875rem;
}

/* Image Display */
.image-display {
  margin: 2rem 0;
  text-align: center;
}

.image-display canvas {
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  border-radius: 0.5rem;
}

/* Results Section */
.results-section {
  margin: 2rem 0;
  padding: 2rem;
  background: #f9fafb;
  border-radius: 0.5rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.metric-card {
  background: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.metric-card label {
  display: block;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.metric-card li {
  padding: 0.375rem 0;
  color: #6b7280;
  font-size: 0.95rem;
}

.metric-card strong {
  color: #1f2937;
  font-weight: 600;
}

.wid-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1f2937;
  margin: 0.5rem 0;
}

.delta-e {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 0.875rem;
}

.baseline-info {
  color: #059669;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

/* Buttons */
.btn-primary, .btn-secondary {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-secondary {
  background: #e5e7eb;
  color: #4b5563;
}

.btn-secondary:hover {
  background: #d1d5db;
}

/* Debug Visualization */
.debug-visualization {
  margin: 2rem 0;
  padding: 2rem;
  background: #f9fafb;
  border-radius: 0.5rem;
}

.visualization-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.viz-item {
  text-align: center;
}

.viz-item p {
  margin-bottom: 0.75rem;
  color: #4b5563;
  font-size: 0.875rem;
  font-weight: 500;
}

.viz-item canvas {
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px 0 rgb(0 0 0 / 0.1);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
    min-height: auto;
  }

  h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
  }

  .subtitle {
    font-size: 0.875rem;
    margin-bottom: 1rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .visualization-grid {
    grid-template-columns: 1fr;
  }

  /* Mobile Info Banner */
  .info-banner {
    padding: 0.75rem;
  }

  .info-items {
    gap: 0.5rem;
  }

  .info-item {
    flex: 1 1 45%;
    justify-content: center;
  }

  .info-icon {
    font-size: 1rem;
  }

  .info-text {
    font-size: 0.75rem;
  }

  /* Mobile Verdict Card */
  .verdict-card {
    padding: 1.5rem 1rem;
  }

  .verdict-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .verdict-icon {
    font-size: 2rem;
  }

  .verdict-label {
    font-size: 1.5rem;
  }

  .percentile-badge {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
  }

  .recommendation {
    font-size: 1rem;
  }

  /* Mobile Product Cards */
  .product-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .product-card {
    padding: 1rem;
  }

  /* Mobile Whitening Simulation */
  .whitening-simulation {
    padding: 1.5rem 1rem;
  }

  .simulation-controls {
    flex-direction: column;
    gap: 1rem;
  }

  .control-group {
    width: 100%;
  }

  .button-group {
    width: 100%;
  }

  .button-group button {
    flex: 1;
    font-size: 0.875rem;
    padding: 0.6rem 0.75rem;
  }

  .slider {
    width: 100%;
  }

  /* Mobile Footer */
  .footer {
    padding: 2rem 1rem 1rem;
    margin-top: 2rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .copyright {
    order: 2;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .info-item {
    flex: 1 1 100%;
  }

  .upload-section {
    padding: 1.5rem 1rem;
  }

  .upload-label {
    padding: 0.6rem 1.5rem;
    font-size: 0.875rem;
  }

  .image-display canvas {
    max-width: 100%;
  }
}

/* Verdict Card */
.verdict-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  border-radius: 1rem;
  margin: 2rem 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.verdict-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.verdict-icon {
  font-size: 3rem;
}

.verdict-label {
  font-size: 2rem;
  font-weight: bold;
  margin: 0;
  color: white !important;
}

.percentile-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 1rem;
  backdrop-filter: blur(10px);
}

.verdict-details {
  text-align: center;
}

.recommendation {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.reasons {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

.low-confidence-warning {
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Privacy Notice */
.privacy-notice {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.privacy-notice h3 {
  color: #0284c7;
  margin-bottom: 1rem;
}

.privacy-notice ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.privacy-notice li {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.privacy-notice strong {
  display: block;
  color: #0c4a6e;
  margin-bottom: 0.25rem;
}

.privacy-notice p {
  color: #475569;
  font-size: 0.875rem;
  margin: 0;
}

.privacy-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #cbd5e1;
  text-align: center;
}

.legal-links {
  margin-top: 0.5rem;
}

.legal-links a {
  color: #0284c7;
  text-decoration: none;
  font-size: 0.875rem;
}

.legal-links a:hover {
  text-decoration: underline;
}

/* WID Tooltip */
.wid-tooltip {
  visibility: hidden !important;
  opacity: 0 !important;
}

label:has(.wid-tooltip):hover .wid-tooltip,
span:has(.wid-tooltip):hover .wid-tooltip {
  visibility: visible !important;
  opacity: 1 !important;
}

/* Product Recommendation */
.product-recommendation {
  padding: 1.5rem;
  background: #fafafa;
  border-radius: 0.75rem;
  height: fit-content;
}

.recommendation-intro {
  color: #4b5563;
  margin-bottom: 1.5rem;
  text-align: center;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.product-card {
  background: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.product-category {
  display: inline-block;
  background: #e5e7eb;
  color: #4b5563;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.product-card h4 {
  margin: 0.5rem 0;
  color: #1f2937;
  font-size: 1.1rem;
}

.product-description {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0.5rem 0 1rem;
  line-height: 1.4;
}

.product-price {
  color: #059669;
  font-weight: 600;
  margin-bottom: 1rem;
}

.coupang-button {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: #0066cc;  /* 파란색으로 변경 - 메인 테마와 일치 */
  color: white;
  text-align: center;
  text-decoration: none;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
}

.coupang-button:hover {
  background: #0052a3;  /* 호버 시 더 진한 파란색 */
}

.coupang-button-disabled {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: #9ca3af;
  color: white;
  text-align: center;
  border-radius: 0.375rem;
  font-weight: 500;
  border: none;
  cursor: not-allowed;
}

.disclaimer {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 6px;
  text-align: center;
  color: #6b7280;
}

.disclaimer small {
  line-height: 1.6;
  font-size: 0.85rem;
}

/* Simulation and Products Layout */
.simulation-and-products {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

@media (min-width: 1024px) {
  .simulation-and-products {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

/* Whitening Simulation */
.whitening-simulation {
  padding: 1.5rem;
  background: #f5f3ff;
  border-radius: 0.75rem;
  height: fit-content;
}

.simulation-intro {
  color: #6b7280;
  margin-bottom: 1.5rem;
  text-align: center;
}

.simulation-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.control-group label {
  font-size: 0.875rem;
  color: #4b5563;
  font-weight: 500;
}

.button-group {
  display: flex;
  gap: 0.5rem;
}

.button-group button {
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
}

.button-group button:hover {
  background: #f3f4f6;
}

.button-group button.active {
  background: #7c3aed;
  color: white;
  border-color: #7c3aed;
}

.slider {
  width: 200px;
  cursor: pointer;
}

.simulation-canvas {
  text-align: center;
  margin: 2rem auto;
  display: flex;
  justify-content: center;
}

.simulation-note {
  background: rgba(124, 58, 237, 0.05);
  padding: 1rem;
  border-radius: 0.5rem;
  text-align: center;
  color: #6b7280;
}

/* Small text utility */
.small {
  font-size: 0.875rem;
}

/* Info Banner */
.info-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem;
  border-radius: 0.75rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.info-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 1rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.info-icon {
  font-size: 1.25rem;
}

.info-text {
  font-size: 0.875rem;
  font-weight: 500;
}

/* Footer */
.footer {
  background: #1f2937;
  color: white;
  margin-top: 4rem;
  padding: 3rem 2rem 1rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: white;
}

.footer-section p {
  color: #9ca3af;
  line-height: 1.6;
  font-size: 0.875rem;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section li {
  color: #9ca3af;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.footer-section a {
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.2s;
}

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

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid #374151;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-bottom .legal-links {
  display: flex;
  gap: 1rem;
}

.footer-bottom .legal-links a {
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-bottom .legal-links a:hover {
  color: white;
  text-decoration: underline;
}

.footer-bottom .divider {
  color: #4b5563;
}

.copyright {
  color: #6b7280;
  font-size: 0.875rem;
}

.footer-disclaimer {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid #374151;
  text-align: center;
}

.footer-disclaimer small {
  color: #9ca3af;
  font-size: 0.75rem;
  color: #6b7280;
}