@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;800&family=Nanum+Brush+Script&display=swap');

:root {
  /* Color Palette - Sky Blue Theme (Jeju Pine and Sky) */
  --primary-hue: 205;
  --primary-sat: 75%;
  --primary-light: 45%;
  
  --primary: hsl(var(--primary-hue), var(--primary-sat), var(--primary-light));
  --primary-hover: hsl(var(--primary-hue), var(--primary-sat), calc(var(--primary-light) - 8%));
  --primary-alpha: hsla(var(--primary-hue), var(--primary-sat), var(--primary-light), 0.1);
  
  --accent-hue: 38;
  --accent-sat: 95%;
  --accent-light: 50%;
  --accent: hsl(var(--accent-hue), var(--accent-sat), var(--accent-light)); /* Warm Gold Accent */
  --accent-soft: hsla(var(--accent-hue), var(--accent-sat), var(--accent-light), 0.15);
  
  /* Neutral Colors */
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  
  /* Shadows & Radius */
  --border-radius: 12px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);
  --transition-smooth: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Dark Mode Variables option */
[data-theme="dark"] {
  --bg: #0b0f19;
  --bg-card: #151c2c;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Nanum Gothic", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  transition: var(--transition-smooth);
}

/* Typo Scale */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: var(--transition-smooth);
}

[data-theme="dark"] .navbar {
  background-color: rgba(11, 15, 25, 0.8);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--primary);
}

.logo img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-icon {
  background: none;
  border: 1px solid var(--border-color);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: var(--transition-smooth);
}

.btn-icon:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-alpha);
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding: 120px 24px 80px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(15, 23, 42, 0.45) 100%);
  z-index: 1;
}

.hero-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  z-index: 2;
  color: #ffffff;
  width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 24px;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  color: #999999;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 400;
  opacity: 0.9;
  max-width: 600px;
  margin-bottom: 40px;
}

