/* 기본 리셋 및 변수 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --success-color: #10b981;
  --success-light: #d1fae5;
  --error-color: #ef4444;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-card: #f8fafc;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f5f5f5;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* 컨테이너 */
.container {
  max-width: 680px;
  margin: 0 auto;
  background-color: var(--bg-primary);
  border-radius: 24px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: fadeIn 0.5s ease-out;
}

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

/* 헤더 */
header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.3; }
}

header h1 {
  font-size: 2rem;
  font-weight: 800;
  position: relative;
  z-index: 1;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.header-nav {
  position: relative;
  z-index: 1;
  margin-top: 1rem;
}

.table-link {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s;
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.table-link:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 퇴직금 계산기 전용 스타일 */
.period-inputs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.period-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.period-input-wrapper input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  border: 2px solid var(--border-color);
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: white;
  text-align: center;
}

.period-input-wrapper input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
  transform: translateY(-2px);
}

/* avg-salary input 스타일 통일 */
.input-group .input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.input-group .input-wrapper input {
  flex: 1;
  padding: 0.75rem 4.5rem 0.75rem 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  border: 2px solid var(--border-color);
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  background-color: white;
}

.input-group .input-wrapper input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
  transform: translateY(-2px);
}

.input-group .unit {
  position: absolute;
  right: 1.25rem;
  color: var(--primary-color);
  font-size: 1.1rem;
  font-weight: 700;
  pointer-events: none;
}

.unit-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-group {
  margin-bottom: 2rem;
}

.input-group label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-list li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.info-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.2rem;
}

/* 날짜 입력 스타일 */
.date-input-wrapper {
  position: relative;
}

.date-input-wrapper input[type="date"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  border: 2px solid var(--border-color);
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: white;
  color: var(--text-primary);
}

.date-input-wrapper input[type="date"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
  transform: translateY(-2px);
}

.work-period-display {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  padding: 1.5rem;
  border-radius: 16px;
  border-left: 4px solid var(--primary-color);
}

.period-result {
  margin-top: 0.5rem;
}

.period-result span {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* 입력 섹션 */
.input-section {
  padding: 2.5rem 2rem;
  background: linear-gradient(to bottom, var(--bg-primary) 0%, var(--bg-card) 100%);
}

.input-section label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

#salary-input {
  flex: 1;
  padding: 1rem 4.5rem 1rem 1.25rem;
  font-size: 1.25rem;
  font-weight: 600;
  border: 2px solid var(--border-color);
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  background-color: white;
}

#salary-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
  transform: translateY(-2px);
}

.unit {
  position: absolute;
  right: 1.25rem;
  color: var(--primary-color);
  font-size: 1.1rem;
  font-weight: 700;
  pointer-events: none;
}

.unit-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.unit-btn {
  flex: 1;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background-color: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.unit-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.unit-btn.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.error-message {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--error-color);
  min-height: 1.25rem;
  padding: 0.5rem;
  border-radius: 8px;
  background-color: rgba(239, 68, 68, 0.05);
}

.error-message:empty {
  display: none;
}

/* 결과 섹션 */
.result-section {
  display: none;
  padding: 2rem;
  background-color: var(--bg-card);
  animation: slideIn 0.4s ease-out;
}

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

/* 요약 */
.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 480px) {
  .summary {
    grid-template-columns: 1fr;
  }
}

.summary-item {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 1.5rem 1rem;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
  transition: transform 0.2s;
  position: relative;
  overflow: hidden;
  min-height: 100px;
}

.summary-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
  pointer-events: none;
}

.summary-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.summary-item .label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-item .value {
  font-size: 1.1rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.02em;
  word-break: break-all;
  line-height: 1.3;
}

