/* 전역 스타일 */
* {
  font-family: 'Noto Sans KR', sans-serif;
}

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

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

/* 탭 버튼 */
.tab-button {
  transition: all 0.3s ease;
  position: relative;
}

.tab-button:hover {
  transform: translateY(-2px);
}

.tab-button.active {
  color: #2563eb;
  border-bottom: 4px solid #2563eb;
  background-color: white;
}

/* 카드 호버 효과 */
.card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 버튼 호버 효과 */
button {
  transition: all 0.2s ease;
}

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

button i {
  transition: transform 0.2s ease;
}

button:hover i {
  transform: scale(1.15);
}

/* 모달 애니메이션 */
.modal {
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* 입력 필드 포커스 */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 테이블 스타일 */
table {
  border-collapse: separate;
  border-spacing: 0;
}

table thead tr {
  background: linear-gradient(to right, #f9fafb, #f3f4f6);
}

table tbody tr {
  transition: all 0.2s ease;
}

table tbody tr:hover {
  background-color: #f9fafb;
  transform: scale(1.01);
}

/* 배지 스타일 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.badge:hover {
  transform: scale(1.05);
}

.badge-player {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}

.badge-staff {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.badge-office {
  background: linear-gradient(135deg, #9333ea, #7e22ce);
  color: white;
}

/* 재고 부족 경고 애니메이션 */
.stock-warning {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

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

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

/* 사진 업로드 영역 */
.upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #f9fafb;
}

.upload-area:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.upload-area.dragover {
  border-color: #2563eb;
  background: #dbeafe;
}

/* 이미지 프리뷰 */
.image-preview {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
}

.image-preview img {
  transition: transform 0.3s ease;
}

.image-preview:hover img {
  transform: scale(1.05);
}

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

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

/* 그라디언트 배경 */
.gradient-bg {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 유리 효과 (Glassmorphism) */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 그림자 효과 */
.shadow-luxury {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* 검색 결과 하이라이트 */
.highlight {
  background-color: #fef08a;
  padding: 0 0.25rem;
  border-radius: 0.25rem;
  font-weight: 600;
}

/* 빈 상태 일러스트레이션 */
.empty-state {
  padding: 4rem 2rem;
  text-align: center;
  color: #9ca3af;
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* 토스트 알림 */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideInRight 0.3s ease;
  z-index: 1000;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success {
  border-left: 4px solid #10b981;
}

.toast.error {
  border-left: 4px solid #ef4444;
}

.toast.info {
  border-left: 4px solid #3b82f6;
}

/* 모바일 최적화 */
@media (max-width: 640px) {
  /* 토스트 알림 모바일 위치 */
  .toast {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: calc(100% - 2rem);
  }
  
  /* 모달 전체 화면 */
  .modal > div {
    max-width: 95% !important;
    max-height: 90vh;
    overflow-y: auto;
    margin: 1rem;
  }
  
  /* 카드 간격 조정 */
  .space-y-4 > * + * {
    margin-top: 0.75rem;
  }
  
  /* 그리드 레이아웃 모바일 대응 */
  .grid-cols-2 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  
  .md\:grid-cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  /* 테이블 스크롤 */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  /* 버튼 텍스트 크기 */
  button {
    font-size: 0.875rem;
  }
  
  /* 입력 필드 크기 */
  input, select, textarea {
    font-size: 16px; /* iOS 줌 방지 */
  }
}

/* 스크롤바 숨기기 (탭 네비게이션용) */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* 터치 디바이스 최적화 */
@media (hover: none) and (pointer: coarse) {
  .card-hover:hover {
    transform: none;
  }
  
  button:hover i {
    transform: none;
  }
  
  .tab-button:hover {
    transform: none;
  }
}

/* 작은 화면 레이아웃 개선 */
@media (max-width: 480px) {
  /* 헤더 로고 크기 */
  nav img {
    height: 2.5rem;
  }
  
  /* 패딩 조정 */
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  /* 폰트 크기 조정 */
  h1 {
    font-size: 1rem;
  }
  
  h2 {
    font-size: 1.25rem;
  }
  
  h3 {
    font-size: 1.125rem;
  }
}
