/* 기본 설정 */
:root {
  /* Light mode variables */
  --background: #f8f8f8;
  --foreground: #121212;
  --card: #ffffff;
  --card-foreground: #121212;
  --primary: #3b82f6;
  --primary-foreground: #ffffff;
  --secondary: #f4f4f5;
  --secondary-foreground: #121212;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --accent: #f4f4f5;
  --accent-foreground: #121212;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --border: #e4e4e7;
  --input: #e4e4e7;
  --ring: #a1a1aa;
  --radius: 0.5rem;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Dark mode variables */
.dark {
  --background: #121212;
  --foreground: #f8f8f8;
  --card: #1e1e1e;
  --card-foreground: #f8f8f8;
  --primary: #3b82f6;
  --primary-foreground: #f8f8f8;
  --secondary: #27272a;
  --secondary-foreground: #f8f8f8;
  --muted: #27272a;
  --muted-foreground: #a1a1aa;
  --accent: #27272a;
  --accent-foreground: #f8f8f8;
  --destructive: #7f1d1d;
  --destructive-foreground: #f8f8f8;
  --border: #27272a;
  --input: #27272a;
  --ring: #d4d4d8;

  color-scheme: dark;
}

/* 리셋 및 기본 스타일 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
    "Open Sans", "Helvetica Neue", sans-serif;
  line-height: 1.5;
  color: var(--foreground);
  background-color: var(--background);
  min-height: 100vh;
  transition: color 0.3s, background-color 0.3s;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.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;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* 헤더 스타일 */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid var(--border);
  background-color: var(--background);
  backdrop-filter: blur(8px);
  transition: background-color 0.3s, border-color 0.3s;
}

.header-container {
  display: flex;
  height: 4rem;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
}

.logo-subtitle {
  display: none;
  font-size: 0.875rem;
  font-weight: normal;
  color: var(--muted-foreground);
  margin-left: 0.5rem;
}

.desktop-nav {
  display: none;
}

.nav-list {
  display: flex;
  gap: 0.5rem;
}

.nav-list li a {
  display: inline-flex;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
}

.nav-list li a:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.nav-list li a.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 12rem;
  padding: 0.5rem;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 10;
  transition: background-color 0.3s, border-color 0.3s;
}

.dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
}

.dropdown-menu a:hover {
  background-color: var(--accent);
}

.dropdown:hover .dropdown-menu {
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  transition: background-color 0.2s;
}

.icon-button:hover {
  background-color: var(--accent);
}

.search-button {
  display: none;
}

.theme-toggle-button,
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  transition: background-color 0.2s;
  position: relative;
}

.theme-toggle-button:hover,
.theme-toggle:hover {
  background-color: var(--accent);
}

.mobile-menu {
  display: none;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  transition: border-color 0.3s;
}

.mobile-menu.active {
  display: block;
}

.mobile-nav-list li a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
}

.mobile-nav-list li a:hover,
.mobile-nav-list li a.active {
  background-color: var(--accent);
}

.mobile-nav-list li a.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

/* 메인 콘텐츠 */
.main-content {
  padding: 2rem 1rem;
}

/* 카드 스타일 */
.card {
  border-radius: var(--radius);
  background-color: var(--card);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 2rem;
  transition: background-color 0.3s, border-color 0.3s;
}

