/* Krishna-Inspired Professional Theme */
:root {
  --bg-main: #fdfaf6; /* Warm Off-White */
  --bg-card: #ffffff; /* Clean White */
  --primary-accent: #2a4d69; /* Peacock Blue */
  --secondary-accent: #e7b100; /* Saffron/Ochre */
  --text-main: #333333; /* Dark Charcoal */
  --text-dim: #6c757d; /* Muted Gray */
  --border-color: #dee2e6; /* Light Gray for borders */
  --shadow-color: rgba(0, 0, 0, 0.1);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
}

/* Refined Top Nav */
header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 50px;
  box-sizing: border-box;
  z-index: 1000;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-main);
  text-transform: uppercase;
  text-decoration: none;
}

.nav-logo span {
  color: var(--primary-accent);
}

nav a {
  color: var(--text-main);
  text-decoration: none;
  margin-left: 25px;
  font-weight: 600;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  position: relative;
  padding: 5px 0;
}

nav a:hover {
  color: var(--primary-accent);
}

/* Hero Section */
.hero {
  position: relative; /* Needed for positioning the slideshow */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 100px 20px 40px;
  /* background: radial-gradient(circle at center, rgba(0, 240, 255, 0.08) 0%, transparent 70%); */
}

.hero-slideshow,
.hero-slideshow::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1; /* Place it behind the hero text */
}

.hero-slideshow::after {
  content: '';
  background-color: rgba(42, 77, 105, 0.5); /* Themed overlay for text readability */
}

.hero-slideshow .slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  filter: blur(4px);
  animation: imageFade 9s linear infinite;
}

/* Assign images and animation delays */
.hero-slideshow .slide:nth-child(1) {
  background-image: url('images/KS-Front-Aesthatic.jpeg');
}

.hero-slideshow .slide:nth-child(2) {
  background-image: url('images/KS-Front-Side.jpeg');
  animation-delay: 3s;
}

.hero-slideshow .slide:nth-child(3) {
  background-image: url('images/KS-Front-Straight.jpeg');
  animation-delay: 6s;
}

@keyframes imageFade {
  0% {
    opacity: 0;
  }
  16.66% { /* Fade In */
    opacity: 1;
  }
  33.33% { /* Hold */
    opacity: 1;
  }
  50% { /* Fade Out */
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.brand-title {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: 5px;
  text-transform: uppercase;
  margin: 0;
  color: #fff;
  text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.brand-subtitle {
  font-size: 1.2rem;
  color: #fff;
  letter-spacing: 3px;
  margin-top: 15px;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* General Layout Sections */
section {
  padding: 100px 10%;
  box-sizing: border-box;
}

.section-title {
  font-size: 2.2rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-left: 4px solid var(--primary-accent);
  padding-left: 15px;
  margin-bottom: 40px;
}

/* Clean Cards */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 12px var(--shadow-color);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-accent);
  box-shadow: 0 8px 20px var(--shadow-color);
}

/* Building Grid */
.building-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.btn-primary {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 24px;
  background: var(--primary-accent);
  color: #fff;
  border: 1px solid var(--primary-accent);
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: #1d354a;
  border-color: #1d354a;
}

/* Updated Card Layout Styling */
.card-layout-container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.card-identity {
  flex: 0 1 200px; /* Flex-basis of 200px, won't grow, can shrink */
  display: flex;
  flex-direction: row; /* Places items side-by-side */
  align-items: center; /* Vertically aligns logo and text */
  gap: 10px;
}

.card-image-wrapper {
  position: relative; /* Required for the background effect */
  flex: 1 1 auto; /* Allows this container to grow and fill space */
  overflow: hidden; /* Keeps the blurred background within the rounded corners */
  border-radius: 8px;
}

/* The blurred background image effect */
.card-image-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('images/KS-Front-Aesthatic.jpeg');
  background-size: cover;
  background-position: center;
  filter: blur(10px);
  opacity: 0.25;
  z-index: 1;
}

.building-image {
  position: relative; /* Ensures the main image sits on top of the background */
  width: 100%;
  height: auto;
  max-height: 350px; /* Significantly increased height for more prominence */
  object-fit: contain;
  border-radius: 8px;
  z-index: 2; /* Sits on top of the ::before pseudo-element */
}

.card-logo {
  height: 24px; /* Further reduced size for a smaller appearance */
  width: 24px;
  border: none; /* Removed the enclosing border */
}

.card-title {
  color: var(--primary-accent);
  font-size: 1.5rem; /* Explicitly set font size for better control */
  margin: 0; /* Remove default h3 margin */
}

.card-description {
  color: var(--text-dim);
  margin-top: 20px; /* Add margin to the description instead */
}

.overview-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-dim);
}

