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

body {
  font-family: "Noto Sans KR", sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f4f7f6; /* 변경: 기본 배경색을 좀 더 부드럽게 */
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem; /* 기본 좌우 패딩 약간 줄임 */
}

/* Header Styles */
.header {
  background: white; /* 변경: 헤더 배경 명확하게 */
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem; /* 변경: 패딩 약간 조정 */
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.nav-menu {
  display: flex;
  list-style: none;
  align-items: center; /* 추가: 세로 정렬 */
  gap: 2rem;
}

.nav-menu a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color 0.3s ease;
  padding: 0.5rem 0; /* 추가: 클릭 영역 확보 */
  position: relative;
}

.nav-menu a:hover {
  color: #667eea;
}

.nav-menu a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  transition: width 0.3s ease;
}

.nav-menu a:hover::after {
  width: 100%;
}

.nav-menu a.active { /* 추가: 활성 네비게이션 링크 스타일 */
  color: #667eea;
  font-weight: 700;
}

.auth-buttons {
  display: flex;
  gap: 1rem;
  align-items: center;
}

#loginButtonContainer {
  display: flex; /* 내부 버튼 정렬을 위해 */
  justify-content: flex-end; /* 버튼들을 오른쪽으로 정렬 */
  align-items: center; /* 수직 가운데 정렬 */
  gap: 0.5rem; /* 버튼 사이의 간격 */
  min-width: 200px; /* 중요: 실제 버튼들이 차지하는 최대 너비에 가깝게 설정합니다. "로그인", "회원가입" 두 버튼 또는 "사용자이름님", "로그아웃" 버튼이 모두 들어갈 수 있는 충분한 너비로 조정하세요. */
  height: 40px; /* 헤더 내 다른 버튼들과 높이를 맞추기 위한 값. 버튼 스타일에 따라 자동 조절될 수도 있습니다. */
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  /* color: #333; */ /* span으로 대체되므로 제거 또는 주석 처리 */
  /* display: flex; */ /* span으로 대체되므로 제거 또는 주석 처리 */
  align-items: center; /* 수직 가운데 정렬 */
  justify-content: center; /* 수평 가운데 정렬 */
  width: 40px; /* 버튼 크기 고정 */
  height: 40px; /* 버튼 크기 고정 */
  position: relative; /* span 위치 기준 */
  padding: 0; /* 내부 패딩 제거 */
}

.mobile-menu-toggle span {
  display: block;
  width: 24px; /* 햄버거 줄 너비 */
  height: 3px; /* 햄버거 줄 두께 */
  background-color: #333;
  border-radius: 3px;
  position: absolute;
  transition: all 0.3s ease-in-out;
}

.mobile-menu-toggle span:nth-child(1) {
  top: 10px; /* 첫 번째 줄 위치 */
}

.mobile-menu-toggle span:nth-child(2) {
  top: 18px; /* 두 번째 줄 위치 (가운데) */
}

.mobile-menu-toggle span:nth-child(3) {
  top: 26px; /* 세 번째 줄 위치 */
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg); /* X 모양으로 변환 */
}
.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0; /* 가운데 줄 숨김 */
}
.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg); /* X 모양으로 변환 */
}

