/* City Pages - Custom Styles */

/* Page wrapper prevents horizontal scroll */
.city-page-wrapper {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* Hero section with blue to white gradient */
.city-hero {
  position: relative;
  min-height: 400px;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    #1e40af 0%,
    #2563eb 15%,
    #3b82f6 30%,
    #60a5fa 45%,
    #93c5fd 60%,
    #bfdbfe 75%,
    #dbeafe 85%,
    #f0f9ff 93%,
    #ffffff 100%
  );
}

/* Fade overlay at bottom of hero for smooth transition */
.city-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 40%,
    rgba(255, 255, 255, 0.8) 70%,
    #ffffff 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* Network Grid Background - Tech Blueprint Style */
.map-grid-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Main grid layer - primary lines */
.grid-layer {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image:
    /* Primary grid */
    linear-gradient(to right, rgba(255,255,255,0.25) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.25) 1px, transparent 1px),
    /* Secondary smaller grid */
    linear-gradient(to right, rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 20px 20px, 20px 20px;
  transform: translate3d(0, 0, 0) perspective(1000px) rotateX(5deg);
  transform-origin: center center;
  will-change: transform;
}

/* Diagonal accent lines */
.grid-layer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(-45deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 120px 120px;
}

/* Intersection nodes - glowing dots at grid intersections */
.nodes-layer {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.9) 2px, transparent 3px);
  background-size: 80px 80px;
  opacity: 0.5;
}

/* Sparkle layer - randomly placed glowing dots */
.sparkle-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,255,255,0.6) 40%, transparent 70%);
  border-radius: 50%;
  animation: sparkle 3s ease-in-out infinite;
  opacity: 0;
}

.sparkle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  border-radius: 50%;
}

@keyframes sparkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0.5);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Stagger sparkle animations */
.sparkle:nth-child(1) { animation-delay: 0s; }
.sparkle:nth-child(2) { animation-delay: 0.5s; }
.sparkle:nth-child(3) { animation-delay: 1s; }
.sparkle:nth-child(4) { animation-delay: 1.5s; }
.sparkle:nth-child(5) { animation-delay: 2s; }
.sparkle:nth-child(6) { animation-delay: 0.3s; }
.sparkle:nth-child(7) { animation-delay: 0.8s; }
.sparkle:nth-child(8) { animation-delay: 1.3s; }
.sparkle:nth-child(9) { animation-delay: 1.8s; }
.sparkle:nth-child(10) { animation-delay: 2.3s; }
.sparkle:nth-child(11) { animation-delay: 0.2s; }
.sparkle:nth-child(12) { animation-delay: 0.7s; }
.sparkle:nth-child(13) { animation-delay: 1.2s; }
.sparkle:nth-child(14) { animation-delay: 1.7s; }
.sparkle:nth-child(15) { animation-delay: 2.2s; }

/* Accessibility - respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .grid-layer {
    transform: none !important;
  }
  .sparkle {
    animation: none;
    opacity: 0.6;
  }
}

/* Mobile - slightly reduce density */
@media (max-width: 640px) {
  .grid-layer {
    background-size: 60px 60px, 60px 60px, 15px 15px, 15px 15px;
    transform: translate3d(0, 0, 0);
  }

  .nodes-layer {
    background-size: 60px 60px;
    opacity: 0.4;
  }

  .sparkle {
    width: 3px;
    height: 3px;
  }
}

/* Hero content wrapper */
.city-hero-content {
  position: relative;
  z-index: 3;
  padding: 8rem 1rem 4rem;
}

/* Hero headline animation */
.city-hero-headline {
  animation: heroReveal 1.4s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes heroReveal {
  0% {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

/* Hero subheadline animation */
.city-hero-subheadline {
  opacity: 0;
  animation: slideUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  animation-delay: 0.3s;
}

@keyframes slideUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero CTA button */
.city-hero-cta {
  margin-top: 2rem;
  opacity: 0;
  animation: slideUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  animation-delay: 0.4s;
}

.city-search-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f16700;
  color: #ffffff;
  font-weight: 600;
  padding: 1rem 2rem;
  border-radius: 10px;
  text-decoration: none;
  font-size: 1.125rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(241, 103, 0, 0.4);
}

.city-search-cta-button:hover {
  background: #d95d00;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(241, 103, 0, 0.5);
}

.city-search-cta-button i {
  font-size: 1rem;
}

/* Quick stats grid */
.city-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  max-width: 600px;
  margin: 2rem auto 0;
  opacity: 0;
  animation: slideUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  animation-delay: 0.5s;
}

.city-stat-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.city-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.city-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
  display: block;
  letter-spacing: -0.025em;
}

.city-stat-label {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.25rem;
}

/* Breadcrumb styling */
.city-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0;
  font-size: 0.875rem;
}

.city-breadcrumb a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color 0.2s ease;
}

.city-breadcrumb a:hover {
  color: #ffffff;
}

.city-breadcrumb-separator {
  color: rgba(255, 255, 255, 0.5);
}

.city-breadcrumb-current {
  color: rgba(255, 255, 255, 0.7);
}

/* Section header styling */
.city-section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.city-section-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
}

.city-section-header p {
  color: #64748b;
  max-width: 600px;
  margin: 0 auto;
}

.city-section-line {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #f16700, #fbbf24);
  margin: 1rem auto;
  border-radius: 2px;
}

/* About city section */
.city-about-section {
  padding: 3rem 0;
  background: #ffffff;
}

