/* Snack Apps Common Styles */

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans KR', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Image Upload Area */
.upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #f9fafb;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: #6366f1;
  background: #eef2ff;
}

.upload-area.has-image {
  border-style: solid;
  border-color: #6366f1;
  padding: 0;
  overflow: hidden;
}

.upload-area img {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Result Card */
.result-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 1rem;
  padding: 2rem;
  color: white;
  text-align: center;
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.result-card .result-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.result-card .result-value {
  font-size: 3rem;
  font-weight: 800;
  margin: 1rem 0;
}

.result-card .result-description {
  font-size: 1rem;
  opacity: 0.9;
}

/* Progress Bar */
.progress-bar {
  background: #e5e7eb;
  border-radius: 9999px;
  height: 8px;
  overflow: hidden;
}

.progress-bar .progress-fill {
  background: linear-gradient(90deg, #6366f1, #a855f7);
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s ease;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: white;
  color: #374151;
  border: 2px solid #e5e7eb;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  border-color: #6366f1;
  color: #6366f1;
}

/* Stats Counter */
.stats-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #f3f4f6;
  border-radius: 9999px;
  font-size: 0.875rem;
  color: #6b7280;
}

.stats-counter .count {
  font-weight: 600;
  color: #374151;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
  .upload-area {
    padding: 1.5rem;
  }

  .result-card {
    padding: 1.5rem;
  }

  .result-card .result-value {
    font-size: 2.5rem;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }
}

/* Touch Target Size (44px minimum) */
button,
a,
input[type="file"]::file-selector-button {
  min-height: 44px;
  min-width: 44px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .ad-container,
  .share-buttons,
  nav,
  footer {
    display: none !important;
  }
}