.user-info { /* 추가: 로그인 시 사용자 정보 표시 스타일 */
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.user-info span {
    font-weight: 500;
    font-size: 0.9rem;
}


/* Hero Section */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 100px 0 60px; /* 상하 패딩 줄임 */
  color: white;
  overflow: hidden;
  position: relative;
}

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

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr; /* 모바일에서는 1fr로 변경됨 */
  gap: 2.5rem; /* 간격 줄임 */
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.gradient-text {
  background: linear-gradient(135deg, #ffeaa7, #fab1a0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block; /* "EmotiCare"를 다음 줄로 내립니다 */
}

.hero-subtitle {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Button Styles
   ========================================================================== */

/* 1. 기본 버튼 스타일 (모든 버튼의 공통 속성) */
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-danger,
.btn-google {
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  /* border: none; 기본 테두리 없음 -> 아래에서 box-sizing과 함께 명시적 테두리 설정 */
  font-size: 1rem; /* 기본 폰트 크기 */
  display: inline-flex;
  align-items: center; 
  justify-content: center; /* 텍스트와 아이콘 중앙 정렬 */
  box-sizing: border-box; /* 모든 버튼에 적용하여 크기 계산 일관성 확보 */
  line-height: 1; /* 아이콘과 텍스트 수직 정렬 개선 */
}

/* 2. 일반 버튼 크기 및 아이콘 간격 (가장 많이 사용되는 크기 - 중간 크기) */
.btn-primary,
.btn-secondary, /* 일반 .btn-secondary (컨텍스트별 스타일로 덮어쓰일 수 있음) */
.btn-outline, /* 일반 .btn-outline (컨텍스트별 스타일로 덮어쓰일 수 있음) */
.btn-danger {
  padding: 0.8rem 1.8rem; /* 중간 크기 패딩 */
  gap: 0.4rem; /* 중간 크기 아이콘 간격 */
}

/* 3. 컨텍스트별 버튼 크기 및 스타일 */

/* 3.1. 헤더 인증 버튼 (로그인, 로그아웃, 회원가입) - 작은 크기 */
.auth-buttons .btn-primary, /* 회원가입 버튼 */
.auth-buttons .btn-outline, /* 로그인/로그아웃 버튼 */
.auth-buttons .btn-google { /* 구글 버튼 */
  padding: 0.5rem 1rem;
  font-size: 0.85rem; /* 모바일 헤더 버튼과 유사한 크기 */
  gap: 0.25rem;
}

/* 3.2. 홈페이지 히어로 섹션 버튼 - 큰 크기 */
.hero-buttons .btn-primary, /* 시작하기 버튼 */
.hero-buttons .btn-secondary { /* 가격정책 버튼 */
  padding: 1rem 2.2rem;
  font-size: 1.1rem;
  gap: 0.5rem;
}

/* 3.3. 홈페이지 CTA 섹션 버튼 - 큰 크기 (PC) */
.cta-buttons .btn-primary, /* 무료로 시작 버튼 */
.cta-buttons .btn-secondary { /* 요금제 보기 버튼 */
  padding: 1rem 2.2rem;
  font-size: 1.1rem;   /* 히어로와 동일하게 시작 */
  gap: 0.5rem;         /* 히어로와 동일하게 시작 */
}
/* "무료로 시작" 버튼은 테두리 없음 + 크기 보정 */
.cta-buttons .btn-primary {
  padding: calc(1rem + 2px) calc(2.2rem + 2px); /* 테두리 두께(2px)만큼 패딩 증가 */
}
/* 4. 개별 버튼 타입별 모양 정의 (색상, 배경 등) */

/* Primary 버튼 */
.btn-primary {
  background: linear-gradient(135deg, #ffeaa7, #fab1a0);
  color: #333;
  box-shadow: 0 4px 15px rgba(255, 234, 167, 0.4);
  border: none; /* Primary 버튼은 기본적으로 테두리 없음 */
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 234, 167, 0.6);
}
/* CTA 섹션의 Primary 버튼은 테두리를 Secondary와 동일하게 (PC) */
.cta-buttons .btn-primary {
  border: none; /* 명시적으로 테두리 없음 */
}


/* Secondary 버튼 */
.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3); /* 테두리 명시 */
  backdrop-filter: blur(10px);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Outline 버튼 (일반적인 외곽선 버튼) */
.btn-outline {
  background: transparent;
  color: #667eea;
  border: 2px solid #667eea; /* 테두리 명시 */
}
.btn-outline:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
}

/* 헤더의 로그인/로그아웃 버튼 (.btn-outline) 특별 스타일 (배경색 있게) */
.auth-buttons .btn-outline {
  background: #667eea !important;
  color: white !important;
  border: none !important; /* 테두리 없음 명시 */
}
.auth-buttons .btn-outline:hover {
  background: #764ba2 !important;
}

/* Danger 버튼 */
.btn-danger {
  background: transparent;
  color: #e74c3c;
  border: 2px solid #e74c3c; /* 테두리 명시 */
}
.btn-danger:hover {
  background: #e74c3c;
  color: white;
  transform: translateY(-2px);
}

/* 구글 로그인 버튼 */
.btn-google {
    background-color: #db4437 !important;
    color: white !important;
    border: none !important; /* 테두리 없음 명시 */
}
.btn-google:hover {
    background-color: #c23321 !important;
}

