/**
 * 公園検索ページスタイル
 */

@import url('./variables.css');

/* ============================================
   セクション共通スタイル
   ============================================ */

.section-container {
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  margin-top: 52px;
  margin-bottom: 52px;
  padding: 0 var(--container-padding);
  width: 100%;
}

.section-container:first-child {
  margin-top: 0;
}

.section-container:last-child {
  margin-bottom: 0;
}

.section-with-bg {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.03) 0%, rgba(255, 255, 255, 1) 100%);
  padding: var(--spacing-2xl) var(--spacing-xl);
  border-radius: var(--radius-xl);
  margin-top: 52px;
  margin-bottom: 52px;
  border: 1px solid rgba(16, 185, 129, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.section-with-bg:first-child {
  margin-top: 0;
}

.section-with-bg:last-child {
  margin-bottom: 0;
}

/* セクションの奥行きバリエーション */
.section-container:not(.section-with-bg) {
  padding-top: var(--spacing-xl);
  padding-bottom: var(--spacing-xl);
}

.section-container:nth-child(even):not(.section-with-bg) {
  background: var(--color-gray-50);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  margin-left: calc(-1 * var(--container-padding));
  margin-right: calc(-1 * var(--container-padding));
}

.section-title {
  font-size: 1.25rem; /* 20px */
  font-weight: 900;
  color: var(--color-gray-900);
  margin-top: 0;
  margin-bottom: calc(var(--spacing-xl) + 12px); /* 24px + 12px = 36px */
  letter-spacing: -0.02em;
  line-height: 1.3;
  position: relative;
  padding-top: 0;
  padding-bottom: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: 0.5rem; /* 8px - アイコンとテキストの間隔 */
}

.section-title-icon {
  flex-shrink: 0;
}

.section-title i[data-lucide] {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.section-title-text {
  flex: 1;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(to right, var(--color-primary), var(--color-primary-light));
  border-radius: var(--radius-full);
}

/* ============================================
   検索カード
   ============================================ */

.search-card {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.06);
  padding: var(--spacing-2xl) var(--spacing-lg);
  border: 1px solid var(--color-gray-200);
  margin-bottom: 52px;
  width: 100%;
  max-width: 100%;
}

.search-container {
  display: flex;
  gap: var(--spacing-md);
  align-items: stretch;
}

.search-container .search-input {
  flex: 1;
  font-size: var(--font-size-base);
  border: 2px solid var(--color-gray-300);
}

.search-container .search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.hero-search-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(255, 255, 255, 0.95) 60%, rgba(255, 255, 255, 1) 100%);
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--spacing-2xl);
  padding-bottom: var(--spacing-2xl);
}

.hero-search-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    url('data:image/svg+xml,<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"><path d="M100,20 Q120,60 160,80 Q120,100 100,140 Q80,100 40,80 Q80,60 100,20 Z" fill="none" stroke="%2310b981" stroke-width="1" opacity="0.08"/></svg>'),
    url('data:image/svg+xml,<svg width="150" height="150" xmlns="http://www.w3.org/2000/svg"><circle cx="75" cy="75" r="60" fill="none" stroke="%2310b981" stroke-width="0.5" opacity="0.06"/></svg>');
  background-size: 300px 300px, 200px 200px;
  background-position: top right, bottom left;
  background-repeat: no-repeat;
  opacity: 1;
  z-index: 0;
}

.hero-search-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
}

.hero-search-card > * {
  position: relative;
  z-index: 1;
}

/* ============================================
   カテゴリタグ（旧スタイル）
   ============================================ */

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: var(--color-primary-bg);
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-gray-800);
}

.category-tag:hover {
  background-color: var(--color-primary-bg-hover);
  border-color: var(--color-primary-border-hover);
  color: var(--color-primary-dark);
}

/* ============================================
   カテゴリminiカード
   ============================================ */

.category-cards-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.02) 0%, rgba(255, 255, 255, 1) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(16, 185, 129, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.category-mini-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-lg) var(--spacing-md);
  background-color: var(--color-white);
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  text-decoration: none;
  color: var(--color-gray-800);
  min-width: 80px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.category-mini-card:hover {
  background-color: var(--color-primary-bg);
  border-color: var(--color-primary-border);
  color: var(--color-primary-dark);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15), 0 2px 4px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.category-icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.category-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-align: center;
}

/* ============================================
   おすすめバッジ
   ============================================ */

