/* 부가세 위키 블로그 전용 CSS - common-styles.css */

/* 워드프레스 스타일 변수 */
:root {
  --wp-blue: #0d6efd;
  --wp-dark-blue: #0a58ca;
  --wp-light-gray: #f8f9fa;
  --wp-gray: #6c757d;
  --wp-dark-gray: #212529;
  --wp-border: #dee2e6;
  --wp-accent: #0d6efd;
  --sidebar-width: 280px;
  --ad-width: 160px;
}

/* 기본 리셋 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: #212529;
  line-height: 1.8;
  background: #fff;
  font-size: 16px;
}

/* 글로벌 네비게이션 */
.global-nav {
  background: var(--wp-dark-gray);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 46px;
  padding: 0 20px;
}

.nav-left {
  display: flex;
  align-items: center;
  width: 100%;
}

.nav-brand {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 20px;
  margin-right: 30px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  padding: 10px;
  cursor: pointer;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  padding: 0 15px;
  line-height: 46px;
  font-size: 14px;
  transition: color 0.2s;
}

.nav-menu a:hover,
.nav-menu .active {
  color: var(--wp-accent);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid var(--wp-border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  min-width: 200px;
  z-index: 1001;
  display: none;
}

.nav-dropdown:hover .nav-dropdown-content {
  display: block;
}

.nav-dropdown-content a {
  color: #333;
  padding: 10px 15px;
  border-bottom: 1px solid #f0f0f0;
  display: block;
  line-height: 1.5;
}

.nav-dropdown-content a:hover {
  background: var(--wp-light-gray);
  color: var(--wp-blue);
}

/* 브레드크럼 */
.breadcrumb {
  background: var(--wp-light-gray);
  padding: 12px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--wp-border);
}