/* 5. 모바일 반응형 버튼 스타일 */
@media (max-width: 768px) {
  /* 모바일 헤더 인증 버튼 크기 조정 */
  .auth-buttons .btn-primary,
  .auth-buttons .btn-outline,
  .auth-buttons .btn-google {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }

  /* 모바일 히어로 섹션 버튼 크기 조정 */
  .hero-buttons .btn-primary,
  .hero-buttons .btn-secondary {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }

  /* 모바일 CTA 섹션 버튼 크기 및 스타일 조정 */
  .cta-buttons .btn-primary,
  .cta-buttons .btn-secondary {
    padding: 0.8rem 1.5rem; /* 두 버튼 동일 패딩 */
    font-size: 1rem; /* 두 버튼 동일 폰트 크기 */
    width: 80%;
    max-width: 300px;
    /* box-sizing: border-box; 이미 기본 스타일에 적용됨 */
  }
  .cta-buttons .btn-primary { /* 모바일 '무료로 시작' 버튼 테두리 제거 */
    border: none; /* 테두리 없음 */
    padding: calc(0.8rem + 2px) calc(1.5rem + 2px); /* 테두리 두께(2px)만큼 패딩 증가 */
  }
  .cta-buttons .btn-secondary { /* 모바일 '요금제 보기' 버튼 테두리 유지 */
    border: 2px solid rgba(255, 255, 255, 0.3); /* 테두리 명시 */
    padding: 0.8rem 1.5rem; /* 기본 패딩 */
  }

  /* .content-block 내부 버튼들의 모바일 스타일 */
  .content-block .btn-primary,
  .content-block .btn-outline,
  .content-block .btn-secondary,
  .content-block .btn-danger {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
}
/* ==========================================================================
   End of Button Styles
   ========================================================================== */



.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.floating-card {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 2rem;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  animation: float 3s ease-in-out infinite;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.floating-card i {
  font-size: 3rem;
  color: #ffeaa7;
}

.floating-card span {
  font-size: 1.2rem;
  font-weight: 600;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(10px); /* 카드의 기본 위치를 10px 아래로 조정 */
  }
  50% {
    transform: translateY(-10px); /* 위로 떠오르는 최대 높이를 기존 -20px에서 -10px로 조정 (덜 올라가도록) */
  }
}

/* Daily Tip Section */
.daily-tip {
  padding: 3rem 0; /* 상하 패딩 줄임 */
  background: white;
}

.tip-card {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 1.5rem; /* 내부 패딩 줄임 */
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.tip-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.tip-icon {
  font-size: 2rem;
  color: #ffeaa7;
  min-width: 60px;
}

.tip-content {
  flex: 1;
}

.tip-content h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.tip-content p {
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.tip-refresh {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 0.8rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.tip-refresh:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(180deg);
}

/* Features Section */
.features {
  padding: 4rem 0; /* 상하 패딩 줄임 */
  background: linear-gradient(135deg, #f8f9ff 0%, #e8f0ff 100%);
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #333;
}

.section-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 3rem; /* 하단 마진 줄임 */
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem; /* 간격 줄임 */
}

.feature-card {
  background: white;
  border-radius: 20px;
  padding: 1.75rem; /* 내부 패딩 줄임 */
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(102, 126, 234, 0.1);
  text-decoration: none; /* 카드 링크 밑줄 제거 */
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.2);
}

.feature-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: white;
  font-size: 1.8rem;
}

.feature-card h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #333;
}

