/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
               "Hiragino Sans", Meiryo, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f8f9fa;
  overflow-x: hidden;
}

a {
  color: #0066cc;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #0052a3;
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.site-header {
  background: #fff;
  border-bottom: 2px solid #e5e5e5;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.site-title {
  font-size: 20px;
  font-weight: bold;
  color: #333;
}

.site-title:hover {
  text-decoration: none;
  color: #0066cc;
}

/* Site Logo */
.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-logo:hover {
  text-decoration: none;
  opacity: 0.9;
}

.logo-image {
  height: 40px;
  width: auto;
}

/* Mobile Search Header - only visible on mobile */
.mobile-search-header {
  display: none;
  flex: 1;
  margin: 0 15px;
  max-width: 300px;
}

.mobile-search-header .search-box-wrapper {
  width: 100%;
}

.mobile-search-header .search-icon-button {
  display: none !important;
}

.mobile-search-header .search-form {
  display: flex !important;
  width: 100%;
  min-width: 0;
}

.mobile-search-header .search-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

/* Top Navigation */
.top-nav {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
}

.top-nav a {
  padding: 8px 12px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  color: #555;
  transition: all 0.2s;
  white-space: nowrap;
}

.top-nav a:hover {
  background: #0066cc;
  color: white;
  border-color: #0066cc;
  text-decoration: none;
  transform: translateY(-1px);
}

.top-nav a:first-child {
  background: #e8f4fd;
  color: #0066cc;
  font-weight: 500;
}

.top-nav a:first-child:hover {
  background: #0066cc;
  color: white;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  gap: 4px;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: #333;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Hamburger animation */
.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: #fff;
  border-top: 1px solid #e5e5e5;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-menu.active {
  max-height: 80vh;
  overflow-y: auto;
}

.mobile-menu a {
  padding: 15px 20px;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
  font-size: 16px;
  transition: background 0.2s;
}

.mobile-menu a:hover {
  background: #f8f9fa;
  text-decoration: none;
  color: #0066cc;
}

.mobile-menu a:first-child {
  font-weight: 500;
  color: #0066cc;
}

/* Mobile responsive navigation */
@media (max-width: 768px) {
  .site-header .container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .logo-image {
    height: 32px;
  }

  .mobile-search-header {
    display: flex;
    margin: 0;
    max-width: none;
    min-width: 0;
    overflow: hidden;
  }

  .top-nav {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
    flex-shrink: 0;
  }

  .mobile-menu {
    display: flex;
  }
}

/* Desktop - hide mobile elements */
@media (min-width: 769px) {
  .mobile-menu-toggle {
    display: none;
  }

  .mobile-menu {
    display: none;
  }

  .mobile-search-header {
    display: none;
  }
}

/* Footer */
.site-footer {
  background: #fff;
  border-top: 1px solid #e5e5e5;
  margin-top: 60px;
  padding: 30px 0;
  color: #666;
  font-size: 14px;
}

/* Footer Navigation */
.footer-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 30px;
  margin-bottom: 30px;
}

