/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* CSS Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color Palette - Deep Navy + Cream + Gold */
  --color-navy: #071A2F;
  --color-navy-light: #1B3B5D;
  --color-cream: #F7F3EE;
  --color-cream-dark: #F0EBE3;
  --color-gold: #D4AF37;
  --color-gold-light: #E6C659;
  --color-gray: #8A8F98;
  --color-gray-light: #B8BCC5;
  --color-white: #FFFFFF;
  --color-black: #111318;
  
  /* Typography */
  --font-display: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3rem;
  --spacing-xl: 4rem;
  --spacing-xxl: 6rem;
  
  /* Border Radius */
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(7, 26, 47, 0.08);
  --shadow-md: 0 4px 16px rgba(7, 26, 47, 0.12);
  --shadow-lg: 0 8px 32px rgba(7, 26, 47, 0.16);
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  /* iOS 터치 최적화 */
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  /* 한국어 텍스트 최적화 */
  word-break: keep-all;
  overflow-wrap: break-word;
  /* 모바일 브라우저 최적화 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 터치 스크롤 최적화 */
  -webkit-overflow-scrolling: touch;
  color: var(--color-black);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography Styles */
.display-xl {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.display-lg {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.heading-lg {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 600;
  line-height: 1.3;
}

.heading-md {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  font-weight: 600;
  line-height: 1.3;
}

.heading-sm {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.body-lg {
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.7;
}

.body-md {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
}

.body-sm {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
}

/* Layout Components */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.section {
  padding: var(--spacing-xxl) 0;
}

.section-sm {
  padding: var(--spacing-xl) 0;
}

.grid {
  display: grid;
  gap: var(--spacing-md);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-center {
  align-items: center;
  justify-content: center;
}

.flex-between {
  align-items: center;
  justify-content: space-between;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(7, 26, 47, 0.08);
  z-index: 1000;
  transition: all 0.3s ease;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm) 0;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-navy);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.nav {
  display: flex;
  gap: var(--spacing-lg);
}

.nav-link {
  font-weight: 500;
  color: var(--color-gray);
  text-decoration: none;
  transition: color 0.3s ease;
  padding: var(--spacing-xs) 0;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-navy);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-gold);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-light) 100%);
  color: var(--color-white);
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 80px;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" fill-opacity="0.03"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  background: rgba(212, 175, 55, 0.15);
  color: var(--color-gold);
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: var(--spacing-md);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.hero-title {
  margin-bottom: var(--spacing-md);
  background: linear-gradient(135deg, var(--color-white) 0%, var(--color-gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--color-gray-light);
  margin-bottom: var(--spacing-xl);
  max-width: 600px;
}

.hero-cta {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--border-radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-size: 1rem;
  min-height: 52px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
  color: var(--color-navy);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: transparent;
  color: var(--color-white);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-white);
}

.btn-outline {
  background: transparent;
  color: var(--color-navy);
  border: 2px solid var(--color-navy);
}

.btn-outline:hover {
  background: var(--color-navy);
  color: var(--color-white);
}

/* Event Info Cards */
.event-info {
  background: var(--color-cream);
  padding: var(--spacing-xxl) 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
}

.info-card {
  background: var(--color-white);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.info-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-md);
  font-size: 1.5rem;
}

.info-title {
  color: var(--color-navy);
  margin-bottom: var(--spacing-sm);
}

.info-details {
  color: var(--color-gray);
}

/* Program Section */
.program {
  padding: var(--spacing-xxl) 0;
}

.program-grid {
  display: grid;
  gap: var(--spacing-md);
  margin-top: var(--spacing-xl);
}

.program-item {
  background: var(--color-white);
  border: 1px solid rgba(7, 26, 47, 0.08);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  transition: all 0.3s ease;
}

.program-item:hover {
  border-color: var(--color-gold);
  box-shadow: var(--shadow-md);
}

.program-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--color-gold);
  color: var(--color-navy);
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: var(--spacing-sm);
}

.program-title {
  color: var(--color-navy);
  margin-bottom: var(--spacing-xs);
}

.program-description {
  color: var(--color-gray);
}

/* Registration Section */
.registration {
  background: var(--color-cream);
  padding: var(--spacing-xxl) 0;
}

.registration-form {
  background: var(--color-white);
  padding: var(--spacing-xl);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  margin-top: var(--spacing-xl);
}

.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--color-navy);
  margin-bottom: var(--spacing-xs);
}