.city-about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 768px) {
  .city-about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.city-description {
  color: #475569;
  line-height: 1.7;
  font-size: 1rem;
}

.city-description p {
  margin-bottom: 1rem;
}

.city-wiki-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #2563eb;
  font-weight: 500;
  text-decoration: none;
  margin-top: 0.5rem;
  transition: color 0.2s ease;
}

.city-wiki-link:hover {
  color: #1d4ed8;
}

/* Map container */
.city-map-container {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  height: 350px;
  background: #f1f5f9;
}

.city-map-container iframe,
.city-map-container #city-map {
  width: 100%;
  height: 100%;
  border: none;
}

/* Thumbnail image for cities without map */
.city-thumbnail {
  width: 100%;
  height: 350px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.city-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Featured listings section */
.city-listings-section {
  padding: 3rem 0;
  background: #f8fafc;
}

.city-listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Address-only listing grid */
.city-address-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  max-width: 1000px;
  margin: 0 auto;
}

.city-address-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  text-decoration: none;
  color: #1e293b;
  font-weight: 500;
  transition: all 0.2s ease;
}

.city-address-item:hover {
  border-color: #3b82f6;
  background: #f8fafc;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.city-address-item i {
  color: #3b82f6;
  font-size: 1rem;
  flex-shrink: 0;
}

.city-address-item span {
  font-size: 0.9375rem;
  line-height: 1.4;
}

/* Browse more button */
.city-address-more {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
}

.city-address-more i {
  color: #ffffff;
}

.city-address-more:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Listing card */
.city-listing-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.city-listing-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.city-listing-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.city-listing-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.city-listing-card:hover .city-listing-image img {
  transform: scale(1.05);
}

.city-listing-price {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.125rem;
}

.city-listing-details {
  padding: 1.25rem;
}

.city-listing-address {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.city-listing-specs {
  display: flex;
  gap: 1rem;
  color: #64748b;
  font-size: 0.875rem;
}

.city-listing-spec {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Listings CTA button */
.city-listings-cta {
  text-align: center;
  margin-top: 2rem;
}

.city-view-all-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #3b82f6;
  color: #ffffff;
  font-weight: 600;
  padding: 0.875rem 1.75rem;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.city-view-all-button:hover {
  background: #2563eb;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

/* ZIP codes section */
.city-zipcodes-section {
  padding: 3rem 0;
  background: #ffffff;
}

.city-zipcodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
}

.city-zipcode-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  font-weight: 600;
  color: #1e293b;
  transition: all 0.3s ease;
  text-decoration: none;
}

.city-zipcode-card:hover {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Nearby cities section */
.city-nearby-section {
  padding: 3rem 0;
  background: #f8fafc;
}

.city-nearby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.city-nearby-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  text-decoration: none;
  transition: all 0.3s ease;
}

.city-nearby-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
  transform: translateY(-4px);
}

.city-nearby-name {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.city-nearby-county {
  font-size: 0.875rem;
  color: #64748b;
}

/* CTA section */
.city-cta-section {
  padding: 4rem 0;
  background: linear-gradient(
    135deg,
    #1e40af 0%,
    #2563eb 50%,
    #3b82f6 100%
  );
  text-align: center;
}

.city-cta-headline {
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 1rem;
  letter-spacing: -0.025em;
}

.city-cta-subtext {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.125rem;
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.city-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f16700;
  color: #ffffff;
  font-weight: 600;
  padding: 1rem 2rem;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(241, 103, 0, 0.4);
}

.city-cta-button:hover {
  background: #d95d00;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(241, 103, 0, 0.5);
}

/* No listings placeholder */
.city-no-listings {
  text-align: center;
  padding: 3rem;
  background: #f8fafc;
  border-radius: 16px;
  border: 2px dashed #e2e8f0;
}

.city-no-listings-icon {
  font-size: 3rem;
  color: #94a3b8;
  margin-bottom: 1rem;
}

.city-no-listings-text {
  color: #64748b;
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

.city-no-listings-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.city-no-listings-cta:hover {
  color: #1d4ed8;
}

/* Scroll reveal animation */
.city-scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.city-scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Cities index page */
.city-index-section {
  padding: 3rem 0;
  background: #ffffff;
}

.city-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.city-index-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.city-index-card:hover {
  background: #3b82f6;
  border-color: #3b82f6;
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
}

.city-index-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e0e7ff;
  border-radius: 10px;
  color: #3b82f6;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.city-index-card:hover .city-index-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.city-index-name {
  flex: 1;
  font-weight: 600;
  color: #1e293b;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.city-index-card:hover .city-index-name {
  color: #ffffff;
}

.city-index-arrow {
  color: #94a3b8;
  transition: all 0.3s ease;
}

.city-index-card:hover .city-index-arrow {
  color: #ffffff;
  transform: translateX(4px);
}

/* Data disclaimer section */
.city-disclaimer-section {
  padding: 1.5rem 0;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.city-disclaimer {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

.city-disclaimer p {
  color: #64748b;
  font-size: 0.8125rem;
  line-height: 1.6;
  margin: 0;
}

.city-disclaimer i {
  color: #94a3b8;
  margin-right: 0.5rem;
}

.city-disclaimer a {
  color: #3b82f6;
  text-decoration: none;
}

.city-disclaimer a:hover {
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .city-hero {
    min-height: 350px;
  }

  .city-hero-content {
    padding: 2rem 1rem 3rem;
  }

  .city-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .city-stat-value {
    font-size: 1.25rem;
  }

  .city-section-header h2 {
    font-size: 1.5rem;
  }

  .city-cta-headline {
    font-size: 1.5rem;
  }

  .city-listings-grid {
    grid-template-columns: 1fr;
  }
}
