/*
 * Stylesheet for Palms LLC website
 *
 * This file defines the typography, layout and colour palette for
 * Palms LLC. The palette is inspired by palm trees: rich greens
 * paired with warm browns and neutral backgrounds. The design
 * emphasises clarity, readability and a friendly, professional feel.
 */

/* Colour variables */
:root {
  --primary-green: #2e7d32;
  --secondary-brown: #8d6e63;
  --light-brown: #d7ccc8;
  --dark-text: #2e2e2e;
  --light-text: #ffffff;
  --background: #fafafa;
  --accent-bg: #f5f5f5;
}

html {
  box-sizing: border-box;
  font-size: 16px;
}

*, *:before, *:after {
  box-sizing: inherit;
}

body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  color: var(--dark-text);
  background-color: var(--background);
}

/* Containers ensure consistent spacing and max width */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header styling */
.header {
  background: var(--light-text);
  border-bottom: 1px solid var(--light-brown);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Reduce vertical padding to tighten space between the navigation
     bar and the hero section */
  padding: 0.75rem 0;
}

/* When the page is scrolled, add a subtle shadow to the header for depth */
.header--scrolled {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Adjust logo size for better visibility */
/* Adjust logo size for better visibility */
/* Increase logo size for better visibility */
.logo img {
  height: 110px;
}

.nav a {
  margin-left: 1.5rem;
  color: var(--dark-text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

/* Hero section */
.hero {
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-brown) 100%);
  color: var(--light-text);
  /* Decrease padding on the hero so there is less empty green space
     above the headline */
  padding: 3rem 0;
  text-align: center;
}

/* Image added to the hero section. It scales with the container and
   maintains a soft, modern appearance without dominating the page. */
.hero-image {
  display: block;
  max-width: 900px;
  width: 100%;
  height: auto;
  margin: 2rem auto 0;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 2rem;
}

/* Preloader overlay */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

/* Spinner for the preloader */
#preloader .spinner {
  width: 48px;
  height: 48px;
  border: 5px solid var(--light-brown);
  border-top-color: var(--primary-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Hide preloader when loaded */
#preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Scroll progress bar */
#progressBar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: var(--primary-green);
  width: 0;
  z-index: 1500;
}

/* Flip card styles for solutions */
.flip-card {
  background: transparent;
  perspective: 1000px;
  /* Ensure the card takes up space in the layout so subsequent sections
     aren’t pulled up underneath it. A minimum height prevents collapse
     when using absolutely positioned front/back faces. */
  min-height: 260px;
  position: relative;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  background: var(--accent-bg);
}

.flip-card-front h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--primary-green);
  font-size: 1.3rem;
}

.flip-card-back {
  transform: rotateY(180deg);
  text-align: center;
}

.flip-card-back h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--secondary-brown);
  font-size: 1.2rem;
}

.flip-card-back p {
  color: var(--dark-text);
}

/* Secondary button style for reviews link */
.btn--secondary {
  background: var(--secondary-brown);
  color: var(--light-text);
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: background 0.3s ease;
}

.btn--secondary:hover {
  background: var(--primary-green);
  color: var(--light-text);
}

/* Wrapper for reviews link inside impact section */
.reviews-link-wrapper {
  text-align: center;
  margin-top: 2rem;
}

/* Star styles for inline star rating */
.stars {
  color: #ffc107;
  font-size: 1.2rem;
}

/* Scroll-to-top button */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--secondary-brown);
  color: var(--light-text);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
  z-index: 1600;
}

.scroll-top:hover {
  background: var(--primary-green);
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}


/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.3s ease, color 0.3s ease;
}

.btn--primary {
  background: var(--light-text);
  color: var(--primary-green);
}

.btn--primary:hover {
  background: var(--light-brown);
  color: var(--primary-green);
}

/* Section headings */
/* Reduce section spacing to tighten layout while preserving separation */
section {
  /* Reduce vertical spacing between sections for a more cohesive layout */
  padding: 2.5rem 0;
  /* Ensure section headings are visible when navigating via anchors.
     Increase the scroll margin to account for the sticky header and logo. */
  scroll-margin-top: 8rem;
}

/* Reveal animation for cards and statistics */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

section h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--primary-green);
}

/* Why section */
.why__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.why__item {
  background: var(--accent-bg);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.why__item h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--secondary-brown);
  font-size: 1.25rem;
}

/* Solutions section */
.solutions__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.solutions__item {
  background: var(--accent-bg);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.solutions__item h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--primary-green);
  font-size: 1.3rem;
}

/* Impact section */
.impact__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.impact__item {
  background: var(--accent-bg);
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.impact__item h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--primary-green);
  font-size: 1.3rem;
}

/* About section */
/* About section now flows vertically. We remove flex row layout so
   the statistics appear beneath the text. */
.about__content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

/* Stats are displayed inline horizontally but centred */
.about__stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

.stat {
  background: var(--accent-bg);
  padding: 1.5rem;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat__number {
  display: block;
  font-size: 2rem;
  color: var(--secondary-brown);
  font-weight: 700;
}

.stat__label {
  font-size: 0.9rem;
  color: var(--dark-text);
}

/* Contact section */
/* Contact wrapper styling */
.contact {
  background: var(--accent-bg);
  border-top: 1px solid var(--light-brown);
}

.contact__content {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem 0;
}

/* Modern input styles */
.contact__form input,
.contact__form textarea {
  padding: 0.75rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  resize: vertical;
}

.contact__form input:focus,
.contact__form textarea:focus {
  outline: 2px solid var(--primary-green);
}
.contact__form button {
  align-self: center;
}

.contact__info p {
  margin: 0.3rem 0;
}

/* Footer */
.footer {
  background: var(--primary-green);
  color: var(--light-text);
  padding: 2rem 0;
}

.footer__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer__nav a {
  margin: 0 0.5rem;
  color: var(--light-text);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer__nav a:hover {
  text-decoration: underline;
}

/* Reviews page specific styles */
.reviews-hero {
  background: linear-gradient(135deg, var(--secondary-brown) 0%, var(--primary-green) 100%);
  color: var(--light-text);
}

.reviews-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.reviews-controls input[type="text"] {
  padding: 0.75rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  flex: 1 1 250px;
  max-width: 400px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.reviews-controls input[type="text"]:focus {
  outline: 2px solid var(--primary-green);
}

.reviews-controls button {
  flex: 0 0 auto;
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.review-card {
  background: var(--accent-bg);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.review-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  color: var(--secondary-brown);
}

.review-stars {
  color: #ffc107;
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.review-card p {
  flex-grow: 1;
  color: var(--dark-text);
  margin: 0;
}

@media (max-width: 768px) {
  .reviews-controls {
    flex-direction: column;
  }
  .reviews-controls button {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .about__content {
    flex-direction: column;
  }
  .about__stats {
    justify-content: center;
  }
  .nav a {
    margin-left: 0.75rem;
    font-size: 0.9rem;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1rem;
  }
}