.feature-card p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.feature-arrow {
  color: #667eea;
  font-size: 1.2rem;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

.feature-card:hover .feature-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* CTA Section */
.cta {
  padding: 4rem 0; /* 상하 패딩 줄임 */
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
}

.cta-content h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.cta-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.cta-buttons {
    display: flex; /* flex 컨테이너로 명시 */
    flex-direction: row; /* 버튼을 가로로 나란히 배치 */
    justify-content: center; /* 버튼들을 수평 중앙 정렬 */
    align-items: center; /* 버튼들을 수직 중앙 정렬 (높이 미세 차이 보정) */
    gap: 1rem; /* 버튼 사이의 간격 추가 */
  }

/* Footer */
.footer {
  background: #343a40; /* 변경: 푸터 배경색 약간 밝게 */
  color: white;
  padding: 2.5rem 0 1rem; /* 상하 패딩 약간 줄임 */
}

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

.footer-section h3 {
  margin-bottom: 1rem;
  color: #667eea; /* 변경: 푸터 제목 색상 */
}

.footer-section ul {
  list-style: none;
}

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

.footer-section ul li a {
  color: #adb5bd; /* 변경: 푸터 링크 색상 */
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #34495e;
  color: #bdc3c7;
}

/* Add min-height to header container to reserve space */
#header-container {
  min-height: 74px; /* 실제 헤더 높이에 맞게 조정하세요 */
  transition: opacity 0.3s ease-in-out; /* 헤더 페이드 인/아웃 효과 */
  }
  /* 모바일에서 헤더 컨테이너의 min-height 조정 */
  #header-container {
    min-height: 55px; /* 모바일 헤더의 실제 높이에 가깝게 조정 */
}

/* Add min-height to footer container to reserve space */
#footer-container {
  min-height: 150px; /* 실제 푸터 높이에 맞게 조정하세요 */
}

/* Responsive Design */
@media (max-width: 768px) {
  html {
    font-size: 87.5%; /* 기본 폰트 크기를 14px로 줄입니다 (브라우저 기본 16px 기준). 
                         이렇게 하면 rem 단위를 사용하는 모든 폰트 크기가 비례하여 작아집니다. 
                         필요에 따라 90% 또는 다른 값으로 조절할 수 있습니다. */
  }
  .container {
    padding: 0 1rem; /* 모바일에서 좌우 패딩 더 줄임 */
  }

  .mobile-menu-toggle {
    display: flex; /* 아이콘 중앙 정렬 및 크기 고정을 위해 flex 사용 */
    align-items: center;
    justify-content: center;
    width: 40px; /* 버튼 너비 고정 */
    height: 40px; /* 버튼 높이 고정 */
  }

  .nav-menu { /* 수정: 모바일 메뉴 스타일 */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9); /* 배경에 약간의 투명도 추가 */
    border-top: 1px solid #eee;
    flex-direction: column;
    max-height: 0; /* 초기에는 높이를 0으로 설정하여 숨김 */
    overflow: hidden; /* 내용이 넘칠 경우 숨김 */
    opacity: 0; /* 초기에는 투명하게 설정 */
    visibility: hidden; /* 초기에는 보이지 않게 설정 및 접근성 향상 */
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, visibility 0.3s ease-out; /* 부드러운 전환 효과 */
    pointer-events: none; /* 숨겨져 있을 때 클릭 이벤트 방지 */
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }

  .nav-menu.active {
    display: flex; /* flex는 유지 */
    max-height: 500px; /* 메뉴가 펼쳐질 충분한 높이 (내용에 따라 조절) */
    opacity: 1; /* 보이도록 불투명하게 */
    visibility: visible; /* 보이도록 설정 */
    pointer-events: auto; /* 클릭 이벤트 활성화 */
  }
  .nav-menu li {
    width: 100%;
    text-align: center;
  }
  
  .auth-buttons { /* 모바일에서 버튼 크기 및 간격 조정 */
    gap: 0.5rem;
  }

  .auth-buttons .btn-outline,
  .auth-buttons .btn-primary {
    padding: 0.5rem 0.8rem; /* 패딩 축소 */
    font-size: 0.85rem;    /* 폰트 크기 축소 */
  }
  #loginButtonContainer { /* 모바일에서는 min-width를 자동으로 설정하거나 다르게 조정 */
    min-width: auto;
  }

  .hero-content {
    padding: 0 1rem; /* 모바일 히어로 컨텐츠 내부 패딩 */
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem; /* 모바일 간격 더 줄임 */
  }

  .hero {
    padding: 70px 0 30px; /* 모바일 히어로 섹션 패딩 */
  }

  .hero-title {
    font-size: 2rem; /* 모바일 히어로 제목 크기 */
  }
  .hero-subtitle {
    font-size: 1rem; /* 모바일 히어로 부제목 크기 */
    margin-bottom: 1.5rem;
  }

  .logo { /* 모바일에서 로고 크기 조정 */
    font-size: 1.44rem; /* 기존 1.8rem에서 약 20% 축소 */
  }

  .daily-tip {
    padding: 2rem 0; /* 모바일 데일리 팁 섹션 패딩 */
  }

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

  .tip-card {
    padding: 1rem; /* 모바일 팁 카드 내부 패딩 */
    flex-direction: column;
    text-align: center;
  }

  .features {
    padding: 2.5rem 0; /* 모바일 기능 섹션 패딩 */
  }
  .section-title {
    font-size: 1.8rem; /* 모바일 섹션 제목 */
    margin-bottom: 0.8rem;
  }
  .section-subtitle {
    font-size: 0.9rem; /* 모바일 섹션 부제목 */
    margin-bottom: 1.5rem;
  }
  .feature-card {
    padding: 1.25rem; /* 모바일 기능 카드 내부 패딩 */
  }
   .feature-icon {
    width: 50px; height: 50px; font-size: 1.5rem; margin-bottom: 1rem;
  }
  .feature-card h3 {
    font-size: 1.1rem; margin-bottom: 0.5rem;
  }
  .feature-card p {
    font-size: 0.85rem; margin-bottom: 1rem; line-height: 1.5;
  }

  .hero-buttons {
    flex-direction: row; /* 히어로 버튼은 가로로 배열 */
    justify-content: center; /* 버튼들을 중앙 정렬 (선택 사항) */
  }
  .cta-buttons { /* 모바일에서 CTA 버튼들을 세로로 쌓고 중앙 정렬 */
    display: flex;         /* Flexbox 컨테이너로 설정 */
    flex-direction: column;
    align-items: center;   /* 수평 중앙 정렬 */
    gap: 1rem;             /* 버튼 사이의 간격 */
  }

  .cta {
    padding: 2.5rem 0; /* 모바일 CTA 섹션 패딩 */
  }
  .cta-content h2 {
    font-size: 1.8rem;
  }
  .cta-content p {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }
}

