/* 🌟 TOPページ基準の共通スタイルシステム */
/* 診断ページのヘッダー品質でTOPページの背景品質を統合 */

:root {
  /* TOPページのカラーパレット */
  --night-gradient: radial-gradient(ellipse at top, #3a2d5c 0%, #1A202C 80%);
  --starlight: #FBD38D;
  --moon-glow: rgba(251, 211, 141, 0.6);
  --glass-bg-light: rgba(255, 255, 255, 0.1);
  --glass-bg-medium: rgba(255, 255, 255, 0.15);
  --glass-bg-strong: rgba(255, 255, 255, 0.2);
  --glass-blur: blur(15px);
  --glass-blur-strong: blur(20px);
  --glass-border: 1px solid rgba(255, 255, 255, 0.2);
  --purple-primary: #8b7cf6;
  --purple-secondary: #a78bfa;
  --purple-glow: rgba(139, 124, 246, 0.3);
}

/* 🌌 TOPページの美しい背景システム（全ページ統一） */
.shared-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--night-gradient);
  z-index: 0;
}

/* 🌟 TOPページの星空システム（50個PC、30個モバイル） */
#stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.star {
  position: absolute;
  background: var(--starlight);
  border-radius: 50%;
  animation: starTwinkle 3s ease-in-out infinite;
}

@keyframes starTwinkle {
  0%, 100% { 
    opacity: 0.5; 
    transform: scale(0.8); 
  }
  50% { 
    opacity: 1; 
    transform: scale(1.2); 
  }
}

/* 🌙 TOPページの美しい月システム */
.moon-container {
  position: fixed;
  top: 15vh;
  right: 10vw;
  pointer-events: none;
  z-index: 2;
}

.moon {
  width: 150px;
  height: 150px;
  background-color: #e2e8f0;
  border-radius: 50%;
  position: relative;
  box-shadow: 
    inset 10px -10px 15px rgba(0,0,0,0.15), 
    inset -10px 10px 20px white, 
    inset 20px -20px 25px rgba(0,0,0,0.1), 
    inset -20px 20px 35px white, 
    0 0 40px var(--moon-glow);
  background-image: 
    radial-gradient(circle at 20% 30%, #cbd5e1 1%, transparent 4%), 
    radial-gradient(circle at 65% 75%, #b7c2d0 1%, transparent 5%), 
    radial-gradient(circle at 40% 55%, #d1d9e3 0.5%, transparent 3%);
}

.moon-glow {
  position: absolute;
  top: -15px;
  left: -15px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251,211,141,0.3) 0%, transparent 70%);
  animation: moonPulse 4s ease-in-out infinite;
}

@keyframes moonPulse {
  0%, 100% { 
    transform: scale(1); 
    opacity: 0.3; 
  }
  50% { 
    transform: scale(1.1); 
    opacity: 0.6; 
  }
}

/* スマホ版月のサイズ調整 */
@media (max-width: 767px) {
  .moon-container {
    top: 60px;
    right: 30px;
  }
  
  .moon {
    width: 80px;
    height: 80px;
  }
  
  .moon-glow {
    top: -8px;
    left: -8px;
    width: 96px;
    height: 96px;
  }
}

/* 💫 統一流れ星システム（全サイト共通） */
#shooting-stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.natural-shooting-star {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.star-body {
  position: relative;
  width: 8px;
  height: 8px;
}

.star-body::before {
  content: '✦';
  position: absolute;
  font-size: 12px;
  color: var(--starlight);
  filter: drop-shadow(0 0 4px rgba(251, 211, 141, 0.8));
  animation: starTwinkle 0.5s ease-in-out infinite alternate;
}

.star-trail {
  position: absolute;
  top: 6px;
  left: 12px;
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, 
    rgba(251, 211, 141, 0.9) 0%, 
    rgba(251, 211, 141, 0.6) 30%, 
    rgba(251, 211, 141, 0.3) 60%, 
    transparent 100%);
  border-radius: 2px;
  transform: rotate(-35deg);
  transform-origin: left center;
}

