/* 아트사파리 커스텀 스타일 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
  --art-purple: #8B5CF6;
  --art-blue: #3B82F6;
  --art-green: #10B981;
  --art-orange: #F59E0B;
  --art-pink: #EC4899;
}

* {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 부드러운 스크롤 */
html {
  scroll-behavior: smooth;
}

/* PDF 인쇄 최적화 */
@media print {
  @page {
    size: A4;
    margin: 10mm;
  }
  
  .page-break {
    page-break-after: always;
  }
  
  .print\\:hidden {
    display: none !important;
  }
  
  .print\\:bg-white {
    background-color: white !important;
  }
  
  * {
    -webkit-print-color-adjust: exact;
    color-adjust: exact;
  }
}

/* 커스텀 스크롤바 */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--art-purple), var(--art-blue));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #7C3AED, #2563EB);
}

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

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

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0,0,0);
  }
  40%, 43% {
    transform: translate3d(0, -30px, 0);
  }
  70% {
    transform: translate3d(0, -15px, 0);
  }
  90% {
    transform: translate3d(0, -4px, 0);
  }
}

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

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.bounce {
  animation: bounce 2s infinite;
}

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

.gradient-purple {
  background: linear-gradient(135deg, var(--art-purple), #9333EA);
}

.gradient-blue {
  background: linear-gradient(135deg, var(--art-blue), #1D4ED8);
}

.gradient-green {
  background: linear-gradient(135deg, var(--art-green), #059669);
}

/* 호버 효과 */
.hover-scale {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 글래스모피즘 효과 */
.glass {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* PDF 스타일 */
.A4-container {
  width: 210mm;
  margin: auto;
  font-family: 'Pretendard', sans-serif;
}

.pdf-page {
  width: 210mm;
  height: 297mm;
  box-sizing: border-box;
  font-family: 'Pretendard', sans-serif;
  background: white;
  page-break-after: always;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.pdf-page:last-child {
  page-break-after: avoid;
}

/* 인쇄용 스타일 */
@media print {
  .pdf-page {
    margin: 0;
    page-break-after: always;
  }
  
  .no-print {
    display: none !important;
  }
}

/* 반응형 테이블 */
.responsive-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.responsive-table table {
  min-width: 600px;
}

/* 커스텀 입력 필드 */
.input-group {
  position: relative;
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
  transform: translateY(-20px) scale(0.8);
  color: var(--art-purple);
}

.input-group label {
  position: absolute;
  left: 12px;
  top: 12px;
  transition: all 0.3s ease;
  pointer-events: none;
  color: #9CA3AF;
}

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

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

/* 토스트 메시지 */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  min-width: 300px;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  animation: slideInRight 0.3s ease-out;
}

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

.toast-success {
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
}

.toast-error {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: white;
}

.toast-info {
  background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  color: white;
}

/* 차트 커스터마이징 */
.recharts-wrapper {
  font-family: 'Pretendard', sans-serif;
}

.recharts-legend-item {
  font-size: 14px;
  font-weight: 500;
}

.recharts-cartesian-axis-tick-value {
  font-size: 12px;
  fill: #6B7280;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  .pdf-page {
    width: 100%;
    height: auto;
    min-height: 100vh;
    padding: 20px;
  }
  
  .A4-container {
    width: 100%;
  }
  
  .responsive-grid {
    grid-template-columns: 1fr;
  }
  
  .mobile-hidden {
    display: none;
  }
}

@media (max-width: 640px) {
  .sm-text {
    font-size: 0.875rem;
  }
  
  .sm-padding {
    padding: 12px;
  }
  
  .sm-margin {
    margin: 8px;
  }
}

/* 다크모드 지원 */
@media (prefers-color-scheme: dark) {
  .dark-mode {
    background: #1F2937;
    color: #F9FAFB;
  }
  
  .dark-mode .bg-white {
    background: #374151;
  }
  
  .dark-mode .text-gray-800 {
    color: #F9FAFB;
  }
  
  .dark-mode .text-gray-600 {
    color: #D1D5DB;
  }
  
  .dark-mode .border-gray-200 {
    border-color: #4B5563;
  }
}

/* 접근성 개선 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.focus-visible:focus {
  outline: 2px solid var(--art-purple);
  outline-offset: 2px;
}

/* 버튼 스타일 확장 */
.btn-primary {
  background: linear-gradient(135deg, var(--art-purple), var(--art-blue));
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #F3F4F6, #E5E7EB);
  color: #374151;
  border: 1px solid #D1D5DB;
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #E5E7EB, #D1D5DB);
  transform: translateY(-1px);
}

/* 카드 스타일 */
.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: all 0.3s ease;
}

.card: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);
}