/* 四万十町グルメガイド - レスポンシブ対応CSS */

/* ベーススタイル */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f8fafc;
  color: #1a202c;
  line-height: 1.6;
}

/* ヒーローセクション */
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
  padding: 1.5rem 1rem;
  position: relative;
  overflow: hidden;
}

.hero-section::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>');
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
}

.hero-section h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-section p {
  font-size: 1rem;
  opacity: 0.95;
  margin: 0 0 0.75rem 0;
}

.hero-subtitle {
  font-size: 0.85rem;
  opacity: 0.8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* モバイルタブナビゲーション */
.mobile-tabs {
  display: flex;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  background: white;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  border-bottom: 2px solid transparent;
}

.tab-btn:hover {
  background: #f8fafc;
  color: #475569;
}

.tab-btn.active {
  color: #667eea;
  border-bottom-color: #667eea;
  background: #f8faff;
}

.tab-btn i {
  font-size: 1.1rem;
}

.tab-btn span {
  font-size: 0.75rem;
  font-weight: 500;
}

/* コンテナ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}

/* フィルターセクション */
.filter-section {
  background: white;
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.filter-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin: 0;
}

.restaurant-count {
  font-size: 0.85rem;
  color: #6b7280;
  background: #f3f4f6;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-weight: 500;
}

.filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.filter-btn {
  padding: 0.5rem 0.75rem;
  border: 2px solid #e5e7eb;
  background: white;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  min-width: 60px;
}

.filter-btn:hover {
  border-color: #667eea;
  background: #f8f9ff;
}

.filter-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

/* メインコンテンツ */
.main-content {
  position: relative;
  min-height: calc(100vh - 200px);
}

.content-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  transform: translateX(100%);
}

.content-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.panel-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.close-btn {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.close-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

/* 地図コンテナ */
.map-container {
  height: calc(100vh - 200px);
  width: 100%;
  background: #f3f4f6;
}

/* レストランリスト */
.restaurant-list {
  height: calc(100vh - 200px);
  overflow-y: auto;
  padding: 0;
}

.restaurant-card {
  border-bottom: 1px solid #f3f4f6;
  padding: 1rem;
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
  display: flex;
  gap: 1rem;
}

.restaurant-image {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  background: #f3f4f6;
  flex-shrink: 0;
}

.restaurant-content {
  flex: 1;
  min-width: 0;
}

.restaurant-card:hover {
  background: #f8f9ff;
}

.restaurant-card:active {
  background: #eef2ff;
}

.restaurant-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.restaurant-genre {
  display: inline-block;
  background: #e0e7ff;
  color: #3730a3;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.restaurant-price {
  font-size: 0.9rem;
  color: #059669;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.restaurant-review {
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.restaurant-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #6b7280;
  gap: 1rem;
}

.restaurant-info span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.restaurant-info i {
  width: 12px;
}

/* 写真スポット */
.photo-spots {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f3f4f6;
}

.photo-spots h5 {
  font-size: 0.85rem;
  font-weight: 600;
  color: #7c3aed;
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.spot-item {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
  padding-left: 1rem;
  position: relative;
}

.spot-item::before {
  content: '📸';
  position: absolute;
  left: 0;
  font-size: 0.7rem;
}

/* ローディング */
.loading {
  text-align: center;
  padding: 3rem 2rem;
  color: #6b7280;
  font-size: 1rem;
}

/* ユーティリティクラス */
.desktop-hidden {
  display: none;
}

/* タブレット以上 */
@media (min-width: 768px) {
  .hero-section {
    padding: 2.5rem 1rem;
  }
  
  .hero-section h1 {
    font-size: 2.2rem;
  }
  
  .hero-section p {
    font-size: 1.1rem;
  }
  
  .mobile-tabs {
    display: none;
  }
  
  .main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    position: static;
    min-height: auto;
  }
  
  .content-panel {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  
  .content-panel.active {
    transform: none;
  }
  
  .panel-header {
    display: none;
  }
  
  .map-container,
  .restaurant-list {
    height: 500px;
  }
  
  .filter-section {
    padding: 1.5rem;
  }
  
  .filter-buttons {
    justify-content: flex-start;
  }
  
  .restaurant-card {
    padding: 1.25rem;
  }
}

/* デスクトップ */
@media (min-width: 1024px) {
  .hero-section h1 {
    font-size: 2.5rem;
  }
  
  .container {
    padding: 0 2rem;
  }
  
  .map-container,
  .restaurant-list {
    height: 600px;
  }
  
  .main-content {
    gap: 1.5rem;
  }
  
  .content-panel {
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
  }
}

/* モバイル専用 */
@media (max-width: 767px) {
  .desktop-hidden {
    display: block;
  }
  
  .hero-section {
    padding: 1.25rem 1rem;
  }
  
  .hero-section h1 {
    font-size: 1.5rem;
  }
  
  .filter-buttons {
    justify-content: center;
    gap: 0.4rem;
  }
  
  .filter-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    min-width: 55px;
  }
  
  .restaurant-card {
    padding: 0.75rem;
  }
  
  .restaurant-image {
    width: 70px;
    height: 70px;
  }
  
  .restaurant-name {
    font-size: 1.2rem;
  }
  
  /* フローティングアクションボタン風のスタイル */
  .list-panel.active ~ .map-panel .close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 10;
  }
}

/* アニメーション */
.restaurant-card {
  animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #1a202c;
    color: #e2e8f0;
  }
  
  .mobile-tabs,
  .filter-section,
  .content-panel {
    background: #2d3748;
    border-color: #4a5568;
  }
  
  .restaurant-card:hover {
    background: #4a5568;
  }
}