@media (max-width: 1200px) {
  .footer-nav {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .footer-nav {
    grid-template-columns: repeat(2, 1fr);
  }
}

.footer-section h4 {
  font-size: 16px;
  margin-bottom: 15px;
  color: #333;
  font-weight: 600;
}

.footer-section {
  display: flex;
  flex-direction: column;
}

.footer-section a {
  padding: 5px 0;
  color: #666;
  font-size: 14px;
  transition: color 0.2s;
}

.footer-section a:hover {
  color: #0066cc;
  text-decoration: underline;
}

.site-footer > .container > p {
  text-align: center;
  border-top: 1px solid #e5e5e5;
  padding-top: 20px;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .footer-nav {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Breadcrumb */
.breadcrumb {
  margin: 20px 0;
  font-size: 14px;
  color: #666;
}

.breadcrumb .separator {
  margin: 0 8px;
  color: #999;
}

.breadcrumb a {
  color: #666;
}

.breadcrumb strong {
  color: #333;
}

/* Typography */
h1 {
  font-size: 28px;
  margin: 20px 0;
  color: #222;
  line-height: 1.3;
}

h2 {
  font-size: 22px;
  margin: 30px 0 15px;
  color: #333;
  border-bottom: 2px solid #e5e5e5;
  padding-bottom: 8px;
}

h3 {
  font-size: 18px;
  margin: 15px 0;
  color: #333;
}

.lead {
  font-size: 16px;
  color: #555;
  margin: 20px 0;
  line-height: 1.7;
}

/* Search Options (Home Page) */
.search-options {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
  flex-wrap: wrap;
  justify-content: center;
}

.search-option {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  transition: all 0.2s;
  display: block;
  min-width: 180px;
  max-width: 200px;
}

.search-option:hover {
  border-color: #0066cc;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  text-decoration: none;
  transform: translateY(-2px);
}

.search-option-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.search-option-name {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

.search-option-description {
  font-size: 12px;
  color: #666;
}

.search-option-divider {
  font-size: 14px;
  color: #999;
  font-weight: 500;
}

@media (max-width: 768px) {
  .search-options {
    flex-direction: column;
    gap: 15px;
  }
  
  .search-option-divider {
    display: none;
  }
}

/* Prefecture Grid (Home Page) */
.prefecture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.prefecture-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  transition: all 0.2s;
  display: block;
}

.prefecture-card:hover {
  border-color: #0066cc;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  text-decoration: none;
  transform: translateY(-2px);
}

.prefecture-name {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

.prefecture-count {
  font-size: 14px;
  color: #666;
}

/* Municipality & Town Lists */
.municipality-list,
.town-list,
.chome-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.municipality-list li,
.town-list li,
.chome-list li {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  transition: all 0.2s;
}

.municipality-list a,
.town-list a,
.chome-list a {
  display: block;
  padding: 12px 15px;
  color: #333;
}

.municipality-list li:hover,
.town-list li:hover,
.chome-list li:hover {
  border-color: #0066cc;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.municipality-name,
.town-name,
.chome-name {
  font-weight: 500;
  color: #333;
}

.spot-count {
  color: #666;
  font-size: 14px;
  margin-left: 8px;
}

.has-chomes {
  display: inline-block;
  background: #f0f8ff;
  color: #0066cc;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
}

/* Spot Cards */
.spot-cards {
  list-style: none;
  display: grid;
  gap: 15px;
  margin: 20px 0;
}

.spot-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 20px;
  transition: all 0.2s;
}

.spot-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-color: #d0d0d0;
}

.spot-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
}

.spot-name {
  font-size: 18px;
  font-weight: bold;
  color: #222;
  flex: 1;
}

.spot-type {
  background: #e8f4fd;
  color: #0066cc;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.spot-details {
  color: #555;
  font-size: 14px;
  line-height: 1.6;
}

.spot-address,
.spot-genre {
  margin: 8px 0;
  display: flex;
  align-items: start;
}

.icon {
  margin-right: 8px;
  flex-shrink: 0;
}

.map-link {
  display: inline-flex;
  align-items: center;
  background: #0066cc;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  margin-top: 12px;
  font-weight: 500;
  transition: background 0.2s;
}

.map-link:hover {
  background: #0052a3;
  text-decoration: none;
}

.map-link .icon {
  margin-right: 6px;
}

/* SEO Content Section */
.seo-content {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 25px;
  margin: 40px 0;
}

.seo-content h2 {
  border: none;
  margin-top: 0;
}

.seo-content p {
  color: #555;
  line-height: 1.8;
  margin: 15px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  
  h1 {
    font-size: 24px;
  }
  
  h2 {
    font-size: 20px;
  }
  
  .prefecture-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }
  
  .municipality-list,
  .town-list,
  .chome-list {
    grid-template-columns: 1fr;
  }
  
  .spot-card {
    padding: 15px;
  }
  
  .spot-header {
    flex-direction: column;
  }
  
  .spot-type {
    margin-top: 8px;
  }
}

@media (max-width: 480px) {
  .site-title {
    font-size: 16px;
  }
  
  .prefecture-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  
  .prefecture-card {
    padding: 10px;
  }
  
  .prefecture-name {
    font-size: 14px;
  }
  
  .prefecture-count {
    font-size: 12px;
  }
}

/* Bookmark Button */
.bookmark-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0066cc;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin: 12px 0;
  box-shadow: 0 2px 4px rgba(0,102,204,0.2);
}

