/* Base styles for smooth scrolling and font */
html {
  scroll-behavior: smooth;
	scroll-padding-top: 70px; /* Adjusted for the new navbar height */
}

body, html {
  margin: 0;
  padding: 0;
  font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color-scheme: light dark;
}

#app {
  width: 100%;
  margin: 0;
  padding: 0;
  text-align: center;
}

/* Floating Navbar Styles */
.floating-navbar {
  position: fixed;
  top: 0;
  left: 0;
  transform: none;
  width: 100%;
  background: linear-gradient(to right, #3D6D5E, #11372A);
  border-radius: 0;
  padding: 0 40px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  height: 70px;
  display: flex;
  align-items: center;
}

.floating-navbar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 30px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.floating-navbar li {
  position: relative;
  padding: 10px 0;
  display: flex;
  align-items: center;
}

.floating-navbar a {
  text-decoration: none;
  color: white;
  font-weight: 500;
  padding: 5px 0;
  display: block;
  transition: color 0.3s ease;
}

.floating-navbar li::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: #4C7F6F;
  border-radius: 1px;
  transition: width 0.3s ease;
}

.floating-navbar li:has(a):hover::after,
.floating-navbar li:has(a):active::after {
  width: 100%;
}

.floating-navbar a:hover,
.floating-navbar a:active {
  color: #dddddd;
}

/* General Container Styles */
.container {
  min-height: 60vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  box-sizing: border-box;
  text-align: left;
  flex-direction: column;
}

/* Container 1 (Home Section) */
.container-1 {
  background-color: #163D30;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
  align-items: flex-start;
  padding-top: 0;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: stretch;
  min-height: 80vh;
  padding: 0;
}

.container-1 .text-content {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.container-1 .image-area {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  overflow: hidden;
}

/* Container 2 (Products Section) */
.container-2 {
  background-color: #ffffff;
  color: #213547;
  align-items: flex-start;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  min-height: 80vh;
}

.container-2 h2 {
  color: #264A47;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  width: 100%;
  text-align: center;
  font-size: 2.2em;
}

/* Products Grid - Enhanced Dynamic Display */
.products-grid {
  display: flex;
  flex-wrap: nowrap; /* Ensure items stay in a single row for scroll-snap */
  justify-content: flex-start; /* Items flow from the start, scroll-snap handles centering */
  align-items: center; /* Vertically center items within the grid */
  gap: 30px; /* Spacing between product items */
  width: 100%;
  padding: 20px 0; /* Vertical padding for the grid */
  box-sizing: border-box;
  margin-top: 2rem;
  min-height: 500px; /* Increased height to accommodate larger active item */
  overflow-x: auto; /* Enable horizontal scrolling */
  scroll-snap-type: x mandatory; /* Enable scroll snapping for smooth centering */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS devices */
  cursor: grab; /* Visual cue that the grid is scrollable */
  
  /* Hide scrollbar for aesthetic purposes, but keep functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
}

/* Hide scrollbar for Webkit browsers (Chrome, Safari, Opera) */
.products-grid::-webkit-scrollbar {
  display: none;
}

/* Product Item - Inactive State */
.product-item {
  position: relative;
  flex-shrink: 0; /* Prevent items from shrinking when space is limited */
  scroll-snap-align: center; /* Snap to the center of the scroll container */
  width: 250px; /* Default width for inactive items */
  height: 350px; /* Default height for inactive items */
  background-color: #f0f0f0;
  border-radius: 15px; /* Slightly more rounded corners for a modern look */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15); /* Softer shadow for inactive items */
  overflow: hidden;
  cursor: pointer;
  transition: all 0.5s ease-in-out; /* Smooth transition for all properties */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  opacity: 0.6; /* Decreased opacity for de-emphasis */
  filter: grayscale(80%) blur(2px); /* Grayscale and blur for de-emphasis */
  transform: scale(0.9); /* Slightly scaled down for de-emphasis */
  outline: none; /* Remove default outline */
}

/* Product Item - Focus State (for keyboard navigation) */
.product-item:focus {
  box-shadow: 0 0 0 3px #67D0B2, 0 15px 30px rgba(0, 0, 0, 0.3); /* Highlight with accent color */
  transform: scale(0.95); /* Slightly larger on focus */
  opacity: 0.8;
  filter: grayscale(40%) blur(1px);
}


/* Product Item - Active State */
.product-item.active {
  width: 400px; /* Expanded width for the active item */
  height: 450px; /* Expanded height for the active item */
  transform: scale(1); /* Full size for the active item */
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3); /* More prominent shadow for active item */
  background-color: #e8f5e9; /* Highlighted background color */
  opacity: 1; /* Full opacity */
  filter: none; /* No grayscale or blur */
  z-index: 10; /* Bring the active item to the front */
}

/* Product Image Styles */
.product-item img {
  width: 100%;
  height: 180px; /* Image height for inactive items */
  object-fit: cover;
  border-bottom: 1px solid #ddd;
  transition: height 0.5s ease-in-out; /* Smooth transition for image height */
}

.product-item.active img {
  height: 250px; /* Larger image height for the active item */
}

/* Product Details Styles */
.product-details {
  padding: 15px;
  opacity: 0; /* Hidden by default for inactive items */
  height: 0; /* Collapse height for inactive items */
  overflow: hidden;
  transition: opacity 0.5s ease-in-out, height 0.5s ease-in-out, padding 0.5s ease-in-out; /* Smooth transitions for details */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  flex-grow: 1; /* Allows details to take up available space */
}