.recommend-badge {
  position: absolute;
  top: var(--spacing-sm);
  left: var(--spacing-sm);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

/* ============================================
   都道府県選択
   ============================================ */

.prefecture-btn {
  width: 130px;
  min-width: 130px;
  background-color: var(--color-primary-bg);
  border-color: var(--color-primary-border);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-md);
}

.prefecture-btn:hover {
  background-color: var(--color-primary-bg-hover);
  border-color: var(--color-primary-border-hover);
}

/* 50音タブ */
.kana-tab {
  cursor: pointer;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  font-weight: 500;
  border: none;
}

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

.kana-tab:not(.active) {
  background-color: var(--color-gray-100);
  color: var(--color-gray-500);
}

.kana-tab:not(.active):hover {
  background-color: var(--color-gray-200);
}

.prefecture-group {
  display: none;
}

.prefecture-group.active {
  display: block;
}

.prefecture-item {
  display: none;
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.prefecture-item.active {
  display: inline-block;
  opacity: 1;
}

#prefecture-container {
  transition: opacity var(--transition-slow);
}

/* ============================================
   ユーティリティ
   ============================================ */

.hidden {
  display: none;
}

.park-list-container {
  max-height: calc(100vh - 250px);
}

/* ============================================
   カルーセル（横スクロール）
   ============================================ */

.park-carousel {
  display: flex;
  gap: var(--spacing-lg);
  overflow-x: auto;
  overflow-y: hidden;
  padding: var(--spacing-md) 0 var(--spacing-md) 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary) var(--color-gray-200);
}

.park-carousel::-webkit-scrollbar {
  height: 8px;
}

.park-carousel::-webkit-scrollbar-track {
  background: var(--color-gray-100);
  border-radius: var(--radius-full);
}

.park-carousel::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

.park-carousel::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-dark);
}

.park-carousel-small {
  display: flex;
  gap: var(--spacing-sm);
  overflow-x: auto;
  overflow-y: hidden;
  padding: var(--spacing-xs) 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* ============================================
   公園カード（小サイズ）
   ============================================ */

.park-card-small {
  flex: 0 0 260px;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--color-gray-200);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: inherit;
  margin-bottom: var(--spacing-sm);
}

.park-card-small:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: var(--color-primary-border);
}

.park-card-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(to bottom, #e9f7e9 0%, #ffffff 100%);
  background-image: 
    linear-gradient(to bottom, #e9f7e9 0%, #ffffff 100%),
    url('data:image/svg+xml,<svg width="400" height="300" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="park-pattern" x="0" y="0" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="8" fill="%2322c55e" opacity="0.1"/><circle cx="80" cy="80" r="12" fill="%234ade80" opacity="0.15"/><path d="M30,50 Q50,30 70,50" stroke="%2286efac" stroke-width="2" fill="none" opacity="0.2"/></pattern></defs><rect width="100%" height="100%" fill="url(%23park-pattern)"/></svg>');
  background-size: cover, 200px 150px;
  background-position: center;
  aspect-ratio: 16 / 9;
}

.park-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.park-card-body {
  padding: var(--spacing-md);
  background: var(--color-white);
  border-top: 1px solid var(--color-gray-100);
}

.park-card-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-gray-800);
  margin-bottom: 0.25rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

/* ============================================
   公園カード（ミニサイズ）
   ============================================ */

.park-card-mini {
  flex: 0 0 140px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-gray-200);
  overflow: hidden;
  transition: all var(--transition-base);
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: inherit;
}

.park-card-mini:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.park-card-image-mini {
  width: 100%;
  height: 100px;
  overflow: hidden;
  background: linear-gradient(to bottom, #e9f7e9 0%, #ffffff 100%);
  background-image: 
    linear-gradient(to bottom, #e9f7e9 0%, #ffffff 100%),
    url('data:image/svg+xml,<svg width="200" height="150" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="20" fill="%2322c55e" opacity="0.1"/><circle cx="150" cy="100" r="15" fill="%234ade80" opacity="0.15"/></svg>');
  background-size: cover, 150px 100px;
  background-position: center;
}

.park-card-image-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.park-card-body-mini {
  padding: var(--spacing-sm);
}

.park-card-title-mini {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-gray-800);
  margin-bottom: 0.125rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

/* ============================================
   ランキング
   ============================================ */

.ranking-tab {
  padding: var(--spacing-sm) var(--spacing-lg);
  border: none;
  background: transparent;
  color: var(--color-gray-600);
  font-weight: 500;
  font-size: var(--font-size-sm);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.ranking-tab:hover {
  color: var(--color-primary);
  background: var(--color-primary-bg);
}

.ranking-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

.ranking-content {
  display: none;
}

.ranking-content.active {
  display: block;
}

.ranking-badge {
  position: absolute;
  top: var(--spacing-sm);
  left: var(--spacing-sm);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  z-index: 10;
  min-width: 24px;
  text-align: center;
}

.distance-badge {
  position: absolute;
  bottom: var(--spacing-sm);
  right: var(--spacing-sm);
  background: rgba(16, 185, 129, 0.9);
  color: var(--color-white);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

/* ランキング空欄状態 */
.empty-ranking-state {
  padding: var(--spacing-xl) 0;
}

.empty-ranking-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-xl);
  text-align: center;
}

.empty-ranking-message p {
  margin: 0;
}

/* ============================================
   特集セクション
   ============================================ */

.featured-sections-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2xl);
}

