/* Modern, clean styles with softer yellow theme */
:root {
  /* 메인 색상 - 더 연하고 세련된 노란색 */
  --primary-yellow: #FFEB3B;
  --primary-yellow-light: #FFF9C4;
  --primary-yellow-dark: #FFD600;
  --primary-gradient: linear-gradient(135deg, #eecf46 0%, #f8e53d 100%);
  
  /* 보조 색상 */
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  --bg-white: #FFFFFF;
  --bg-light: #F8F9FA;
  --bg-lighter: #FAFBFC;
  --border-color: #E9ECEF;
  --border-light: #F1F3F5;
  
  /* 그림자 */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-yellow: 0 4px 16px rgba(255, 235, 59, 0.2);
  
  /* 애니메이션 */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* 다크모드 */
@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #F8F9FA;
    --text-secondary: #ADB5BD;
    --text-muted: #868E96;
    --bg-white: #1A1A1A;
    --bg-light: #252525;
    --bg-lighter: #2A2A2A;
    --border-color: #343434;
    --border-light: #3A3A3A;
    --primary-gradient: linear-gradient(135deg, #FFD600 0%, #FFA000 100%);
  }
}

/* 기본 스타일 */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg-white);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* 헤더 */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.9);
}

@media (prefers-color-scheme: dark) {
  .header {
    background-color: rgba(26, 26, 26, 0.9);
  }
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

/* 네비게이션 */
.desktop-nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.nav-link:hover {
  background-color: var(--primary-yellow-light);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--primary-gradient);
  color: var(--text-primary);
  font-weight: 600;
}

/* 모바일 메뉴 버튼 */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-menu-toggle span {
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  margin: 3px 0;
  transition: var(--transition-fast);
  border-radius: 2px;
}

/* 모바일 사이드바 */
.mobile-sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100vh;
  background-color: var(--bg-white);
  box-shadow: var(--shadow-lg);
  transition: left var(--transition-normal);
  z-index: 2000;
  overflow-y: auto;
}

.mobile-sidebar.active {
  left: 0;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.close-sidebar {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-primary);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav {
  padding: 16px 0;
}

.mobile-nav .nav-link {
  display: block;
  padding: 12px 20px;
  border-radius: 0;
  margin: 0;
}

.mobile-nav .nav-link:hover {
  background-color: var(--bg-light);
}

.nav-separator {
  height: 1px;
  background-color: var(--border-color);
  margin: 16px 20px;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal);
  z-index: 1999;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* 메인 컨텐츠 */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* 히어로 섹션 */
.hero-section {
  text-align: center;
  margin-bottom: 32px;
  animation: fadeInUp 0.6s ease-out;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  margin: 0 0 8px 0;
  line-height: 1.2;
  letter-spacing: -1px;
}

.hero-title .highlight {
  color: var(--text-primary);
  font-weight: 900;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin: 0;
}

/* 섹션 */
.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: var(--text-primary);
}

.category-group {
  margin-bottom: 48px;
}

.category-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: var(--text-primary);
}

/* 그리드 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

/* 카드 */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
  transform: translateY(-3px);
  transition: transform var(--transition-normal);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-yellow);
}

.card:hover::before {
  transform: translateY(0);
}

.card.popular {
  border-color: var(--primary-yellow);
  background: linear-gradient(to bottom, var(--primary-yellow-light), var(--bg-white));
}

.card.new::after {
  content: 'NEW';
  position: absolute;
  top: 8px;
  right: 8px;
  background: #FF4757;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.card.premium {
  background: linear-gradient(135deg, #FFF3CD 0%, #FFE082 100%);
  border-color: #FFD54F;
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 4px;
}

.card-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0;
}

.card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

/* 생성기 섹션 */
.generator-section {
  background: var(--bg-light);
  border-radius: 16px;
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}

.generator-container {
  max-width: 600px;
  margin: 0 auto;
}

.input-group {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.input-field, .select-field {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 16px;
  transition: all var(--transition-fast);
  background: var(--bg-white);
}

.input-field:focus, .select-field:focus {
  outline: none;
  border-color: var(--primary-yellow);
  box-shadow: 0 0 0 3px rgba(255, 235, 59, 0.1);
}

.button-group {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--primary-gradient);
  color: var(--text-primary);
  box-shadow: var(--shadow-yellow);
  flex: 1;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 235, 59, 0.3);
}

.btn-secondary {
  background: var(--bg-white);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-light);
  border-color: var(--primary-yellow);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: inherit;
}

.output-box {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  min-height: 120px;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  margin: 0;
  color: var(--text-primary);
}

/* 최근 카피 */
#recent-copy {
  background: var(--bg-light);
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
}

