/* Theme Styles - 다크모드 및 테마 전환 */

/* 기본 테마 전환 애니메이션 */
* {
  transition: background-color var(--transition-base), 
              color var(--transition-base), 
              border-color var(--transition-base);
}

/* 다크모드 전용 스타일 조정 */
[data-theme="dark"] {
  /* 다크모드에서 그림자 조정 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* 다크모드에서 입력 필드 스타일 */
[data-theme="dark"] .input-field {
  background-color: var(--surface-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .input-field:focus {
  border-color: var(--primary-color);
  background-color: var(--background-color);
}

/* 다크모드에서 버튼 스타일 조정 */
[data-theme="dark"] .btn-ghost:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .btn-secondary {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* 다크모드에서 카드 스타일 */
[data-theme="dark"] .card {
  background-color: var(--surface-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 다크모드에서 모달 스타일 */
[data-theme="dark"] .modal-overlay {
  background-color: rgba(0, 0, 0, 0.7);
}

/* 다크모드에서 태그 스타일 */
[data-theme="dark"] .tag {
  background-color: var(--background-color);
  border-color: var(--border-color);
}

/* 테마 전환 버튼 스타일 */
.theme-toggle {
  padding: var(--spacing-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: var(--font-size-xl);
  transition: transform var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.theme-toggle:hover {
  transform: scale(1.1);
  background-color: var(--surface-color);
}

.theme-toggle:active {
  transform: scale(0.95);
}

/* 다크모드 아이콘 애니메이션 */
.theme-icon {
  display: inline-block;
  transition: transform var(--transition-base);
}

.theme-toggle:hover .theme-icon {
  transform: rotate(20deg);
}

/* 다크모드에서 링크 색상 */
[data-theme="dark"] a {
  color: var(--primary-color);
}

[data-theme="dark"] a:hover {
  color: var(--secondary-color);
}

/* 다크모드에서 스크롤바 */
[data-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--background-color);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--border-color);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* 다크모드에서 선택 영역 */
[data-theme="dark"] ::selection {
  background-color: var(--primary-color);
  color: white;
}

/* 라이트모드에서 선택 영역 */
[data-theme="light"] ::selection {
  background-color: var(--primary-color);
  color: white;
}

/* 다크모드 토글 체크박스 스타일 (옵션) */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: var(--transition-base);
  border-radius: var(--radius-full);
}

.theme-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: var(--transition-base);
  border-radius: 50%;
}

.theme-switch input:checked + .theme-slider {
  background-color: var(--primary-color);
}

.theme-switch input:checked + .theme-slider:before {
  transform: translateX(26px);
}

/* 페이지 전환 시 테마 깜빡임 방지 */
html {
  background-color: var(--background-color);
}

/* 다크모드에서 이미지 밝기 조정 (옵션) */
[data-theme="dark"] img:not(.no-filter) {
  opacity: 0.9;
}

/* 다크모드에서 구분선 */
[data-theme="dark"] .divider {
  background-color: var(--border-color);
}

/* 다크모드에서 Alert 스타일 */
[data-theme="dark"] .alert-success {
  background-color: rgba(40, 167, 69, 0.15);
}

[data-theme="dark"] .alert-warning {
  background-color: rgba(255, 193, 7, 0.15);
}

[data-theme="dark"] .alert-danger {
  background-color: rgba(220, 53, 69, 0.15);
}

[data-theme="dark"] .alert-info {
  background-color: rgba(23, 162, 184, 0.15);
}

/* 프린트 시 라이트 모드 강제 */
@media print {
  :root {
    --primary-color: #4A90E2;
    --secondary-color: #7B68EE;
    --background-color: #FFFFFF;
    --surface-color: #F8F9FA;
    --text-color: #212529;
    --text-secondary: #6C757D;
    --border-color: #E9ECEF;
  }
}