.form-input {
  width: 100%;
  padding: var(--spacing-md);
  border: 2px solid rgba(7, 26, 47, 0.1);
  border-radius: var(--border-radius-md);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-gold);
}

/* 전화번호 입력 필드 최적화 */
input[type="tel"] {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

/* 모바일에서 전화번호 입력 최적화 */
@media (max-width: 768px) {
  input[type="tel"] {
    font-size: 16px !important; /* iOS에서 자동 줌 방지 */
    -webkit-appearance: none;
    appearance: none;
  }
}

.form-select {
  width: 100%;
  padding: var(--spacing-md);
  border: 2px solid rgba(7, 26, 47, 0.1);
  border-radius: var(--border-radius-md);
  font-size: 1rem;
  background: var(--color-white);
  cursor: pointer;
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
}

.form-checkbox input {
  margin-top: 4px;
}

/* Contact Info */
.contact-info {
  background: var(--color-navy);
  color: var(--color-white);
  padding: var(--spacing-xl) 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-md);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.contact-icon {
  width: 40px;
  height: 40px;
  background: rgba(212, 175, 55, 0.2);
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold);
}

.contact-text {
  flex: 1;
}

.contact-label {
  font-size: 0.875rem;
  color: var(--color-gray-light);
  display: block;
}

.contact-value {
  font-weight: 600;
  margin-top: 2px;
}

/* Footer */
.footer {
  background: var(--color-black);
  color: var(--color-gray-light);
  padding: var(--spacing-lg) 0;
  text-align: center;
}

/* Mobile-First Responsive Design */
/* 모바일 기본 설정 - 삼성폰/아이폰 최적화 */

/* 기본 모바일 설정 (최대 768px) */
@media (max-width: 768px) {
  :root {
    /* 모바일 전용 간격 조정 */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
  }

  body {
    font-size: 14px;
    line-height: 1.5;
    /* 모바일에서 텍스트 크기 자동 조정 방지 */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
  }

  .container {
    padding: 0 var(--spacing-sm);
    max-width: 100%;
  }

  /* 헤더 모바일 최적화 */
  .header {
    padding: 0.5rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(7, 26, 47, 0.95);
    backdrop-filter: blur(10px);
  }

  .header-content {
    padding: 0.5rem var(--spacing-sm);
    justify-content: center;
  }

  .logo {
    font-size: 1.2rem;
  }

  .nav {
    display: none; /* 모바일에서는 네비게이션 숨김 */
  }

  /* 히어로 섹션 모바일 최적화 */
  .hero {
    padding: 5rem 0 3rem 0; /* 헤더 높이만큼 상단 패딩 추가 */
    text-align: center;
  }

  .hero-title {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    /* 긴 제목의 자동 줄바꿈 */
    word-break: keep-all;
    overflow-wrap: break-word;
  }

  .hero-subtitle {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 2rem;
    /* 부제목 텍스트 최적화 */
    word-break: keep-all;
    overflow-wrap: break-word;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
    /* 터치 타겟 크기 최적화 (44px 이상) */
    min-height: 44px;
  }

  /* 정보 카드 그리드 모바일 최적화 */
  .info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .info-card {
    padding: 1.25rem;
    text-align: left;
  }

  .info-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }

  .info-details p {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
    /* 텍스트 줄바꿈 최적화 */
    word-break: keep-all;
    overflow-wrap: break-word;
  }

  /* 프로그램 그리드 모바일 최적화 */
  .program-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .program-item {
    padding: 1.25rem;
  }

  .program-title {
    font-size: 1.1rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
  }

  .program-description {
    font-size: 0.85rem;
    line-height: 1.4;
    /* 프로그램 설명 텍스트 최적화 */
    word-break: keep-all;
    overflow-wrap: break-word;
  }

  /* 폼 모바일 최적화 */
  .registration-form {
    padding: var(--spacing-md);
  }

  .grid.grid-2,
  .grid.grid-3 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .form-input,
  .form-select {
    font-size: 16px; /* iOS Safari 줌 방지 */
    padding: 0.75rem;
    /* 터치 타겟 크기 최적화 */
    min-height: 44px;
  }

  .form-label {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }

  /* 연락처 그리드 모바일 최적화 */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .contact-item {
    padding: 1rem;
    text-align: center;
  }

  .contact-value {
    font-size: 0.9rem;
    line-height: 1.4;
    /* 연락처 정보 줄바꿈 최적화 */
    word-break: keep-all;
    overflow-wrap: break-word;
  }

  /* 섹션 간격 모바일 최적화 */
  .section {
    padding: 2rem 0;
  }

  .section-sm {
    padding: 1.5rem 0;
  }

  /* 제목 크기 모바일 최적화 */
  .heading-lg {
    font-size: 1.75rem;
    line-height: 1.2;
    margin-bottom: 1rem;
  }

  .heading-md {
    font-size: 1.25rem;
    line-height: 1.3;
  }

  .body-lg {
    font-size: 1rem;
    line-height: 1.4;
  }

  .body-md {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .body-sm {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  /* 오시는 방법 링크 모바일 최적화 */
  .info-details a {
    display: block !important;
    margin: 0.75rem 0 0 0;
    padding: 0.75rem 1rem;
    text-align: center;
    /* 터치 타겟 크기 최적화 */
    min-height: 44px;
    font-size: 0.85rem;
  }
}

/* 작은 모바일 기기 (최대 480px) - 갤럭시 S 시리즈, 작은 아이폰 */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.75rem;
  }

  .hero-subtitle {
    font-size: 0.9rem;
  }

  .container {
    padding: 0 0.5rem;
  }

  .info-card,
  .program-item {
    padding: 1rem;
  }

  .registration-form {
    padding: 1rem;
  }

  /* 매우 긴 텍스트 처리 */
  .program-description {
    font-size: 0.8rem;
  }

  .form-input,
  .form-select {
    padding: 0.625rem;
  }
}