/* Sections */
.section {
  padding: 100px 24px;
  max-width: 1200px;
  margin: 0 auto;
  scroll-margin-top: 80px; /* Offset for sticky nav */
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-tag {
  font-family: 'Outfit', sans-serif;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  display: inline-block;
}

.section-title {
  font-size: 2.2rem;
  margin-bottom: 16px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Intro Grid */
.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.intro-image-container {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

.intro-image-container img {
  width: 100%;
  display: block;
  object-fit: cover;
  height: 480px;
}

.intro-text-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.intro-signature {
  margin-top: 15px;
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Liturgy & News (Weekly Bulletin Specifics) */
.bulletin-container {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: start;
}

.bulletin-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

.bulletin-box-title {
  font-size: 1.4rem;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-alpha);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
}

/* Liturgy Table */
.liturgy-table {
  width: 100%;
  border-collapse: collapse;
}

.liturgy-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.liturgy-order {
  font-weight: 700;
  color: var(--text);
  width: 25%;
}

.liturgy-detail {
  color: var(--text-muted);
  width: 45%;
  text-align: center;
}

.liturgy-leader {
  font-weight: 600;
  color: var(--text);
  width: 30%;
  text-align: right;
}

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

/* Prayer & Info Lists */
.bulletin-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bulletin-list-item {
  position: relative;
  padding-left: 20px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.bulletin-list-item::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-size: 1.25rem;
  line-height: 1;
}

/* Worship Guide Table Grid */
.worship-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.worship-table th, .worship-table td {
  padding: 16px;
  border: 1px solid var(--border-color);
  text-align: center;
}

.worship-table th {
  background-color: var(--primary-alpha);
  color: var(--primary);
  font-weight: 700;
}

.worship-table td {
  background-color: var(--bg-card);
}

.worship-table .worship-category {
  font-weight: 700;
  background-color: var(--bg);
  width: 20%;
}

.worship-table .worship-time {
  width: 50%;
}

.worship-table .worship-place {
  width: 30%;
}

/* Account Info Card */
.account-card {
  margin-top: 30px;
  background-color: var(--primary-alpha);
  border: 1px solid var(--primary-hover);
  border-radius: var(--border-radius);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.account-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-icon {
  background-color: var(--primary);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.account-details h5 {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.account-details p {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.btn-copy {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-copy:hover {
  background-color: var(--primary-hover);
}

/* Location Map / Form Control */
.map-container {
  height: 400px;
  width: 100%;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg);
  position: relative;
}

.map-placeholder-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 90%;
}

.comment-submit-btn {
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.comment-submit-btn:hover {
  background-color: var(--primary-hover);
}

/* Footer */
.footer {
  background-color: #0f172a;
  color: #94a3b8;
  padding: 60px 24px;
  font-size: 0.9rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 40px;
}

.footer-brand {
  max-width: 320px;
}

.footer-brand-title {
  color: #ffffff;
  font-weight: 800;
  font-size: 1.25rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links {
  display: flex;
  gap: 60px;
}

.footer-links-col h5 {
  color: #ffffff;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.footer-links-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links-col a {
  text-decoration: none;
  color: #94a3b8;
  transition: var(--transition-smooth);
}

.footer-links-col a:hover {
  color: #ffffff;
}

.footer-bottom {
  max-width: 1200px;
  margin: 40px auto 0;
  border-top: 1px solid #1e293b;
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
}

/* Image Upload Preview */
.image-upload-preview {
  display: inline-block;
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
  max-width: 200px;
}

.image-upload-preview img {
  width: 100%;
  display: block;
  max-height: 120px;
  object-fit: cover;
}

.image-preview-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  background-color: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive Rules */
@media (max-width: 900px) {
  .intro-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .intro-image-container img {
    height: 320px;
  }
  .bulletin-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .footer-container {
    flex-direction: column;
    gap: 30px;
  }
  .footer-links {
    width: 100%;
    justify-content: space-between;
    gap: 20px;
  }

  /* Mobile Header Optimization */
  .navbar-container {
    padding: 0 10px;
    gap: 16px;
  }
  .logo {
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .logo svg {
    width: 28px !important;
    height: 28px !important;
  }
  .logo-subtext {
    font-size: 0.58rem;
  }
  .logo-subtext .subtext-line2 {
    letter-spacing: 1px;
    margin-right: -1px;
  }
  .logo-title-brush {
    font-size: 1.25rem;
    margin-left: 2px;
    white-space: nowrap;
  }
  .nav-links {
    gap: 12px;
    flex-wrap: nowrap;
  }
  .nav-links li {
    white-space: nowrap;
  }
  .nav-links a {
    font-size: 0.85rem;
    white-space: nowrap;
  }
  .nav-dropdown .dropdown-trigger svg,
  .nav-dropdown .dropdown-trigger i {
    display: none !important;
  }
  .nav-actions {
    gap: 8px;
  }
  .btn-icon {
    width: 34px;
    height: 34px;
  }
  .btn-icon i {
    width: 16px !important;
    height: 16px !important;
    font-size: 16px !important;
  }

  /* Modal & Map Optimization for Mobile Viewports */
  .section {
    top: 70px;
    padding: 24px 16px;
    max-height: calc(100vh - 90px);
  }
  .section-header {
    margin-bottom: 20px;
  }
  .map-container {
    height: 280px !important;
  }
  .map-placeholder-info i {
    width: 36px !important;
    height: 36px !important;
    margin-bottom: 6px !important;
  }
  .map-placeholder-info h4 {
    font-size: 1.1rem !important;
    margin-bottom: 4px !important;
  }
  .map-placeholder-info p {
    margin-bottom: 12px !important;
    font-size: 0.85rem !important;
  }
  .comment-submit-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
  }
}

@media (max-width: 600px) {
  .navbar-container {
    padding: 0 8px;
    gap: 12px;
  }
  .logo-subtext {
    display: none !important;
  }
  .logo-title-brush {
    font-size: 1.05rem !important;
    margin-left: 0;
    white-space: nowrap;
  }
  .nav-links {
    gap: 8px;
    flex-wrap: nowrap;
  }
  .nav-links li {
    white-space: nowrap;
  }
  .nav-links a {
    font-size: 0.8rem;
    white-space: nowrap;
  }
  .nav-actions {
    display: none !important; /* Hide actions on mobile to make room for clean spacing */
  }
}

/* Calligraphic Logo Layout (Hwagokdong Style) */
.logo-subtext {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
  font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: -0.2px;
}

.logo-subtext .subtext-line2 {
  letter-spacing: 3px;
  margin-right: -3px;
}

.logo-title-brush {
  font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', -apple-system, sans-serif;
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--text);
  margin-left: 6px;
  line-height: 1;
  letter-spacing: -0.5px;
}

[data-theme="dark"] .logo-title-brush {
  color: #ffffff;
}

/* Tab Button Styles */
.tab-btn {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 30px;
  padding: 10px 24px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
}

.tab-btn:hover {
  background-color: var(--primary-alpha);
  color: var(--primary);
  border-color: var(--primary);
}

.tab-btn.active {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Dropdown Menu Styles (Hwagokdong Navigation Hover style) */
.nav-dropdown {
  position: relative;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 2px;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  list-style: none;
  min-width: 140px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 1001;
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu li {
  width: 100%;
}

.dropdown-menu a {
  display: block !important;
  padding: 10px 16px !important;
  color: var(--text) !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: var(--transition-smooth) !important;
  text-align: center !important;
}

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

/* Page Scroll & Full-viewport Hero Overrides */
body.modal-open {
  overflow: hidden; /* Disable scroll only when modal is active */
}

.hero {
  height: calc(100vh - 80px) !important; /* Force fit viewport */
  min-height: auto !important;
  overflow: hidden;
}

/* Modal Overlay Styling for Sections */
.section {
  display: none; /* Hidden by default */
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: 90%;
  max-width: 1000px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 40px;
  z-index: 2000;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  scroll-margin-top: 0;
  border-top: 1px solid var(--border-color) !important;
}

.section.modal-active {
  transform: translateX(-50%) translateY(0);
}

/* Close Button */
.btn-close-modal {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 2.2rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
  z-index: 2010;
  padding: 4px;
}

.btn-close-modal:hover {
  color: var(--primary);
  transform: scale(1.1);
}