.breadcrumb-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.breadcrumb a {
  color: var(--wp-blue);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* 데스크톱 레이아웃 */
.desktop-layout {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  padding: 40px 20px;
  gap: 30px;
}

/* 광고 영역 */
.left-ad, .right-ad {
  width: var(--ad-width);
  flex-shrink: 0;
}

/* 광고 스티키 */
.ad-sticky {
  position: sticky;
  top: 66px;
  height: fit-content;
}

/* 반응형 광고 */
.responsive-ad .ad-desktop {
  display: block;
}

.responsive-ad .ad-mobile {
  display: none;
}

/* 광고 컨테이너 */
.ad-container {
  background: var(--wp-light-gray);
  text-align: center;
  border: 1px solid var(--wp-border);
  border-radius: 4px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-container.vertical {
  min-height: 600px;
}

.ad-container.horizontal {
  min-height: 50px;
  padding: 10px;
}

.ad-container.box {
  min-height: 250px;
}

.content-ad .ad-container {
  margin: 30px 0;
  min-height: 90px;
}

.ad-label {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ad-placeholder {
  color: #999;
  font-size: 12px;
}

/* 사이드바 네비게이션 */
.sidebar-nav {
  width: var(--sidebar-width);
  flex-shrink: 0;
}

.sidebar-sticky {
  position: sticky;
  top: 66px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.sidebar-nav h3 {
  background: var(--wp-light-gray);
  padding: 15px 20px;
  margin: 0 0 20px;
  font-size: 16px;
  color: var(--wp-dark-gray);
  border-left: 3px solid var(--wp-blue);
}

.guide-accordion {
  background: #fff;
  border: 1px solid var(--wp-border);
  border-radius: 4px;
}

.current-position {
  padding: 12px 15px;
  background: #fff;
  border-bottom: 1px solid var(--wp-border);
  cursor: pointer;
  font-size: 14px;
}

.current-position .badge {
  background: var(--wp-blue);
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  margin-right: 8px;
}

.accordion-content {
  display: block;
  padding: 10px 0;
}

.season {
  margin-bottom: 15px;
}

.season h4 {
  font-size: 13px;
  color: var(--wp-gray);
  margin-bottom: 8px;
  padding: 0 15px;
  font-weight: 600;
  text-transform: uppercase;
}

.season ul {
  list-style: none;
  padding: 0;
}

.season li a,
.season li.active {
  display: block;
  padding: 8px 15px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}

.season li a:hover {
  background: var(--wp-light-gray);
  color: var(--wp-blue);
}

.season li.active {
  background: var(--wp-light-gray);
  color: var(--wp-blue);
  border-left-color: var(--wp-blue);
  font-weight: 600;
}

.quick-links {
  padding: 15px;
  border-top: 1px solid var(--wp-border);
  display: flex;
  gap: 10px;
}

.link-button {
  flex: 1;
  text-align: center;
  padding: 8px;
  background: var(--wp-blue);
  color: white !important;
  border-radius: 4px;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s;
}

.link-button:hover {
  background: var(--wp-dark-blue);
}

/* 메인 콘텐츠 */
.main-content {
  flex: 1;
  max-width: 720px;
  min-width: 0;
}

.main-content h1 {
  color: var(--wp-dark-gray);
  font-size: 32px;
  line-height: 1.3;
  margin-bottom: 20px;
  font-weight: 700;
}

.main-content h2 {
  color: var(--wp-dark-gray);
  font-size: 24px;
  margin: 40px 0 20px;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--wp-border);
}

.main-content h3 {
  color: var(--wp-dark-gray);
  font-size: 20px;
  margin: 30px 0 15px;
  font-weight: 600;
}

.main-content p {
  margin-bottom: 20px;
  word-break: keep-all;
}

.main-content ul, 
.main-content ol {
  margin-bottom: 20px;
  padding-left: 30px;
}

.main-content li {
  margin-bottom: 8px;
}

.main-content a {
  color: var(--wp-blue);
  text-decoration: none;
}

.main-content a:hover {
  text-decoration: underline;
}

/* 콘텐츠 박스들 */
.warning-box {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 20px;
  margin: 25px 0;
}

.toc {
  background: var(--wp-light-gray);
  border: 1px solid var(--wp-border);
  border-radius: 4px;
  padding: 20px;
  margin: 25px 0;
}

.toc h2 {
  font-size: 18px;
  margin: 0 0 15px;
  padding: 0;
  border: none;
  color: var(--wp-dark-gray);
}

.toc ul {
  list-style: none;
  padding-left: 0;
}

.toc li {
  padding: 5px 0;
  border-bottom: 1px solid #eee;
}

.toc li:last-child {
  border-bottom: none;
}

.case-study,
.checklist-box {
  background: #fff;
  border: 1px solid var(--wp-border);
  border-radius: 4px;
  padding: 20px;
  margin: 25px 0;
}

.checklist-box h3,
.case-study h4 {
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--wp-blue);
}

.checklist-box ul {
  list-style: none;
  padding-left: 0;
}

.checklist-box li {
  padding: 8px 0;
  padding-left: 25px;
  position: relative;
}

.checklist-box li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--wp-blue);
  font-weight: bold;
}

/* 테이블 */
.comparison-table {
  margin: 25px 0;
}

.comparison-table h3 {
  margin-bottom: 15px;
  color: var(--wp-dark-gray);
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--wp-border);
}

th {
  background: var(--wp-light-gray);
  color: var(--wp-dark-gray);
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 2px solid var(--wp-border);
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--wp-border);
  font-size: 14px;
}

tr:nth-child(even) {
  background: #fafafa;
}

.highlight-cell td {
  background: #e3f2fd !important;
  font-weight: 600;
  color: var(--wp-blue);
}

/* CTA & 버튼 */
.calc-box {
  background: var(--wp-light-gray);
  border: 1px solid var(--wp-blue);
  padding: 30px;
  border-radius: 8px;
  text-align: center;
  margin: 40px 0;
}

.calc-box h3 {
  color: var(--wp-blue);
  margin: 0 0 15px;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 15px;
}

.button {
  display: inline-block;
  padding: 12px 24px;
  background: var(--wp-blue);
  color: white !important;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
  border: 2px solid var(--wp-blue);
}

.button:hover {
  background: var(--wp-dark-blue);
  border-color: var(--wp-dark-blue);
  text-decoration: none;
}

