/* 뷰티샷 - 모바일 최적화 스타일 (Tailwind 대체) */

/* === TAILWIND RESET & BASE === */
*, ::before, ::after {
  box-sizing: border-box;
  border-width: 0;
  border-style: solid;
  border-color: #e5e7eb;
}

/* === TAILWIND UTILITIES === */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-blue-600 { background-color: #2563eb; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-green-100 { background-color: #dcfce7; }
.bg-green-500 { background-color: #22c55e; }
.bg-pink-50 { background-color: #fdf2f8; }
.bg-pink-100 { background-color: #fce7f3; }
.bg-pink-500 { background-color: #ec4899; }
.bg-pink-600 { background-color: #db2777; }
.bg-purple-50 { background-color: #faf5ff; }
.bg-purple-100 { background-color: #f3e8ff; }
.bg-purple-500 { background-color: #a855f7; }
.bg-purple-600 { background-color: #9333ea; }
.bg-amber-50 { background-color: #fffbeb; }
.bg-amber-100 { background-color: #fef3c7; }
.bg-amber-500 { background-color: #f59e0b; }
.bg-amber-600 { background-color: #d97706; }
.bg-orange-50 { background-color: #fff7ed; }
.bg-orange-100 { background-color: #ffedd5; }
.bg-orange-500 { background-color: #f97316; }
.bg-rose-400 { background-color: #fb7185; }
.bg-rose-500 { background-color: #f43f5f; }
.bg-cyan-50 { background-color: #ecfeff; }
.bg-cyan-100 { background-color: #cffafe; }
.bg-teal-50 { background-color: #f0fdfa; }
.bg-teal-100 { background-color: #ccfbf1; }
.bg-teal-500 { background-color: #14b8a6; }
.bg-yellow-50 { background-color: #fefce8; }
.bg-yellow-100 { background-color: #fef3c7; }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-100 { background-color: #fee2e2; }

.text-white { color: #ffffff; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-blue-600 { color: #2563eb; }
.text-blue-700 { color: #1d4ed8; }
.text-green-600 { color: #16a34a; }
.text-green-700 { color: #15803d; }
.text-pink-600 { color: #db2777; }
.text-purple-600 { color: #9333ea; }
.text-amber-600 { color: #d97706; }
.text-amber-800 { color: #92400e; }
.text-orange-600 { color: #ea580c; }
.text-cyan-600 { color: #0891b2; }
.text-teal-600 { color: #0d9488; }

.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops)); }
.from-blue-600 { --tw-gradient-from: #2563eb; --tw-gradient-to: rgba(37, 99, 235, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.to-green-600 { --tw-gradient-to: #16a34a; }
.from-pink-500 { --tw-gradient-from: #ec4899; --tw-gradient-to: rgba(236, 72, 153, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.to-purple-600 { --tw-gradient-to: #9333ea; }
.from-amber-500 { --tw-gradient-from: #f59e0b; --tw-gradient-to: rgba(245, 158, 11, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.to-orange-500 { --tw-gradient-to: #f97316; }

.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }
.rounded-t-xl { border-top-left-radius: 0.75rem; border-top-right-radius: 0.75rem; }
.rounded-t-2xl { border-top-left-radius: 1rem; border-top-right-radius: 1rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.pb-20 { padding-bottom: 5rem; }

.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

.w-full { width: 100%; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-20 { width: 5rem; }
.h-16 { height: 4rem; }
.h-20 { height: 5rem; }

.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.space-x-2 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.5rem; }
.space-x-3 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.75rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-center { text-align: center; }
.leading-relaxed { line-height: 1.625; }
.leading-tight { line-height: 1.25; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }

.border { border-width: 1px; }
.border-t { border-top-width: 1px; }
.border-gray-200 { border-color: #e5e7eb; }
.border-amber-200 { border-color: #fde68a; }

.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

.hover\:shadow-lg:hover { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.hover\:shadow-xl:hover { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }
.hover\:scale-105:hover { transform: scale(1.05); }
.active\:scale-95:active { transform: scale(0.95); }

.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { top: 0px; right: 0px; bottom: 0px; left: 0px; }
.top-0 { top: 0px; }
.bottom-0 { bottom: 0px; }
.left-0 { left: 0px; }
.right-0 { right: 0px; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

.min-h-screen { min-height: 100vh; }

/* Gradient backgrounds */
.bg-gradient-to-b { background-image: linear-gradient(to bottom, var(--tw-gradient-stops)); }
.from-purple-50 { --tw-gradient-from: #faf5ff; --tw-gradient-to: rgba(250, 245, 255, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.to-pink-50 { --tw-gradient-to: #fdf2f8; }

/* Background clip text for gradients */
.bg-clip-text { 
  -webkit-background-clip: text;
  background-clip: text;
}
.text-transparent { color: transparent; }

/* 폰트 및 기본 스타일 */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 모바일 스크롤 최적화 */
html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* 애니메이션 */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.animate-pulse-custom {
  animation: pulse 2s infinite;
}

/* 모바일 터치 버튼 스타일 */
button {
  touch-action: manipulation;
  -webkit-appearance: none;
  border: none;
  outline: none;
  cursor: pointer;
}

button:active {
  transform: scale(0.98);
}

/* 카메라 비디오 스타일 */
#video {
  transition: transform 0.3s ease;
}

/* 풀스크린 카메라 모드 */
#camera-section {
  background: #000;
  -webkit-user-select: none;
  user-select: none;
}

#camera-section video {
  width: 100vw;
  height: 100vh;
  object-fit: cover;
}

/* 카메라 전환 버튼 스타일 */
.camera-btn-active {
  background: rgba(255, 255, 255, 0.9) !important;
  color: #1f2937 !important;
  transform: scale(1.05);
  font-weight: 600;
}

.camera-btn-inactive {
  opacity: 0.8;
}

/* 카메라 상태 표시 */
#camera-status {
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 6px 12px;
  border-radius: 16px;
  display: inline-block;
  font-weight: 500;
  backdrop-filter: blur(10px);
}

/* 촬영 버튼 특별 스타일 */
#capture-btn:active {
  transform: scale(0.9);
}

/* 네비게이션 바 활성 상태 */
.nav-active {
  color: #9333ea !important;
  background-color: #f3e8ff !important;
}

.nav-active i {
  transform: scale(1.1);
}

/* 미리보기 이미지 스타일 */
#preview-image {
  border: 3px solid #e5e7eb;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  object-fit: contain;
}

/* 드래그 앤 드롭 효과 */
.drag-over {
  border-color: #3b82f6 !important;
  background-color: #eff6ff !important;
}

/* 버튼 호버 효과 강화 */
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 모바일 최적화 */
@media (max-width: 768px) {
  #video {
    width: 100% !important;
    max-width: 320px;
  }
  
  .text-4xl {
    font-size: 2rem !important;
  }
  
  .grid.md\\:grid-cols-2 {
    grid-template-columns: 1fr !important;
  }
  
  .grid.md\\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }
  
  .grid.md\\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* 로딩 스피너 */
.loading-spinner {
  border: 4px solid #f3f4f6;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 결과 카드 애니메이션 */
.result-card {
  animation: slideInUp 0.5s ease-out;
}

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

/* 성분 안전성 아이콘 */
.safety-icon {
  font-size: 1.2rem;
  margin-right: 0.5rem;
}

/* 모바일 성능 최적화 */
img, video {
  max-width: 100%;
  height: auto;
}

/* 하드웨어 가속 적용 */
.hardware-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000;
}

/* 모바일 입력 스타일 */
input[type="file"] {
  font-size: 16px; /* iOS 줌 방지 */
}

/* 스크롤 성능 최적화 */
.scroll-smooth {
  -webkit-overflow-scrolling: touch;
  overflow-scrolling: touch;
}

/* 모바일 안전 영역 (노치 대응) */
@supports (padding: max(0px)) {
  .safe-area-top {
    padding-top: max(1rem, env(safe-area-inset-top));
  }
  
  .safe-area-bottom {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

/* 반응형 텍스트 및 레이아웃 */
@media (max-width: 640px) {
  .responsive-text {
    font-size: 0.875rem !important;
  }
  
  /* 모바일에서 그리드 간격 최적화 */
  .mobile-grid-tight {
    gap: 0.75rem !important;
  }
  
  /* 모바일 패딩 최적화 */
  .mobile-padding {
    padding: 1rem !important;
  }
}

/* 고해상도 디스플레이 최적화 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .retina-optimized {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* 다크모드 지원 준비 */
@media (prefers-color-scheme: dark) {
  /* 향후 다크모드 스타일 추가 예정 */
}

/* 애니메이션 성능 최적화 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}