.card-location {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-top: 10px;
  margin-bottom: 0;
}

/* Testimonials Section */
#testimonials {
  padding-top: 50px;
  padding-bottom: 100px;
}

.testimonial-scroller {
  width: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, white 20%, white 80%, transparent);
  mask-image: linear-gradient(to right, transparent, white 20%, white 80%, transparent);
}

.testimonial-track {
  display: flex;
  gap: 20px;
  width: calc(350px * 12); /* (Card width + gap) * (number of cards * 2) */
  animation: scroll 40s linear infinite;
}

@keyframes scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-350px * 6)); /* (Card width + gap) * number of cards */
  }
}

.testimonial-card {
  flex-shrink: 0;
  width: 330px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 25px;
}

.testimonial-card .stars {
  color: var(--neon-green);
  font-size: 1.2rem;
  letter-spacing: 2px;
}

.testimonial-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-main);
  margin-top: 15px;
  margin-bottom: 15px;
}

.testimonial-card footer {
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--primary-accent);
  text-align: right;
}

.testimonial-track::before,
.testimonial-track::after {
  content: attr(data-content);
  display: flex;
  gap: 20px;
}
/* Spec Table */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.spec-table th, .spec-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.spec-table th {
  color: var(--primary-accent);
}

/* Krish Square Page Specifics */
.page-section {
  padding: 120px 10% 100px; /* More top padding to account for fixed header */
}

.page-title {
  font-size: 2.8rem;
  text-align: left;
  color: var(--primary-accent);
  margin: 0;
}

.page-title-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.page-title-logo {
  height: 40px;
}

.status-highlight {
  color: var(--secondary-accent);
  font-weight: bold;
  letter-spacing: 1px;
  margin-top: 5px;
}

.spec-card {
  margin-top: 30px;
}

.card-subtitle {
  color: var(--primary-accent);
}

.info-section {
  margin-top: 50px;
}

.inquiry-link {
  margin-top: 40px;
  text-align: center;
}

/* --- REMOVING OLD GALLERY STYLES --- */
/*
  .gallery-container { ... }
  .gallery-scroller { ... }
  .gallery-scroller img { ... }
  .gallery-scroller .floor-plan-img { ... }
*/

/* New Split Layout */
.layout-split {
  display: flex;
  gap: 30px;
}

.gallery-column {
  flex: 2; /* Takes up 2/3 of the space */
  display: flex;
  flex-direction: column;
}

.floor-plan-column {
  flex: 1; /* Takes up 1/3 of the space */
  display: flex;
  flex-direction: column;
}

/* New Auto-Gallery Styles */
.auto-gallery-container {
  position: relative;
  height: 450px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background-color: #f0f0f0;
}

.gallery-slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

.gallery-slide.active {
  opacity: 1;
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.7);
  color: var(--primary-accent);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease, background-color 0.3s ease;
  z-index: 10;
}

.auto-gallery-container:hover .gallery-nav {
  opacity: 1;
}

.gallery-nav:hover {
  background-color: #fff;
}

.gallery-nav.prev {
  left: 15px;
}

.gallery-nav.next {
  right: 15px;
}

/* Floor Plan Styles */
.interactive-plan-container {
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background-color: #f0f0f0;
  height: 100%;
}

.plan-slide {
  display: none;
  padding: 10px;
}

.plan-slide.active {
  display: block;
}

.plan-slide img {
  width: 100%;
  border-radius: 8px;
}

.plan-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.7);
  color: var(--primary-accent);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease, background-color 0.3s ease;
  z-index: 10;
}

.interactive-plan-container:hover .plan-nav {
  opacity: 1;
}

.plan-nav:hover {
  background-color: #fff;
}

.plan-nav.prev {
  left: 15px;
}

.plan-nav.next {
  right: 15px;
}