.button.accent {
  background: #ffc107;
  color: #000 !important;
  border-color: #ffc107;
}

.button.accent:hover {
  background: #ffb300;
  border-color: #ffb300;
}

/* 다음편 안내 */
.next-episode {
  background: var(--wp-light-gray);
  padding: 25px;
  border-radius: 4px;
  margin: 40px 0;
  text-align: center;
  border: 1px solid var(--wp-border);
}

/* FAQ */
.faq-section {
  margin-top: 30px;
}

.faq-item {
  background: #fff;
  border: 1px solid var(--wp-border);
  border-radius: 4px;
  padding: 20px;
  margin: 15px 0;
}

/* 푸터 */
.footer-notice {
  margin-top: 50px;
  padding: 20px;
  background: var(--wp-light-gray);
  border-radius: 4px;
  font-size: 13px;
  color: var(--wp-gray);
  text-align: center;
  border: 1px solid var(--wp-border);
}

/* 모바일 네비게이션 */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--wp-border);
  z-index: 999;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.mobile-bottom-nav button,
.mobile-bottom-nav a {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  color: var(--wp-dark-gray);
  font-size: 14px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  border-right: 1px solid var(--wp-border);
}

.mobile-bottom-nav button:last-child,
.mobile-bottom-nav a:last-child {
  border-right: none;
}

.mobile-anchor-ad {
  display: none;
  position: fixed;
  bottom: 50px;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--wp-border);
  padding: 5px;
  text-align: center;
  z-index: 998;
}

.ad-close {
  position: absolute;
  top: 5px;
  right: 10px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #666;
  padding: 5px 10px;
}

/* 반응형 - 태블릿 */
@media (max-width: 1200px) {
  .left-ad, .right-ad {
    display: none;
  }
  
  .desktop-layout {
    padding: 30px 20px;
  }
}

/* 반응형 - 모바일 */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block !important;
  }

  .nav-container {
    padding: 0 5px;  /* 모바일에서 패딩 줄이기 */
  }

  .nav-menu {
    display: none !important;
    position: fixed;
    top: 46px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 10px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-top: 1px solid var(--wp-border);
    max-height: calc(100vh - 46px);
    overflow-y: auto;
    z-index: 1002;
  }
  
  .nav-menu.mobile-active {
    display: flex !important;
  }
  
  .nav-menu a {
    color: #333 !important;
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
  }
  
  .nav-dropdown-content {
    position: relative;
    display: block !important;
    background: var(--wp-light-gray);
    border: none;
    box-shadow: none;
    margin: 0;
    padding-left: 20px;
  }

  .desktop-layout {
    flex-direction: column;
    padding: 20px 15px 80px;
    gap: 20px;
  }

  .sidebar-nav {
    width: 100%;
    order: -1;
  }

  .sidebar-sticky {
    position: relative;
    top: 0;
    max-height: none;
  }

  .current-position:after {
    content: "▼";
    float: right;
    color: var(--wp-blue);
    transition: transform 0.3s;
  }

  .guide-accordion.expanded .current-position:after {
    transform: rotate(180deg);
  }

  .accordion-content {
    display: none;
  }

  .guide-accordion.expanded .accordion-content {
    display: block;
  }

  .main-content {
    max-width: 100%;
  }

  .main-content h1 {
    font-size: 26px;
  }

  .main-content h2 {
    font-size: 20px;
    margin: 30px 0 15px;
  }

  /* 반응형 광고 전환 */
  .responsive-ad .ad-desktop {
    display: none !important;
  }

  .responsive-ad .ad-mobile {
    display: block !important;
  }

  .content-ad {
    margin: 20px -15px;
  }

  .content-ad .ad-container {
    border-radius: 0;
    border-left: none;
    border-right: none;
    min-height: 250px;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .mobile-anchor-ad {
    display: block;
  }

  .ad-sticky {
    position: relative;
    top: 0;
  }

  th, td {
    padding: 8px;
    font-size: 13px;
  }

  .button {
    padding: 10px 18px;
    font-size: 14px;
  }

  .button-group {
    flex-direction: column;
  }

  .button-group .button {
    width: 100%;
  }
}