/* 기본 스타일 */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

/* 스크롤 스무스 */
html {
  scroll-behavior: smooth;
}

/* 로딩 애니메이션 */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* 페이드 인 애니메이션 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* 스크롤바 커스텀 (Webkit 브라우저) */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* 챗봇 윈도우 스크롤바 */
#chat-messages::-webkit-scrollbar {
  width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}

/* 포커스 아웃라인 개선 */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* details 요소 애니메이션 */
details[open] summary ~ * {
  animation: fadeIn 0.3s ease-out;
}

/* 프린트 스타일 */
@media print {
  #chatbot-button,
  #chatbot-window,
  nav,
  footer {
    display: none !important;
  }
}

/* 다크모드 지원 준비 */
@media (prefers-color-scheme: dark) {
  /* 필요시 다크모드 스타일 추가 */
}

/* 접근성 개선: 스크린 리더 전용 텍스트 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* 모바일 터치 영역 개선 */
@media (max-width: 768px) {
  button,
  a {
    min-height: 44px;
    min-width: 44px;
  }
}

/* 성능 최적화: GPU 가속 */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}