.bookmark-button:hover {
  background: #0052a3;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,102,204,0.3);
}

.bookmark-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0,102,204,0.2);
}

@media (max-width: 768px) {
  .bookmark-button {
    font-size: 14px;
    padding: 8px 16px;
  }
}

/* ========================================
   Search Box Component
   ======================================== */

.search-box-wrapper {
  display: flex;
  align-items: center;
}

.search-icon-button {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #555;
}

.search-form {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form:focus-within {
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

.search-input {
  border: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 14px;
  width: 200px;
  outline: none;
}

.search-input::placeholder {
  color: #999;
}

.search-submit {
  background: #0066cc;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.search-submit:hover {
  background: #0052a3;
}

.search-submit.loading {
  cursor: wait;
}

.search-submit:disabled {
  opacity: 0.8;
}

/* Search Loading Spinner */
.search-spinner {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.search-input:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* Mobile search */
@media (max-width: 768px) {
  .top-nav .search-box-wrapper .search-form {
    display: none;
  }

  .top-nav .search-box-wrapper .search-icon-button {
    display: flex;
  }

  .top-nav .search-box-wrapper.expanded .search-form {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .top-nav .search-box-wrapper.expanded .search-input {
    width: 100%;
    flex: 1;
  }

  /* Mobile menu search */
  .mobile-search-wrapper {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
  }

  .mobile-search-wrapper .search-icon-button {
    display: none;
  }

  .mobile-search-wrapper .search-form {
    display: flex;
    width: 100%;
  }

  .mobile-search-wrapper .search-input {
    flex: 1;
    width: auto;
  }
}

/* ========================================
   Area Dropdown Component
   ======================================== */

.area-dropdown {
  position: relative;
}

.area-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.area-dropdown-toggle:hover {
  background: #0066cc;
  color: white;
  border-color: #0066cc;
}

.dropdown-arrow {
  transition: transform 0.2s;
}

.dropdown-arrow.open {
  transform: rotate(180deg);
}

.area-dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  min-width: 200px;
}

.area-dropdown-content {
  display: flex;
  padding: 20px;
  gap: 30px;
}

.area-column {
  flex: 1;
}

.area-column h4 {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.area-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.area-column li {
  margin: 0;
  padding: 6px 0;
}

.area-column a {
  color: #555;
  font-size: 14px;
  transition: color 0.2s;
}

.area-column a:hover {
  color: #0066cc;
  text-decoration: none;
}

.area-dropdown-footer {
  padding: 12px 20px;
  border-top: 1px solid #eee;
  background: #f8f9fa;
  border-radius: 0 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.view-all-link {
  font-size: 14px;
  color: #0066cc;
  font-weight: 500;
}

.view-all-link:hover {
  text-decoration: underline;
}

/* Mobile Area Accordion */
.mobile-area-accordion {
  border-bottom: 1px solid #f0f0f0;
}

.mobile-area-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 15px 20px;
  background: none;
  border: none;
  font-size: 16px;
  color: #333;
  cursor: pointer;
  text-align: left;
}

.accordion-arrow {
  transition: transform 0.2s;
}

.accordion-arrow.open {
  transform: rotate(180deg);
}

.mobile-area-content {
  padding: 0 20px 15px;
}

.mobile-area-section {
  margin-bottom: 10px;
}

.mobile-area-section h5 {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.mobile-area-item {
  display: flex;
  gap: 12px;
  padding: 4px 0;
}

.mobile-area-item a {
  color: #333;
  font-size: 14px;
}

.mobile-view-all {
  display: block;
  padding: 6px 0;
  color: #0066cc;
  font-weight: 500;
}

/* Near-me link styling */
.nav-link-nearme {
  padding: 8px 12px;
  background: #e8f4fd;
  color: #0066cc;
  font-weight: 500;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-link-nearme:hover {
  background: #0066cc;
  color: white;
  border-color: #0066cc;
  text-decoration: none;
}

/* Hide area dropdown on mobile (use accordion instead) */
@media (max-width: 768px) {
  .area-dropdown {
    display: none;
  }
}

/* ========================================
   Search Results Page
   ======================================== */

.search-locations {
  margin: 30px 0;
}

.location-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding: 0;
}

.location-item {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  transition: all 0.2s;
}

.location-item:hover {
  border-color: #0066cc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.location-item a {
  display: flex;
  flex-direction: column;
  padding: 12px 15px;
  color: #333;
  text-decoration: none;
}

.location-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.location-parent {
  font-size: 12px;
  color: #888;
}

.location-count {
  font-size: 13px;
  color: #0066cc;
  margin-top: 4px;
}

/* Sightseeing search results */
.search-sightseeing {
  margin: 30px 0;
}

.sightseeing-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
  padding: 0;
}

.sightseeing-item {
  background: linear-gradient(135deg, #f8f5ff 0%, #f0f8ff 100%);
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  transition: all 0.2s;
}

.sightseeing-item:hover {
  border-color: #9966cc;
  box-shadow: 0 2px 8px rgba(153, 102, 204, 0.15);
}

.sightseeing-item a {
  display: flex;
  flex-direction: column;
  padding: 12px 15px;
  color: #333;
  text-decoration: none;
}

.sightseeing-name {
  font-weight: 500;
  font-size: 14px;
}

.sightseeing-meta {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

.search-spots {
  margin: 30px 0;
}

/* No results section */
.no-results {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 30px;
  margin: 30px 0;
}

.no-results ul {
  margin: 15px 0;
  padding-left: 20px;
  color: #666;
}

.no-results li {
  margin: 8px 0;
}

.popular-areas {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.popular-areas a {
  padding: 8px 16px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #333;
  font-size: 14px;
  transition: all 0.2s;
}

.popular-areas a:hover {
  background: #0066cc;
  color: white;
  border-color: #0066cc;
  text-decoration: none;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: 40px 0;
  padding: 20px 0;
  border-top: 1px solid #e5e5e5;
}

.pagination-link {
  padding: 10px 20px;
  background: #0066cc;
  color: white;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.2s;
}

.pagination-link:hover {
  background: #0052a3;
  text-decoration: none;
  color: white;
}

.pagination-info {
  color: #666;
  font-size: 14px;
}

/* Related links */
.related-links {
  margin: 40px 0;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.related-links h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 16px;
}

.related-areas {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.related-areas a {
  padding: 6px 12px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #555;
  font-size: 13px;
  transition: all 0.2s;
}

.related-areas a:hover {
  border-color: #0066cc;
  color: #0066cc;
  text-decoration: none;
}

/* Back link */
.back-link {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 20px;
  background: #0066cc;
  color: white;
  border-radius: 6px;
  font-weight: 500;
}

.back-link:hover {
  background: #0052a3;
  text-decoration: none;
  color: white;
}

/* Prefecture region sections */
.prefecture-region {
  margin: 40px 0;
}

.prefecture-region h2 {
  font-size: 20px;
  margin-bottom: 20px;
}