.card-header {
  padding: 1.5rem 1.5rem 0;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.card-description {
  margin-top: 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  transition: color 0.3s;
}

.card-content {
  padding: 1.5rem;
}

/* 히어로 섹션 */
.hero-section {
  margin-top: 2rem; /* 상단 메뉴와의 간격 추가 */
  margin-bottom: 2rem;
}

.hero-card {
  background: linear-gradient(to bottom right, rgba(59, 130, 246, 0.1), var(--card), var(--card));
  transition: background 0.3s;
}

.hero-content {
  display: grid;
  gap: 1.5rem;
}

.hero-text {
  color: var(--muted-foreground);
  transition: color 0.3s;
}

.hero-image {
  display: flex;
  justify-content: center;
}

.hero-image img {
  max-width: 100%;
  height: auto;
}

/* 사용 방법 섹션 */
.how-to-use-section {
  margin-bottom: 2rem;
}

.section-title {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.feature-grid {
  display: grid;
  gap: 1.5rem;
}

.feature-grid2 {
  display: grid;
  gap: 1.5rem;
}

.feature-card {
  padding: 1rem;
  border-radius: var(--radius);
  background-color: var(--secondary);
  transition: background-color 0.3s;
}

.feature-header {
  padding-bottom: 0.5rem;
}

.feature-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.feature-icon {
  color: var(--primary);
}

.feature-content {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: color 0.3s;
}

.instruction-list {
  list-style-type: disc;
  padding-left: 1.5rem;
  color: var(--muted-foreground);
  transition: color 0.3s;
}

.instruction-list li {
  margin-bottom: 0.5rem;
}

/* 계산기 섹션 */
.calculator-section {
  margin-bottom: 2rem;
}

.tabs {
  width: 100%;
}

.tab-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 1rem;
}

.tab-button {
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
  background-color: var(--secondary);
  transition: background-color 0.3s;
}

.tab-button:first-child {
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
}

.tab-button:last-child {
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

.tab-button.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.calculator-card {
  background: linear-gradient(to bottom right, rgba(59, 130, 246, 0.05), var(--card), var(--card));
  border-color: rgba(59, 130, 246, 0.2);
  transition: background 0.3s, border-color 0.3s;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.text-input {
  flex: 1;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background-color: transparent;
  color: var(--foreground);
  font-size: 0.875rem;
  text-align: right;
  transition: border-color 0.3s, color 0.3s;
}

.text-input:focus {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.input-suffix {
  margin-left: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: color 0.3s ease;
}

.reset-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  color: var(--muted-foreground);
  transition: background-color 0.2s, color 0.2s, border-color 0.3s;
}

.reset-button:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.button-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0 1rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: opacity 0.2s, background-color 0.3s ease, color 0.3s ease;
}

.primary-button:hover {
  opacity: 0.9;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0 1rem;
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: opacity 0.2s, background-color 0.3s ease, color 0.3s ease;
}

.secondary-button:hover {
  opacity: 0.9;
}

.full-width {
  width: 100%;
}

.result-container {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: var(--radius);
  background-color: var(--card);
  transition: background-color 0.3s;
}

.result-title {
  margin-bottom: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  text-align: center;
}

.result-note {
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: color 0.3s ease;
}

.result-note p {
  margin-bottom: 0.25rem;
}

.tax-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tax-item {
  padding: 0.75rem;
  border-radius: var(--radius);
  background-color: rgba(59, 130, 246, 0.1);
  transition: background-color 0.3s;
}

.tax-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: color 0.3s;
}

.tax-amount {
  font-size: 1.25rem;
  font-weight: 600;
}

.total-tax {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  background-color: rgba(59, 130, 246, 0.2);
  text-align: center;
  transition: background-color 0.3s;
}

.final-amount {
  padding: 1rem;
  border-radius: var(--radius);
  background-color: rgba(59, 130, 246, 0.3);
  text-align: center;
  transition: background-color 0.3s;
}

.total-amount {
  font-size: 1.5rem;
  font-weight: 700;
}

.result-details {
  display: grid;
  gap: 0.5rem;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background-color: rgba(59, 130, 246, 0.1);
  border-radius: var(--radius);
  transition: background-color 0.3s ease;
}

.result-item.total {
  background-color: rgba(59, 130, 246, 0.2);
  font-weight: 700;
}

.result-label {
  font-size: 0.875rem;
}

.result-value {
  font-size: 1rem;
  font-weight: 600;
}

/* 계산기 옵션 */
.calculator-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.radio-label input[type="radio"] {
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--muted-foreground);
  border-radius: 50%;
  margin: 0;
  position: relative;
  transition: border-color 0.3s ease;
}

.radio-label input[type="radio"]:checked {
  border-color: var(--primary);
}

.radio-label input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0.625rem;
  height: 0.625rem;
  background-color: var(--primary);
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.radio-text {
  font-size: 0.875rem;
  font-weight: 500;
}

.calculator-form {
  display: none;
  transition: opacity 0.3s ease;
}

.calculator-form.active {
  display: block;
}

/* 설명 섹션 */
.explanation-section {
  margin-bottom: 2rem;
}

.explanation-section .card {
  background: linear-gradient(to bottom right, rgba(59, 130, 246, 0.05), var(--card), var(--card));
  transition: background 0.3s ease;
}

.explanation-section p {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.6;
  transition: color 0.3s ease;
}

/* 푸터 */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  background-color: var(--background);
  backdrop-filter: blur(8px);
  transition: background-color 0.3s, border-color 0.3s;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-title {
  margin-bottom: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.footer-text {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: color 0.3s;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: color 0.2s;
}

.footer-links a:hover,
.footer-links a.active {
  color: var(--foreground);
}

.footer-links a.active {
  color: var(--primary);
}

.footer-email a {
  color: var(--primary);
  transition: opacity 0.2s;
}

.footer-email a:hover {
  opacity: 0.8;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: color 0.3s, border-color 0.3s;
}

/* 애니메이션 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

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

/* 반응형 스타일 */
@media (min-width: 640px) {
  .hero-content {
    grid-template-columns: 1fr 1fr;
  }

  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }

  .feature-grid2 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 768px) {
  .desktop-nav {
    display: flex;
  }

  .search-button {
    display: flex;
  }

  .mobile-menu-button {
    display: none;
  }

  .logo-subtitle {
    display: inline-block;
  }

  .feature-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .feature-grid2 {
    grid-template-columns: repeat(2, 1fr);
  } 

  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