.featured-section-item {
  width: 100%;
}

.featured-section-item:not(:last-child) {
  padding-bottom: var(--spacing-2xl);
  border-bottom: 1px solid var(--color-gray-200);
}

.featured-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
  gap: var(--spacing-lg);
}

.featured-section-title-wrapper {
  flex: 1;
}

.featured-section-title {
  font-size: var(--font-size-2xl);
  font-weight: 900;
  color: var(--color-gray-900);
  margin-bottom: var(--spacing-xs);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.featured-section-title-text {
  display: block;
}

.featured-section-description {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
  line-height: 1.5;
  margin: 0;
}

.featured-section-more-link {
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition-base);
  padding-top: var(--spacing-xs);
}

.featured-section-more-link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* ============================================
   Skeleton UI (Airbnb風)
   ============================================ */

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

.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #f8f8f8 20%,
    #f0f0f0 40%,
    #f0f0f0 100%
  );
  background-size: 2000px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-gray-200);
  overflow: hidden;
  flex-shrink: 0;
}

.skeleton-card.park-card-small {
  width: 240px;
  min-width: 240px;
}

.skeleton-image {
  width: 100%;
  height: 180px;
  background: linear-gradient(
    90deg,
    #e5e7eb 0%,
    #f0f0f0 20%,
    #e5e7eb 40%,
    #e5e7eb 100%
  );
  background-size: 2000px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.skeleton-text {
  height: 1rem;
  margin-bottom: var(--spacing-sm);
  border-radius: var(--radius-sm);
}

.skeleton-text-small {
  height: 0.75rem;
  width: 60%;
  margin-bottom: var(--spacing-xs);
}

.skeleton-title {
  height: 1.25rem;
  width: 80%;
  margin-bottom: var(--spacing-md);
}

.skeleton-badge {
  height: 1.5rem;
  width: 4rem;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-right: var(--spacing-xs);
}

.skeleton-park-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.skeleton-park-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--color-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-gray-200);
}

.skeleton-park-item .skeleton-image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  background: linear-gradient(
    90deg,
    #e5e7eb 0%,
    #f0f0f0 20%,
    #e5e7eb 40%,
    #e5e7eb 100%
  );
  background-size: 2000px 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-park-item-content {
  flex: 1;
}

/* Skeleton UI コンテナ */
.skeleton-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--spacing-lg);
  padding: var(--spacing-lg) 0;
}

.skeleton-container-carousel {
  display: flex;
  gap: var(--spacing-lg);
  overflow-x: auto;
  padding: var(--spacing-lg) 0;
  scrollbar-width: none;
  width: 100%;
}

.skeleton-container-carousel::-webkit-scrollbar {
  display: none;
}

.skeleton-container-carousel .skeleton-card {
  min-width: 240px;
  width: 240px;
}

/* ============================================
   特集セクション：公園リスト
   ============================================ */

.featured-park-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.featured-park-list-item {
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--color-gray-100);
}

.featured-park-list-item:last-child {
  border-bottom: none;
}

.featured-park-link {
  display: block;
  text-decoration: none;
  color: var(--color-gray-800);
  transition: color var(--transition-base);
  padding: var(--spacing-xs) 0;
}

.featured-park-link:hover {
  color: var(--color-primary);
}

.featured-park-name {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-gray-800);
}

.featured-park-link:hover .featured-park-name {
  color: var(--color-primary);
}

.featured-park-location {
  font-size: var(--font-size-xs);
  color: var(--color-gray-600);
  margin-left: var(--spacing-xs);
}