/* 상세 내역 */
.details {
  background-color: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.details h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.detail-group {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: var(--bg-card);
  border-radius: 16px;
}

.detail-group:last-child {
  margin-bottom: 0;
}

.detail-group h4 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-group h4::before {
  content: '';
  width: 4px;
  height: 16px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  border-radius: 2px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.detail-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-item span:first-child {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}

.detail-item span:last-child {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.detail-item.highlight {
  background: linear-gradient(135deg, var(--primary-light) 0%, white 100%);
  padding: 1rem;
  margin: 0 -1rem;
  border-radius: 12px;
  border-left: 4px solid var(--primary-color);
}

.detail-item.highlight span {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-color);
}

/* 태블릿 (768px 이상) */
@media (min-width: 768px) {
  header {
    padding: 3.5rem 2.5rem;
  }

  header h1 {
    font-size: 2.25rem;
  }

  .input-section {
    padding: 3rem 2.5rem;
  }

  .result-section {
    padding: 2.5rem;
  }

  .summary {
    grid-template-columns: repeat(3, 1fr);
  }

  .summary-item {
    padding: 1.75rem 1.25rem;
    min-height: 110px;
  }

  .summary-item .label {
    font-size: 0.85rem;
  }

  .summary-item .value {
    font-size: 1.5rem;
  }

  .details {
    padding: 2.5rem;
  }
}

/* 데스크톱 (1024px 이상) */
@media (min-width: 1024px) {
  .container {
    max-width: 800px;
  }

  header {
    padding: 4rem 3rem;
  }

  header h1 {
    font-size: 2.5rem;
  }

  .input-section {
    padding: 3.5rem 3rem;
  }

  .result-section {
    padding: 3rem;
  }

  #salary-input {
    font-size: 1.5rem;
    padding: 1.25rem 5rem 1.25rem 1.5rem;
  }

  .unit {
    font-size: 1.25rem;
    right: 1.5rem;
  }

  .summary-item {
    padding: 2rem 1.5rem;
    min-height: 120px;
  }

  .summary-item .label {
    font-size: 0.9rem;
  }

  .summary-item .value {
    font-size: 1.75rem;
  }

  .details {
    padding: 3rem;
  }
}

/* 접근성 */
*:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

/* 글로벌 네비게이션 바 */
.global-navbar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.navbar-brand a {
  color: white;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  transition: opacity 0.2s;
}

.navbar-brand a:hover {
  opacity: 0.8;
}

.navbar-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
}

.navbar-item {
  position: relative;
}

.navbar-item a {
  display: block;
  padding: 0.75rem 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 8px;
  transition: all 0.2s;
}

.navbar-item a:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: white;
}

.navbar-item.active a {
  background-color: rgba(255, 255, 255, 0.25);
  color: white;
}

/* 드롭다운 메뉴 */
.navbar-dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  min-width: 200px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  z-index: 1000;
  list-style: none;
}

.navbar-dropdown.show .dropdown-menu {
  display: block;
}

.dropdown-menu li {
  margin: 0;
}

.dropdown-menu a {
  display: block;
  padding: 0.75rem 1.25rem;
  color: var(--text-primary) !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
  border-radius: 0;
  background-color: transparent;
}

.dropdown-menu a:hover {
  background-color: var(--primary-light) !important;
  color: var(--primary-color) !important;
}

/* 모바일 반응형 */
@media (max-width: 640px) {
  .navbar-container {
    flex-direction: column;
    height: auto;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }

  .navbar-brand a {
    font-size: 1.1rem;
  }

  .navbar-menu {
    width: 100%;
    justify-content: center;
    gap: 0.25rem;
    flex-wrap: wrap;
  }

  .navbar-item a {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
  
  .dropdown-menu {
    position: static;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 0.25rem;
    border-radius: 8px;
  }
  
  .dropdown-menu a {
    color: white;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }
  
  .dropdown-menu a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
  }
}

/* 네비게이션 바가 있을 때 body 패딩 조정 */
body {
  padding-top: 0;
}

.container {
  margin-top: 2rem;
}

/* 중위소득 계산기 전용 스타일 */
.household-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.household-btn {
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background-color: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.household-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
}

.household-btn.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
  margin-top: 0.5rem;
}

/* 실업급여 계산기 전용 스타일 */
.age-selector,
.period-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.age-btn,
.period-btn {
  padding: 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background-color: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.age-btn:hover,
.period-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
}

.age-btn.active,
.period-btn.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.benefit-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.benefit-table thead {
  background: linear-gradient(135deg, var(--primary-light) 0%, white 100%);
}

.benefit-table th {
  padding: 1rem;
  text-align: center;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
}

.benefit-table td {
  padding: 0.875rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.benefit-table tbody tr:hover {
  background-color: var(--bg-card);
}

.benefit-table tbody tr:last-child td {
  border-bottom: none;
}

/* 알바 계산기 전용 스타일 */
.work-days-selector {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.work-days-btn {
  padding: 0.875rem 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background-color: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.work-days-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
}

.work-days-btn.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.minimum-wage-info {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--primary-light) 0%, white 100%);
  border-radius: 12px;
  border-left: 4px solid var(--primary-color);
}