@keyframes shootingStarFall {
  0% {
    transform: translateX(0) translateY(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateX(-120vw) translateY(80vh);
    opacity: 0;
  }
}

/* 🎯 診断ページの洗練されたヘッダーシステム（全ページ統一） */
.main-header {
  position: relative;
  background: transparent;
  z-index: 40;
  padding: 24px 16px;
}

.main-header .header-container {
  max-width: 1792px; /* max-w-7xl */
  margin: 0 auto;
}

.main-header .header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.main-header .site-logo {
  color: white;
}

.main-header .site-logo h1 {
  font-size: 1.25rem; /* text-xl */
  font-weight: 600;
  letter-spacing: 0.025em;
  margin: 0;
}

.main-header .site-logo .logo-subtitle {
  color: #c4b5fd; /* text-purple-300 */
  font-size: 1.125rem; /* text-lg */
  display: block;
}

/* デスクトップナビゲーション */
.main-nav {
  display: none;
  gap: 2rem; /* space-x-8 */
  align-items: center;
}

.nav-link {
  color: white;
  font-size: 1.125rem; /* text-lg */
  text-decoration: none;
  transition: color 0.3s ease;
  padding: 8px 24px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
  vertical-align: baseline;
  transform: none;
}

.nav-link:hover {
  color: #c4b5fd; /* text-purple-300 */
}

.nav-link.active {
  background: linear-gradient(135deg, var(--purple-primary), var(--purple-secondary));
  color: #ffffff;
  font-weight: 600;
  vertical-align: baseline;
  line-height: 1.2;
  transform: none;
}

.nav-link.active:hover {
  background: linear-gradient(135deg, #7c3aed, var(--purple-primary));
}

/* 🔑 ログインボタンのスタイル */
.auth-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 1rem;
}

.nav-link-login {
  background: linear-gradient(135deg, #FBD38D, #F0C658);
  color: #1a1a2e !important;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.nav-link-login:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(251, 211, 141, 0.3);
  color: #1a1a2e !important;
}

.nav-link-mypage {
  background: linear-gradient(135deg, #8B7CF6, #F472B6);
  color: white !important;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.nav-link-mypage:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(139, 124, 246, 0.3);
  color: white !important;
}

.user-name {
  color: #FBD38D;
  font-size: 0.875rem;
  white-space: nowrap;
}

#afterLogin {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .main-nav {
    display: flex;
  }
  
  .main-header .site-logo h1 {
    font-size: 1.5rem; /* text-2xl */
  }
  
  .main-header .site-logo .logo-subtitle {
    font-size: 1.25rem; /* text-xl */
    display: inline;
    margin-left: 0.5rem;
  }
}

/* ハンバーガーメニュー */
.hamburger-btn {
  display: block;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  padding: 8px;
}

@media (min-width: 768px) {
  .hamburger-btn {
    display: none;
  }
}

/* モバイルメニュー */
.mobile-menu {
  display: block;
  margin-top: 1rem;
  background: var(--glass-bg-medium);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: 0.5rem;
  padding: 1rem;
}

.mobile-menu.hidden {
  display: none;
}

.mobile-menu a, .mobile-nav-link {
  display: block;
  color: white;
  text-decoration: none;
  padding: 0.5rem 0;
  transition: color 0.3s ease;
}

.mobile-menu a:hover, .mobile-nav-link:hover {
  color: #c4b5fd;
}

.mobile-menu a.active {
  background: linear-gradient(135deg, var(--purple-primary), var(--purple-secondary));
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  text-align: center;
}

/* モバイル版ログアウトボタン */
#mobileAfterLogin .mobile-nav-link:last-child {
  color: #ff6b6b;
  font-weight: 600;
}

#mobileAfterLogin .mobile-nav-link:last-child:hover {
  color: #ff8787;
}