/* Page-specific styles */
.page-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 100px 0 40px; /* 변경: 헤더 높이 고려하여 패딩 조정 */
  text-align: center;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.page-subtitle {
  font-size: 1.5rem;
  opacity: 0.9;
}

.page-content {
  padding: 1.5rem 0; /* 모바일 화면에 맞게 상하 패딩 추가 축소 */
  background: #f8f9fa; /* 일관된 페이지 콘텐츠 배경색 */
  min-height: 60vh;
}

/* Smooth transition for main content */
main {
  transition: opacity 0.4s ease-in-out;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  backdrop-filter: blur(5px);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* 모달 패딩 줄임 */
  background: #fff;
  padding: 2rem;
  border-radius: 20px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  min-height: 300px; /* 추가: 모달 최소 높이 */
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.modal-header h3 { /* 추가: 모달 제목 스타일 */
    font-size: 1.5rem;
    color: #333;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: #333;
}

/* Form Styles */
.form-group {
  margin-bottom: 1rem; /* 폼 그룹 마진 추가 축소 */
}

.form-group label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 500;
  color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; /* 폼 요소 너비 */
  padding: 0.8rem;
  border: 2px solid #e1e8ed;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  font-family: inherit;
}
@media (max-width: 768px) {
  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 0.7rem; /* 모바일에서 폼 요소 내부 패딩 축소 */
    font-size: 0.9rem;
  }
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2); /* 포커스 시 그림자 약간 조정 */
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group .btn-primary { /* 추가: 모달 내 기본 버튼 스타일 */
    width: 100%;
    padding: 0.8rem;
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Success/Error Messages */
.message {
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-weight: 500;
}

.message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Utility Classes */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}
.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mb-3 {
  margin-bottom: 1.5rem;
}
.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}
.hidden {
  display: none;
}
.visible {
  display: block;
}

/* Quick Guide Section for Color Journal */
.quick-guide-section {
  padding: 2rem 0 1rem; /* 상하 패딩 추가 축소 */
  background: #f8f9ff; /* Consistent with other light background sections */
}

.quick-guide-main-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem; /* 마진 추가 축소 */
  color: #333;
}

.quick-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* Responsive grid */
  gap: 1rem; /* 간격 추가 축소 */
  max-width: 900px; /* Max width for two cards side-by-side */
  margin: 0 auto; /* Center the grid */
}