.floor-plan-caption {
  text-align: center;
  color: var(--text-dim);
  margin-top: 10px;
}

/* Accordion Styles */
.accordion-item {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 10px;
}

.accordion-toggle {
  display: none; /* Hide the checkbox */
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-accent);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.accordion-header:hover {
  background-color: #f8f9fa;
}

.accordion-header::after {
  content: '+';
  font-size: 2rem;
  font-weight: 300;
  color: var(--secondary-accent);
  transition: transform 0.3s ease;
}

.accordion-toggle:checked + .accordion-header::after {
  content: '−';
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-out, padding 0.5s ease-out;
  padding: 0 20px;
  color: var(--text-dim);
  line-height: 1.7;
}

.content-split {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.content-text {
  flex: 1;
}

.content-image {
  flex: 1;
}

.content-image img {
  width: 100%;
  border-radius: 8px;
}

.accordion-content h4 {
  color: var(--primary-accent);
  border-bottom: 1px solid var(--border-glow);
  padding-bottom: 8px;
  margin-top: 10px;
  margin-bottom: 15px;
}

.accordion-content ul {
  list-style-type: none;
  padding-left: 10px;
}

.accordion-content li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
}

.accordion-content li::before {
  content: '»';
  position: absolute;
  left: 0;
  color: var(--primary-accent);
}

.details-table {
  width: 100%;
  border-collapse: collapse;
}
.details-table th, .details-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.accordion-toggle:checked ~ .accordion-content {
  max-height: 1000px; /* Large enough to fit content */
  padding: 20px;
  border-top: 1px solid var(--border-color);
}

.inline-logo {
  height: 1em; /* Makes the logo the same height as the text */
  width: auto;
  vertical-align: -0.15em; /* Fine-tunes vertical alignment */
  margin: 0 5px;
}

/* --- Responsive Design for Mobile & Tablets --- */
@media (max-width: 768px) {
  /* Adjust header for smaller screens */
  header {
    flex-wrap: wrap;
    padding: 15px 20px;
  }
  .nav-logo {
    flex-basis: 100%; /* Logo takes full width on its own line */
    text-align: center;
    margin-bottom: 10px;
  }
  nav {
    flex-basis: 100%;
    display: flex;
    justify-content: center;
    gap: 20px;
  }
  nav a {
    margin-left: 0;
  }
  nav a[href="#overview"] {
    display: none; /* Hide the overview link on mobile */
  }

  /* Reduce padding on all sections */
  section {
    padding: 80px 5%;
  }

  /* --- Mobile Hero Section Redesign --- */
  .hero {
    min-height: auto; /* Remove full-screen height */
    height: 50vh; /* Set a specific height */
    background-image: url('images/KS-Front-Aesthatic.jpeg');
    background-size: cover;
    background-position: center;
  }
  .hero-slideshow {
    display: none; /* Hide the desktop slideshow */
  }
  .brand-title {
    font-size: 2.5rem;
  }
  .brand-subtitle {
    font-size: 1rem;
  }

  /* Scale down section titles */
  .section-title, .page-title {
    font-size: 1.8rem;
  }

  /* --- STACK THE LAYOUTS VERTICALLY --- */

  /* Stack the building card layout on the home page */
  .card-layout-container {
    flex-direction: column;
    gap: 10px;
  }
  .glass-card.building-card {
    padding: 20px; /* Reduce padding on mobile */
  }

  /* Stack the gallery and floor plan on the Krish Square page */
  .layout-split {
    flex-direction: column;
  }

  /* Stack the text and image inside the accordion */
  .content-split {
    flex-direction: column;
  }

  /* Adjust gallery height for vertical screens */
  .auto-gallery-container {
    height: 300px;
  }

  /* Make the details table responsive */
  .details-table thead {
    display: none; /* Hide the original table header */
  }
  .details-table tr {
    display: block;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
  }
  .details-table td {
    display: block;
    text-align: right; /* Align content to the right */
    border-bottom: 1px dotted var(--border-color);
  }
  .details-table td::before {
    content: attr(data-label); /* Add the label from the data-attribute */
    float: left; /* Align label to the left */
    font-weight: bold;
    color: var(--primary-accent);
  }
  .details-table td:last-child {
    border-bottom: none;
  }
}