/**
 * ============================================================
 * KPMC Safety Mind AI - 스타일시트
 * ============================================================
 * 
 * 색상 테마:
 * - 메인: 민트/틸 (#0d9488, #14b8a6)
 * - 서브: 네이비 (#1e293b, #334155)
 * - 배경: 화이트/라이트그레이 (#f8fafc, #f1f5f9)
 * - 강조: 앰버 (#f59e0b), 그린 (#10b981)
 * - 경고: 레드 (#ef4444), 오렌지 (#f97316)
 * 
 * ★ 수정 가이드:
 * - 색상 변경: CSS 변수 또는 직접 hex 코드 수정
 * - 폰트 크기: text-sm, text-base 등 Tailwind 클래스로 조정
 * - 간격: p-4, m-6 등 Tailwind 클래스로 조정
 * ============================================================
 */

/* ============================================================
   기본 스타일
   ============================================================ */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

/* ============================================================
   화면 전환 애니메이션
   ============================================================ */
.screen {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.screen.active {
  opacity: 1;
  transform: translateY(0);
}

.screen.hidden {
  display: none !important;
}

/* ============================================================
   애니메이션 키프레임
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes bounceSmall {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.animate-fadeIn {
  animation: fadeIn 0.4s ease-out forwards;
}

.animate-slideUp {
  animation: slideUp 0.5s ease-out forwards;
}

.animate-bounce-slow {
  animation: bounceSmall 2s ease-in-out infinite;
}

/* ============================================================
   버튼 스타일
   ============================================================ */

/* 메인 버튼 (민트/틸) */
.btn-primary {
  background: linear-gradient(135deg, #0d9488, #0891b2);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0f766e, #0e7490);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

/* 보조 버튼 */
.btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

/* 성공 버튼 (결과 보기) */
.btn-success {
  background: linear-gradient(135deg, #059669, #0d9488);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-success:hover {
  background: linear-gradient(135deg, #047857, #0f766e);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}

/* ============================================================
   입력 필드 스타일
   ============================================================ */
.input-group {
  margin-bottom: 0;
}

.input-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.375rem;
}

.input-field {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
  color: #1e293b;
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: 'Noto Sans KR', sans-serif;
  outline: none;
}

.input-field:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.input-field::placeholder {
  color: #94a3b8;
}

select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}

/* ============================================================
   직무 선택 버튼
   ============================================================ */
.job-btn {
  padding: 0.625rem 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.job-btn:hover {
  border-color: #14b8a6;
  color: #0d9488;
}

.job-btn.selected {
  border-color: #0d9488;
  background: #f0fdfa;
  color: #0d9488;
  font-weight: 600;
}

/* ============================================================
   대시보드 카드
   ============================================================ */
.dash-card {
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1f5f9;
  transition: box-shadow 0.2s ease;
}

.dash-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ============================================================
   스크롤바 스타일 (웹킷)
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ============================================================
   리커트 버튼 터치 영역 최적화
   ============================================================ */
.likert-btn {
  min-height: 48px;
  user-select: none;
}

/* ============================================================
   사고사례 버튼
   ============================================================ */
.scenario-btn {
  min-height: 48px;
  user-select: none;
}

/* ============================================================
   반응형 조정
   ============================================================ */

/* 데스크톱 - 대시보드 카드 크기 최적화 */
@media (min-width: 1024px) {
  .dash-card {
    padding: 1.5rem;
  }
}

/* 모바일 소형 (360px 이하) */
@media (max-width: 360px) {
  .btn-primary, .btn-secondary, .btn-success {
    font-size: 0.875rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .input-field {
    font-size: 1rem; /* 모바일 줌 방지 */
  }
}

/* 큰 화면에서 근로자 화면 가운데 정렬 */
@media (min-width: 640px) {
  #app {
    max-width: 480px;
    margin: 0 auto;
  }
}

/* ============================================================
   인쇄/캡처 최적화
   ============================================================ */
@media print {
  .btn-primary, .btn-secondary, .btn-success {
    display: none !important;
  }
  
  body {
    background: white !important;
  }
  
  .screen {
    page-break-inside: avoid;
  }
}

/* ============================================================
   접근성
   ============================================================ */
:focus-visible {
  outline: 2px solid #0d9488;
  outline-offset: 2px;
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
  .btn-primary {
    background: #0f766e;
  }
  
  .input-field {
    border-width: 3px;
  }
}

/* 움직임 줄이기 선호 */
@media (prefers-reduced-motion: reduce) {
  .screen {
    transition: opacity 0.1s ease;
    transform: none !important;
  }
  
  .animate-fadeIn,
  .animate-slideUp {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
  
  .animate-bounce-slow,
  .animate-bounce,
  .animate-pulse,
  .animate-ping {
    animation: none !important;
  }
}