.quick-guide-card {
  background: linear-gradient(135deg, #667eea, #764ba2); /* 감정 편지 가이드라인 배경과 동일하게 */
  color: white; /* 기본 텍스트 색상을 흰색으로 변경 */
  padding: 1.5rem; /* 내부 패딩 추가 축소 */
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3); /* 그림자 약간 조정 */
  border: none; /* 기존 테두리 제거 */
  transition: all 0.3s ease;
}

.quick-guide-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4); /* 호버 시 그림자 조정 */
}

.quick-guide-card-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem; /* 마진 추가 축소 */
  color: white; /* 제목 색상 흰색으로 명시 */
}

.quick-guide-card-title.guide-title-usage {
  /* color: #667eea; */ /* 흰색으로 통일되므로 주석 처리 또는 삭제 */
}

.quick-guide-card-title.guide-title-effects {
  /* color: #764ba2; */ /* 흰색으로 통일되므로 주석 처리 또는 삭제 */
}

.quick-guide-list {
  margin: 0;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9); /* 목록 텍스트 색상 밝게 조정 */
}

.quick-guide-list li {
  margin-bottom: 0.25rem; /* 리스트 아이템 간격 축소 */
}

/* "감정일기 3단계" (ol) 목록 스타일 */
ol.quick-guide-list {
  list-style-type: decimal; /* 숫자로 표시 (HTML 인라인 스타일과 일치) */
  list-style-position: inside; /* 숫자를 li 내용 안으로 넣어 간격 최소화 */
  padding-left: 0; /* ol 자체의 왼쪽 패딩 제거 */
}

/* "기대 효과" (ul) 목록 스타일 */
ul.quick-guide-list {
  list-style: none; /* 기본 점 제거 */
  padding-left: 0; /* 기본 들여쓰기 제거 */
}

ul.quick-guide-list li {
  padding-left: 1.5rem; /* 체크 아이콘과 텍스트 사이 간격을 더 확보하기 위해 패딩 증가 */
  position: relative; /* ::before 위치 기준 */
}

ul.quick-guide-list li::before {
  content: '✓'; /* 체크 아이콘 복원 */
  position: absolute;
  left: 0.3rem; /* li의 왼쪽 가장자리에서 아이콘까지의 간격 (아이콘 앞 공간) */
  top: 0.2em; /* 아이콘 수직 정렬 (아이콘 자체 폰트 크기 기준) */
  color: #ffeaa7; /* 아이콘 색상 */
  font-weight: bold;
  font-size: 1.1rem;
}

.quick-guide-list li strong {
  font-weight: 600;
  color: white; /* 강조 텍스트 색상 흰색으로 */
}

/* emotion-letters.html calendar styles (can reuse from mood-routine or define specific) */
.letter-calendar-section {
    /* .content-block 또는 .calendar-block으로 대체 예정 */
    margin-top: 2rem; /* 상단 마진 조정 */
}

/* mood-routine.html의 달력 스타일 재활용 */
.calendar-header-routine .date-nav { 
     display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem; /* 간격 축소 */
}

.calendar-header-routine .date-nav button { 
    background: #667eea;
    color: white;
    border: none;
    padding: 0.6rem; /* 패딩 축소 */
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}
.calendar-header-routine .date-nav button:hover {
    background: #764ba2;
    transform: scale(1.1);
}
 .calendar-header-routine .current-date-display { 
    font-size: 1.3rem; /* 폰트 크기 축소 */
    font-weight: 600;
    color: #333;
}