.recent-copy-item {
  background: var(--bg-white);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  border-left: 3px solid var(--primary-yellow);
  box-shadow: var(--shadow-sm);
}

.recent-copy-item:last-child {
  margin-bottom: 0;
}

/* 프로모션 섹션 */
.promo-section {
  background: linear-gradient(135deg, rgba(255, 235, 59, 0.05) 0%, rgba(255, 235, 59, 0.1) 100%);
  border-radius: 16px;
  padding: 32px;
  margin: 48px 0;
  text-align: center;
}

.promo-section.small {
  margin: 20px 0;
  padding: 16px;
  border-radius: 12px;
}

.promo-link.small {
  padding: 10px 16px;
  font-size: 0.9rem;
  margin: 8px 0;
}

.promo-section p {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 20px 0;
}

.promo-link {
  display: block;
  padding: 16px 24px;
  background: var(--primary-gradient);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  margin: 12px 0;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-yellow);
}

.promo-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 235, 59, 0.3);
}

/* 광고 영역 */
.ad-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  background: var(--bg-light);
  border-radius: 12px;
  margin: 32px 0;
  border: 1px dashed var(--border-color);
}

/* 푸터 */
.footer {
  background: var(--bg-light);
  border-top: 1px solid var(--border-color);
  margin-top: 80px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 20px 24px;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 32px;
}

.footer-brand h3 {
  font-size: 1.5rem;
  margin: 0 0 8px 0;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-brand p {
  color: var(--text-secondary);
  margin: 0;
}

.footer-links h4 {
  font-size: 1rem;
  margin: 0 0 16px 0;
  color: var(--text-primary);
}

.footer-links a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 0;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--primary-yellow-dark);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-bottom a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-bottom a:hover {
  color: var(--text-secondary);
}

/* 애니메이션 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.loading {
  background: linear-gradient(90deg, 
    var(--bg-light) 25%, 
    var(--bg-lighter) 50%, 
    var(--bg-light) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* 반응형 */
@media (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }
  
  .desktop-nav {
    display: none;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  .input-group {
    flex-direction: column;
  }
  
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .generator-section {
    padding: 16px 12px;
    margin: 16px 0;
  }
  
  main {
    padding: 16px 12px;
  }
  
  .footer-top {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 480px) {
  main {
    padding: 24px 16px;
  }
  
  .hero-title {
    font-size: 1.75rem;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .card {
    padding: 16px;
  }
  
  .card-icon {
    font-size: 1.5rem;
  }
  
  .card-title {
    font-size: 1rem;
  }
}

/* 블로그 콘텐츠 */
.blog-content {
  background: var(--bg-white);
  border-radius: 16px;
  padding: 32px;
  margin: 32px 0;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.blog-content h2 {
  color: var(--text-primary);
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 16px 0;
  border-bottom: 2px solid var(--primary-yellow);
  padding-bottom: 8px;
}

.blog-content h3 {
  color: var(--text-primary);
  font-size: 1.4rem;
  font-weight: 600;
  margin: 24px 0 12px 0;
}

.blog-content h4 {
  color: var(--primary-yellow-dark);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 16px 0 8px 0;
}

.blog-content p {
  line-height: 1.7;
  margin: 0 0 16px 0;
  color: var(--text-secondary);
}

.blog-content ul, .blog-content ol {
  padding-left: 20px;
  margin: 16px 0;
}

.blog-content li {
  margin: 8px 0;
  line-height: 1.6;
  color: var(--text-secondary);
}

.blog-content blockquote {
  border-left: 4px solid var(--primary-yellow);
  padding: 16px 20px;
  margin: 20px 0;
  background: var(--bg-light);
  font-style: italic;
  border-radius: 0 8px 8px 0;
}

.blog-content cite {
  font-weight: 600;
  color: var(--text-primary);
  font-style: normal;
}

.blog-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
  border-radius: 8px;
  overflow: hidden;
}

.blog-content table th {
  background: var(--primary-yellow-light);
  padding: 12px;
  font-weight: 600;
  text-align: left;
  border-bottom: 2px solid var(--primary-yellow);
}

.blog-content table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.blog-content table tr:nth-child(even) {
  background: var(--bg-lighter);
}

.blog-content table tr:hover {
  background: var(--primary-yellow-light);
}

/* 접근성 */
.btn:focus-visible,
.input-field:focus-visible,
.select-field:focus-visible {
  outline: 3px solid var(--primary-yellow);
  outline-offset: 2px;
}

/* 프린트 스타일 */
@media print {
  .header,
  .mobile-sidebar,
  .ad-wrap,
  .promo-section,
  .footer {
    display: none;
  }
}