.product-item.active .product-details {
  opacity: 1; /* Visible for active items */
  height: auto; /* Auto height to display content */
  padding-top: 10px;
  padding-bottom: 15px; /* Ensure consistent padding */
}

.product-details h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #264A47;
  font-size: 1.4em;
}

.product-details p {
  font-size: 0.9em;
  color: #555;
  line-height: 1.4;
  margin-bottom: 15px;
}

/* Call to Action Button (Small) */
.cta-button.small-cta {
  padding: 8px 15px;
  font-size: 0.9em;
  border-radius: 20px;
  background: linear-gradient(to right, #FFA8CD, #F8C8DC); /* Updated gradient */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: background 0.3s ease, transform 0.3s ease;
}

.cta-button.small-cta:hover {
  transform: translateY(-2px);
  background: linear-gradient(to right, #F8C8DC, #FFA8CD); /* Hover gradient */
}

/* Container 3 (Projects Section) */
.container-3 {
  background-color: #163D30;
  color: white;
  align-items: flex-start;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  padding-top: 2rem;
  padding-bottom: 2rem;
  flex-direction: column;
}

.container-3 h2 {
  color: white;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  width: 100%;
  text-align: center;
  font-size: 2.2em;
}

.projects-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 900px;
  padding: 0 20px;
  box-sizing: border-box;
  margin-bottom: 20px;
}

.project-square {
  width: 250px;
  height: 250px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.project-square img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-square img::before {
  content: attr(alt);
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  font-family: serif;
  font-size: 1.2em;
  text-align: center;
  padding: 10px;
  box-sizing: border-box;
  z-index: 2;
}

/* Heading Styles */
h1 {
  font-size: 3.2em;
  line-height: 1.1;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 2em;
  margin-bottom: 1rem;
  margin-top: 0;
}

h2.smaller-text {
  font-size: 1.5em;
}

p {
  font-size: 1.1em;
}

/* Call to Action Button (General) */
.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 15px 30px;
  border-radius: 30px;
  background: linear-gradient(to right, #54AF93, #67D0B2, #54AF93);
  color: white;
  text-decoration: none;
  font-size: 1.1em;
  font-weight: bold;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: none;
  text-shadow: none;
}

.cta-button i {
  font-size: 1em;
  color: white;
}

.cta-button::before {
  display: none;
}

.cta-button::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 20px;
  width: 0;
  height: 2px;
  background-color: white;
  border-radius: 1px;
  transition: width 0.3s ease-out;
  z-index: -1;
}

.cta-button:hover::after {
  width: calc(100% - 40px);
}

.cta-button.gray-cta {
  background: #6c757d;
  color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.cta-button.gray-cta::after {
  display: none;
}

.project-ctas-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 40px;
  width: 100%;
  max-width: 900px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Contact Section Background */
.contact-background {
  background-image: url('https://images.pexels.com/photos/3861964/pexels-photo-3861964.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2'); /* Example image */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 5vh;
  position: relative;
  z-index: 1;
}

.contact-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0);
  z-index: -1;
}

/* Footer Styles */
footer {
  background-color: #000;
  color: #85FFC7;
  padding: 2rem;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  margin-top: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
  padding: 2rem 1rem;
  gap: 40px;
}

.footer-left,
.footer-center,
.footer-right {
  flex: 1;
  padding: 0;
  box-sizing: border-box;
  min-width: 200px;
}

.footer-left {
  text-align: center;
}

.footer-center {
  text-align: center;
  position: relative;
  transition: background-color 0.3s ease;
  padding: 10px 0;
  border-radius: 5px;
}

.footer-center:hover {
  background-color: rgba(133, 255, 199, 0.1);
}

.footer-right {
  text-align: left;
}

.footer-logo {
  height: 160px;
}

.footer-center ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.footer-center a {
  text-decoration: none;
  color: #85FFC7;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer-center a:hover {
  color: #67D0B2;
}

.footer-right p {
  font-size: 1em;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  color: #85FFC7;
}

.footer-right i {
  font-size: 1.2em;
  color: #85FFC7;
}

.footer-center::before,
.footer-center::after {
  content: '';
  position: absolute;
  top: 10%;
  bottom: 10%;
  width: 2px;
  background: linear-gradient(to bottom, #85FFC7, transparent);
}

.footer-center::before {
  left: 0;
}

.footer-center::after {
  right: 0;
}

/* Media Queries for Responsiveness */
@media (max-width: 1024px) {
  /* Adjust product item sizes for medium screens */
  .product-item {
    width: 220px;
    height: 320px;
  }
  .product-item.active {
    width: 350px;
    height: 400px;
  }
  .product-item img {
    height: 160px;
  }
  .product-item.active img {
    height: 220px;
  }
}

@media (max-width: 768px) {
  /* Adjust product item sizes for small screens */
  .product-item {
    width: 200px;
    height: 300px;
  }
  .product-item.active {
    width: 300px;
    height: 380px;
  }
  .product-item img {
    height: 140px;
  }
  .product-item.active img {
    height: 200px;
  }

  /* Footer adjustments for small screens */
  footer {
    flex-direction: column;
    gap: 30px;
    padding: 2rem 1rem;
    justify-content: center;
  }

  .footer-left,
  .footer-center,
  .footer-right {
    width: 100%;
    text-align: center;
    padding: 0;
  }

  .footer-left {
    order: 1;
  }

  .footer-center {
    order: 2;
  }

  .footer-right {
    order: 3;
  }

  .footer-center ul {
    align-items: center;
  }

  .footer-right p {
    justify-content: center;
  }

  .footer-center::before,
  .footer-center::after {
    display: none;
  }
}