.minimum-wage-info span {
  font-size: 0.9rem;
  color: var(--primary-color);
  font-weight: 600;
}

.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
}

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

.toggle-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.summary-item.not-eligible {
  opacity: 0.6;
}

.summary-item.not-eligible .value {
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .work-days-selector {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 종합소득세 계산기 전용 스타일 */
.expense-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.expense-btn {
  padding: 1rem 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background-color: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.expense-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
}

.expense-btn.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.deduction-info {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--primary-light) 0%, white 100%);
  border-radius: 12px;
  border-left: 4px solid var(--primary-color);
}

.deduction-info span {
  font-size: 0.9rem;
  color: var(--primary-color);
  font-weight: 600;
}

.tax-rate-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.tax-rate-table thead {
  background: linear-gradient(135deg, var(--primary-light) 0%, white 100%);
}

.tax-rate-table th {
  padding: 1rem;
  text-align: center;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
}

.tax-rate-table td {
  padding: 0.875rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.tax-rate-table tbody tr:hover {
  background-color: var(--bg-card);
}

.tax-rate-table tbody tr:last-child td {
  border-bottom: none;
}

@media (max-width: 640px) {
  .expense-selector {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 부동산 중개수수료 계산기 전용 스타일 */
.transaction-selector,
.property-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.transaction-btn,
.property-btn {
  padding: 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background-color: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.transaction-btn:hover,
.property-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
}

.transaction-btn.active,
.property-btn.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.fee-rate-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.fee-rate-table thead {
  background: linear-gradient(135deg, var(--primary-light) 0%, white 100%);
}

.fee-rate-table th {
  padding: 1rem;
  text-align: center;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
}

.fee-rate-table td {
  padding: 0.875rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.fee-rate-table tbody tr:hover {
  background-color: var(--bg-card);
}

.fee-rate-table tbody tr:last-child td {
  border-bottom: none;
}

@media (max-width: 640px) {
  .transaction-selector,
  .property-selector {
    grid-template-columns: 1fr;
  }
}

/* 글로벌 푸터 */
.global-footer {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  color: rgba(255, 255, 255, 0.9);
  margin-top: 4rem;
  padding: 3rem 0 1.5rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
  margin-bottom: 0.75rem;
}

.footer-section h4 {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.75rem;
}

.footer-section p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  text-align: center;
}

.footer-disclaimer {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.footer-disclaimer a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: underline;
}

.footer-disclaimer a:hover {
  color: white;
}

.footer-copyright {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

/* 약관 페이지 스타일 */
.terms-section {
  padding: 2rem;
  background-color: var(--bg-card);
}

.terms-content {
  background-color: white;
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}

.terms-group {
  margin-bottom: 3rem;
}

.terms-group:last-of-type {
  margin-bottom: 2rem;
}

.terms-group h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--primary-color);
}

.terms-text h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.terms-text p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.terms-text ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.terms-text ul li {
  padding: 0.5rem 0 0.5rem 1.5rem;
  position: relative;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.terms-text ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.2rem;
}

.terms-text strong {
  color: var(--primary-color);
  font-weight: 700;
}

.terms-footer {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
  text-align: center;
}

.terms-footer p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* 모바일 반응형 - 푸터 */
@media (max-width: 640px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .footer-section {
    text-align: center;
  }
  
  .global-footer {
    padding: 2rem 0 1rem;
  }
}

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.benefit-card {
  background-color: white;
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s;
}

.benefit-card.eligible {
  border-color: var(--success-color);
  background: linear-gradient(135deg, var(--success-light) 0%, white 100%);
}

.benefit-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.benefit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.benefit-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.benefit-ratio {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--bg-card);
  padding: 0.25rem 0.75rem;
  border-radius: 8px;
}

.benefit-amount {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.benefit-status {
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-align: center;
}

.benefit-status.eligible {
  background-color: var(--success-light);
  color: var(--success-color);
}

.benefit-status.not-eligible {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
}

.no-benefits {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 1rem;
}

.median-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.median-table thead {
  background: linear-gradient(135deg, var(--primary-light) 0%, white 100%);
}

.median-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
}

.median-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.median-table tbody tr:hover {
  background-color: var(--bg-card);
}

.median-table tbody tr:last-child td {
  border-bottom: none;
}

/* 애니메이션 비활성화 (사용자 설정) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