.calendar-routine { 
    /* .calendar-block으로 대체 예정 */
    margin-bottom: 0; 
}
.calendar-day-header-routine { 
    /* .calendar-day-name-common으로 대체 예정 */
}
.calendar-grid-routine .calendar-day { 
    /* .calendar-day-cell-common으로 대체 예정 */
}
.calendar-grid-routine { 
    /* .calendar-grid-common으로 대체 예정 */
}
.calendar-day.other-month { 
    color: #ccc;
    background: #f8f9fa;
    pointer-events: none;
}
.calendar-day.today { 
     background: linear-gradient(135deg, #8392f0, #8e69b8); /* Lighter today */
    color: white;
}
.calendar-day .day-number { 
    font-weight: 600;
    margin-bottom: 0.15rem; /* 마진 축소 */
    z-index: 1; 
    position: relative; 
}
.calendar-day.has-record { /* 편지 기록 있는 날짜 표시 */
    border: 2px solid #764ba2; /* 테두리 색상 */
}
.calendar-day.has-record span { /* 편지 아이콘 스타일 */
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 1em; /* 아이콘 크기 조정 */
    z-index: 2;
}

/* 날짜별 편지 보기 모달 스타일 */
#lettersForDateModal .modal-content {
    max-width: 600px; /* 모달 너비 조정 */
}
#lettersForDateModal .letter-card {
    cursor: default; /* 모달 내 카드 클릭 비활성화 */
    margin-bottom: 1rem;
}
#lettersForDateModal .letter-card .btn-outline {
    padding: 0.4rem 0.8rem; /* 버튼 패딩 축소 */
    font-size: 0.85rem; /* 버튼 폰트 크기 축소 */
}

/* 모바일 화면에서 페이지별/퀵가이드 패딩 추가 조정 */
@media (max-width: 768px) {
  .page-header {
    padding: 70px 0 20px; /* 헤더 높이 고려 */
  }
  .page-title {
    font-size: 1.8rem;
  }
  .page-subtitle {
    font-size: 0.9rem;
  }
  .page-content {
    padding: 1rem 0; /* 모바일 상하 패딩 추가 축소 */
  }
  .quick-guide-section {
    padding: 2rem 0 1rem;
  }
  .quick-guide-main-title {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
  }
  .quick-guide-card {
    padding: 1rem; /* 모바일 퀵가이드 카드 패딩 축소 */
  }
  .quick-guide-card-title {
    font-size: 1.1rem; /* 모바일 퀵가이드 카드 제목 축소 */
    margin-bottom: 1rem;
  }
  .quick-guide-list li {
    font-size: 0.85rem; /* 모바일 퀵가이드 리스트 폰트 축소 */
    margin-bottom: 0.75rem;
    padding-left: 1.6rem; /* 아이콘 공간 확보 */
  }
}


/* Success/Error Messages - Centered Toast Style */
/* 기존 .message 스타일을 찾아서 아래 내용으로 교체하거나, 
   기존 스타일을 삭제하고 아래 내용을 추가하세요. */
.message {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 1.25rem 1.75rem; /* 메시지 패딩 약간 축소 */
  border-radius: 15px; /* 더 둥글게 */
  font-weight: 500;
  z-index: 3000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); /* 그림자 강화 */
  text-align: center;
  min-width: 250px; /* 최소 너비 */
  max-width: 80%; /* 최대 너비 */
  opacity: 0; /* 초기 투명 */
  visibility: hidden; /* 초기 숨김 */
  transition: opacity 0.3s ease-out, visibility 0.3s ease-out; /* 부드러운 전환 */
}

.message.show { /* 메시지 표시 시 */
    opacity: 1;
    visibility: visible;
}

.message-overlay { /* 메시지 뒤 반투명 오버레이 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2999; /* 메시지보다 한 단계 아래 */
    opacity: 0; /* 초기 투명 */
    visibility: hidden; /* 초기 숨김 */
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out; /* 부드러운 전환 */
}
.message-overlay.show { /* 오버레이 표시 시 */
    opacity: 1;
    visibility: visible;
}


