/* TwinWorks 커스텀 스타일 */

/* 전역 설정 */
:root {
  --primary-gradient: linear-gradient(135deg, #3b82f6, #1d4ed8);
  --secondary-gradient: linear-gradient(135deg, #10b981, #059669);
  --accent-gradient: linear-gradient(135deg, #f59e0b, #d97706);
}

/* 스크롤 애니메이션 */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.fade-in-up.animate {
  opacity: 1;
  transform: translateY(0);
}

/* 네비게이션 스타일 */
.nav-link {
  position: relative;
  transition: all 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-gradient);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* 히어로 섹션 애니메이션 */
.hero {
  background-attachment: fixed;
  background-size: cover;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 70%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 70% 30%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(1deg); }
}

/* 카운터 애니메이션 */
.counter {
  font-variant-numeric: tabular-nums;
}

/* 기능 카드 호버 효과 */
.feature-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

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

/* 탭 시스템 */
.tabs .tab {
  transition: all 0.3s ease;
}

.tabs .tab.tab-active {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
}

/* 기능 패널 */
.feature-panel {
  display: none;
  animation: fadeIn 0.5s ease-in-out;
}

.feature-panel.active {
  display: block;
}

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

/* 데모 패널 */
.demo-panel {
  display: none;
  animation: slideIn 0.5s ease-in-out;
}

.demo-panel.active {
  display: block;
}

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

/* 시뮬레이션 요소 */
.simulation-element {
  animation: simulationMove 3s ease-in-out infinite;
}

@keyframes simulationMove {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(50px, -20px) scale(1.1); }
  50% { transform: translate(100px, 0) scale(0.9); }
  75% { transform: translate(50px, 20px) scale(1.1); }
}

/* 3D 모델 효과 */
.3d-model {
  perspective: 1000px;
  transform-style: preserve-3d;
}

.3d-model > div {
  transition: all 0.5s ease;
  transform-origin: center center;
}

.3d-model:hover > div {
  transform: rotateY(15deg) rotateX(5deg);
}

/* 차트 바 애니메이션 */
.chart-bar {
  transition: all 0.3s ease;
  border-radius: 4px 4px 0 0;
}

.chart-bar:hover {
  opacity: 0.8;
  transform: scaleY(1.1);
}

/* 그라데이션 텍스트 */
.gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 카드 그림자 효과 */
.card-shadow {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

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

/* 버튼 호버 효과 */
.btn-primary {
  background: var(--primary-gradient);
  border: none;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
  background: var(--secondary-gradient);
  border: none;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.btn-accent {
  background: var(--accent-gradient);
  border: none;
  transition: all 0.3s ease;
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
}

/* 알림 애니메이션 */
.alert {
  animation: slideInRight 0.5s ease-out;
}

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

/* 모달 애니메이션 */
.modal[open] {
  animation: modalFadeIn 0.3s ease-out;
}

.modal[open] .modal-box {
  animation: modalSlideIn 0.3s ease-out;
}

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

@keyframes modalSlideIn {
  from { transform: translateY(-50px) scale(0.9); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* 로딩 애니메이션 */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* 펄스 효과 */
.pulse-effect {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

/* 스크롤 인디케이터 */
.scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(59, 130, 246, 0.2);
  z-index: 9999;
}

.scroll-progress {
  height: 100%;
  background: var(--primary-gradient);
  width: 0%;
  transition: width 0.1s ease;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 3rem;
  }
  
  .hero h2 {
    font-size: 1.5rem;
  }
  
  .feature-card {
    margin-bottom: 1rem;
  }
  
  .stat {
    padding: 1rem;
  }
  
  .card-body {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero h2 {
    font-size: 1.25rem;
  }
  
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* 다크 모드 지원 */
[data-theme="dark"] {
  --primary-gradient: linear-gradient(135deg, #60a5fa, #3b82f6);
  --secondary-gradient: linear-gradient(135deg, #34d399, #10b981);
  --accent-gradient: linear-gradient(135deg, #fbbf24, #f59e0b);
}

[data-theme="dark"] .hero::before {
  background: radial-gradient(circle at 30% 70%, rgba(96, 165, 250, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 70% 30%, rgba(52, 211, 153, 0.15) 0%, transparent 50%);
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 포커스 스타일 */
.btn:focus,
.input:focus,
.select:focus,
.textarea:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--primary-gradient);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #1d4ed8;
}

/* 인쇄 스타일 */
@media print {
  .navbar,
  .modal,
  .btn,
  .footer {
    display: none !important;
  }
  
  .hero {
    background: none !important;
    color: black !important;
  }
  
  .card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }
}

/* 뷰 모드 버튼 스타일 */
.view-mode-btn {
  transition: all 0.3s ease;
}

.view-mode-btn.active {
  background-color: #3b82f6 !important;
  color: white !important;
  border-color: #3b82f6 !important;
}

.view-mode-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.view-mode-btn:not(:disabled):hover {
  background-color: #60a5fa !important;
  color: white !important;
}