/* ========================================
   Custom CSS for Kokorone
   ======================================== */

/* Smooth Scroll Behavior */
html {
  scroll-behavior: smooth;
}

/* Header Initial State - ホバー時の見やすさ改善 */
#main-header .nav-link:hover,
#main-header a:hover {
  text-shadow: 0 0 8px rgba(14, 165, 233, 0.6) !important;
}

/* Header Scrolled State */
#main-header.scrolled {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#main-header.scrolled .nav-link,
#main-header.scrolled a {
  color: #44403c !important; /* neutral-700 */
  text-shadow: none !important;
}

#main-header.scrolled .nav-link:hover,
#main-header.scrolled a:hover {
  color: #0ea5e9 !important; /* primary-500 */
  text-shadow: none !important;
}

#main-header.scrolled #mobile-menu-btn {
  color: #44403c !important; /* neutral-700 */
}

#main-header.scrolled #mobile-menu-btn i {
  filter: none !important;
}

/* Card Hover Effects */
.service-card,
.facility-card {
  transition: all 0.3s ease;
}

.service-card:hover,
.facility-card:hover {
  transform: translateY(-8px);
}

.service-card img,
.facility-card img {
  transition: transform 0.3s ease;
}

.service-card:hover img,
.facility-card:hover img {
  transform: scale(1.05);
}

/* Back to Top Button */
#back-to-top.show {
  opacity: 1;
  pointer-events: auto;
}

/* Modal Animation */
#modal-overlay {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Form Error State */
.error-message {
  display: none;
}

.error-message.show {
  display: block;
}

input.error,
textarea.error,
select.error {
  border-color: #ef4444 !important; /* red-500 */
  border-width: 2px;
}

/* Mobile Menu Transition */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

#mobile-menu.show {
  display: block;
  max-height: 400px;
}

/* Image Aspect Ratio for Service Cards */
.service-card img,
.facility-card img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  overflow: hidden;
}

/* Ensure proper text shadow on hero elements */
#hero h1,
#hero p {
  text-shadow: 3px 3px 6px rgba(0,0,0,0.4);
}

/* Custom Animation Delays */
.animate__delay-6s {
  animation-delay: 6s;
}

.animate__delay-7s {
  animation-delay: 7s;
}

/* Focus Visible for Accessibility */
*:focus-visible {
  outline: 2px solid #0ea5e9; /* primary-500 */
  outline-offset: 2px;
}

/* Loading State for Images */
img[loading="lazy"] {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

/* ========================================
   レスポンシブ対応の強化
   ======================================== */

/* スマホでのカードホバーエフェクトを軽減 */
@media (max-width: 767px) {
  .service-card:hover,
  .facility-card:hover {
    transform: translateY(-4px);
  }

  /* モバイルでのライトボックス調整 */
  #image-lightbox .max-w-6xl {
    max-width: 100%;
    padding: 1rem;
  }

  /* モバイルメニューの最大高さを画面サイズに応じて調整 */
  #mobile-menu.show {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
}

/* タブレット以下でのテキストサイズ微調整 */
@media (max-width: 1023px) {
  #hero h1 {
    line-height: 1.2;
  }

  #hero p {
    line-height: 1.6;
  }
}

/* ========================================
   検索機能のスタイル
   ======================================== */

/* 検索ステータスのアニメーション */
#insurance-search-status,
#non-insurance-search-status,
#facilities-search-status {
  transition: all 0.3s ease;
}

/* 検索フォームのフォーカススタイル */
input[type="text"]:focus,
select:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

/* カードの非表示アニメーション */
.service-card[style*="display: none"],
.facility-card[style*="display: none"] {
  opacity: 0;
  pointer-events: none;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* 検索ボタンのホバーエフェクト */
#global-search-btn:hover {
  box-shadow: 0 12px 24px rgba(14, 165, 233, 0.3);
}

/* リセットボタンのアニメーション */
#global-reset-btn:hover,
#insurance-reset:hover,
#non-insurance-reset:hover,
#facilities-reset:hover {
  transform: scale(1.02);
}

/* 検索ステータスバッジのアニメーション */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#insurance-search-status > div,
#non-insurance-search-status > div,
#facilities-search-status > div {
  animation: slideDown 0.3s ease;
}