/* 큰 모바일/작은 태블릿 (481px ~ 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .hero-title {
    font-size: 2.25rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .info-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

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

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

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

/* Animation Classes */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.6s ease forwards;
}

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

.slide-up {
  transform: translateY(20px);
  opacity: 0;
  animation: slideUp 0.6s ease forwards;
}

@keyframes slideUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Loading States */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

.loading .btn {
  position: relative;
}

.loading .btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* 모바일 전용 유틸리티 클래스 */
@media (max-width: 768px) {
  /* 모바일에서만 숨김 */
  .mobile-hidden {
    display: none !important;
  }

  /* 모바일에서만 표시 */
  .mobile-only {
    display: block !important;
  }

  /* 모바일 텍스트 최적화 */
  .mobile-text-optimize {
    word-break: keep-all;
    overflow-wrap: break-word;
    line-height: 1.5;
  }

  /* 모바일 터치 타겟 최적화 */
  .mobile-touch-target {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* 모바일 간격 최적화 */
  .mobile-spacing {
    margin: 0.75rem 0;
  }

  /* 모바일 패딩 최적화 */
  .mobile-padding {
    padding: 0.5rem 1rem;
  }
}

/* iOS Safari 터치 최적화 */
[role="button"], 
button,
.btn,
.touchable {
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
  /* 최소 터치 영역 44px 확보 */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 위치 안내 버튼 스타일 */
.location-guide-btn {
  -webkit-touch-callout: none !important;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  touch-action: manipulation !important;
}

/* 세부일정 버튼 스타일 */
.detailed-schedule-btn {
  -webkit-touch-callout: none !important;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  touch-action: manipulation !important;
}

/* iOS에서 터치 가능한 요소 스타일 */
@media (max-width: 768px) {
  [role="button"]:active,
  button:active,
  .btn:active,
  .touchable:active,
  .location-guide-btn:active,
  .detailed-schedule-btn:active {
    transform: scale(0.98) !important;
    transition: transform 0.1s ease !important;
  }
  
  .location-guide-btn:active {
    background-color: var(--color-gold) !important;
    color: var(--color-navy) !important;
  }
  
  .detailed-schedule-btn:active {
    background-color: transparent !important;
    color: var(--color-gold) !important;
  }

  /* iOS Safari 전용 터치 최적화 */
  .location-guide-btn,
  .detailed-schedule-btn {
    -webkit-appearance: none !important;
    appearance: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
  }
  
  .location-guide-btn:focus,
  .detailed-schedule-btn:focus {
    outline: 2px solid var(--color-gold) !important;
    outline-offset: 2px !important;
  }
  
  /* 모바일에서 세부일정 버튼 크기 조정 */
  .detailed-schedule-btn {
    padding: 0.875rem 1.25rem !important;
    font-size: 0.9rem !important;
    min-height: 48px !important;
  }
}
  .mobile-padding {
    padding: 0.75rem;
  }

  /* 전체 너비 사용 */
  .mobile-full-width {
    width: 100% !important;
  }

  /* 모바일 센터 정렬 */
  .mobile-center {
    text-align: center;
  }

  /* 모바일 좌측 정렬 */
  .mobile-left {
    text-align: left;
  }
}