.message.success {
  background: linear-gradient(135deg, #2ecc71, #27ae60); /* 초록색 계열 그라데이션 */
  color: white;
  border: none;
}

.message.error {
  background: linear-gradient(135deg, #e74c3c, #c0392b); /* 빨간색 계열 그라데이션 */
  color: white;
  border: none;
}
.message.info { /* 추가: 정보 메시지 스타일 */
    background: linear-gradient(135deg, #3498db, #2980b9); /* 파란색 계열 그라데이션 */
    color: white;
    border: none;
}

/* 모바일에서 모달 및 폼 요소 패딩 추가 조정 */
@media (max-width: 768px) {
  .modal-content {
    padding: 1rem; /* 모바일 모달 내부 패딩 */
  }
  .form-group {
    margin-bottom: 0.8rem;
  }
  .form-group label { font-size: 1.2rem; }
  .form-group input, .form-group textarea, .form-group select {
    padding: 0.7rem; font-size: 0.9rem;
    /* 모바일에서 폼 요소 내부 패딩은 위에서 이미 .form-group input 등으로 정의됨 */
  }
}

/* New General Classes */
.page-inner-container {
    max-width: 900px; 
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem; 
    padding-right: 1.5rem;
}

@media (max-width: 768px) {
    .page-inner-container {
        padding-left: 1rem; 
        padding-right: 1rem;
    }
}

.content-block {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;     
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08); 
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .content-block {
        padding: 1rem; 
    }
    .content-block .section-title,
    .content-block h2,
    .content-block h3 {
        font-size: 1.2rem; 
        margin-bottom: 0.8rem;
    }
    .content-block p,
    .content-block li,
    .content-block .form-label { /* form-input 등은 위에서 이미 처리 */
        font-size: 0.9rem; 
    }
     .content-block .btn-primary,
    .content-block .btn-outline,
    .content-block .btn-secondary {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

.item-card { /* 신규 클래스 추가 */
    background: #f8f9ff;
    border-radius: 10px;
    padding: 1rem;
    border-left: 4px solid #667eea; /* 강조 테두리 */
    transition: all 0.3s ease;
    margin-bottom: 1rem; /* 아이템 간 하단 마진 */
}
.item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 15px rgba(102, 126, 234, 0.15);
}
@media (max-width: 768px) {
    .item-card {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
    }
}

.calendar-block {
    background: white;
    border-radius: 15px;
    padding: 1rem; 
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}
.calendar-block-header { display: flex; justify-content: center; align-items: center; margin-bottom: 1rem; }
.calendar-block-nav { display: flex; align-items: center; gap: 0.5rem; }
.calendar-block-nav button {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.6rem; /* mood-routine의 .date-nav button과 유사하게 패딩 조정 */
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}
.calendar-block-nav button:hover {
    background: #764ba2;
    transform: scale(1.1);
}
.calendar-block-title { font-size: 1.3rem; font-weight: 600; }
.calendar-grid-common { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: #e1e8ed; border-radius: 10px; overflow: hidden; }
.calendar-day-name-common { background: #667eea; color: white; padding: 0.5rem; text-align: center; font-weight: 600; font-size: 0.85rem; }
.calendar-day-cell-common { background: white; padding: 0.3rem; min-height: 75px; cursor: pointer; position: relative; display: flex; flex-direction: column; justify-content: flex-start; font-size: 0.85rem; }
.calendar-day-cell-common .day-number { font-weight: 600; font-size: 0.9em; margin-bottom: 0.15rem; }
.calendar-day-cell-common.other-month { color: #ccc; background: #f8f9fa; pointer-events: none; }
.calendar-day-cell-common.today { background: linear-gradient(135deg, #8392f0, #8e69b8); color: white; }
.calendar-day-cell-common.has-record::after { content: ''; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; background-color: #764ba2; border-radius: 50%; }

@media (max-width: 768px) {
    .calendar-block { padding: 0.75rem; }
    .calendar-block-title { font-size: 1.1rem; }
    .calendar-day-name-common { padding: 0.4rem; font-size: 0.75rem; }
    .calendar-day-cell-common { min-height: 60px; padding: 0.2rem; }
}

/* Social Share Section */
.social-share-section {
  padding: 2.5rem 0;
  text-align: center;
  background-color: #f8f9fa; /* 기존 content-block 배경과 유사하게 */
  border-top: 1px solid #e9ecef;
}

.social-share-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 1.5rem;
}

.social-share-buttons {
  display: inline-flex;
  gap: 1rem;
}

.social-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  text-decoration: none;
  color: white;
  font-size: 1.3rem; /* 아이콘 크기 */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.social-share-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.social-share-btn.facebook { background-color: #1877F2; }
.social-share-btn.twitter  { background-color: #000000; } /* X 로고는 검은색 배경 */
.social-share-btn.kakao    { background-color: #FEE500; color: #3C1E1E; }
.social-share-btn.pinterest{ background-color: #E60023; } /* Pinterest 브랜드 색상 */
.social-share-btn.link-copy{ background-color: #6c757d; }