/* モバイルではデスクトップの認証ボタンを非表示 */
@media (max-width: 767px) {
  .auth-buttons {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .mobile-menu {
    display: none;
  }
}

/* 🎨 ガラスモーフィズム統一システム */
.glass-morphism {
  background: var(--glass-bg-light);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
}

.glass-morphism-strong {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur-strong);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 📱 レスポンシブ調整 */
@media (max-width: 767px) {
  .main-header {
    padding: 16px;
  }

  .main-header .site-logo h1 {
    font-size: 0.875rem; /* 14px - スマホ版縮小 */
  }

  .main-header .site-logo .logo-subtitle {
    font-size: 0.8125rem; /* 13px - スマホ版縮小 */
    display: block;
    margin-left: 0;
  }
}

/* 📱 小型スマホ用追加調整（480px以下） */
@media (max-width: 480px) {
  .main-header .site-logo h1 {
    font-size: 0.75rem; /* 12px - 小型スマホ版さらに縮小 */
  }

  .main-header .site-logo .logo-subtitle {
    font-size: 0.75rem; /* 12px - 小型スマホ版さらに縮小 */
  }
}

/* ✨ アニメーション統一 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes breathingGlow {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 10px 30px var(--purple-glow);
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(139, 124, 246, 0.5);
  }
}

.fade-in-up {
  animation: fadeInUp 0.8s ease-out;
}

.slide-in-up {
  animation: slideInUp 0.6s ease-out;
}

.animate-breathing-glow {
  animation: breathingGlow 3s ease-in-out infinite;
}

/* 🎯 アクセシビリティ強化: フォーカス状態の改善 */
input:focus, 
select:focus, 
textarea:focus, 
button:focus {
  outline: 2px solid var(--starlight);
  outline-offset: 2px;
  border-color: var(--starlight) !important;
  box-shadow: 0 0 0 3px rgba(251, 211, 141, 0.3) !important;
  transition: all 0.3s ease;
}

/* ガラスモーフィズム要素のフォーカス */
.glass:focus {
  background: rgba(255, 255, 255, 0.25) !important;
  border-color: var(--starlight) !important;
}

/* ボタンのフォーカス状態 */
.btn-primary:focus,
.cta-button:focus {
  box-shadow: 0 0 0 3px rgba(251, 211, 141, 0.4), 
              0 8px 25px rgba(139, 124, 246, 0.3) !important;
}

/* 🌙 統一フッターシステム（全ページ共通） */
.main-footer {
  position: relative;
  background: var(--glass-bg-light);
  backdrop-filter: var(--glass-blur);
  border-top: var(--glass-border);
  color: white;
  padding: 3rem 1rem 1rem;
  margin-top: 4rem;
  z-index: 30;
}

.main-footer .footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .main-footer .footer-content {
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 3rem;
  }
}

.main-footer .footer-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: white;
}

.main-footer .footer-section h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: white;
}

.main-footer .footer-section p {
  color: #d1d5db; /* text-gray-300 */
  line-height: 1.6;
  margin-bottom: 0;
}

.main-footer .footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.main-footer .footer-section ul li {
  margin-bottom: 0.5rem;
}

.main-footer .footer-section ul li a {
  color: #d1d5db; /* text-gray-300 */
  text-decoration: none;
  transition: color 0.3s ease;
}

.main-footer .footer-section ul li a:hover {
  color: #c4b5fd; /* text-purple-300 */
}

/* SNSリンクセクション */
.main-footer .sns-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.main-footer .sns-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.main-footer .sns-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--glass-bg-medium);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.875rem;
}

.main-footer .sns-link:hover {
  background: var(--glass-bg-strong);
  border-color: var(--purple-secondary);
  color: var(--purple-secondary);
  transform: translateY(-2px);
}

.main-footer .sns-link span {
  margin-left: 0.5rem;
}

/* フッター下部 */
.main-footer .footer-bottom {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
}

.main-footer .footer-bottom p {
  color: #9ca3af; /* text-gray-400 */
  font-size: 0.875rem;
  margin: 0;
}