/* Importing Fonts - Added a secondary font for better typography hierarchy */
@import url('https://fonts.googleapis.com/css2?family=Lobster&family=Poppins:wght@300;400;600&display=swap');

/* Reset default styling */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body and background - Improved readability and consistency */
body {
  font-family: 'Poppins', sans-serif;
  background-color: #f8f8f8; /* Fallback background color */
  background-image: url('background3.jpg');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed; /* Keeps background fixed when scrolling */
  color: #333;
  line-height: 1.6;
  scroll-behavior: smooth;
}

/* Container for better content width control */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Navbar styling - More professional and accessible */
nav {
  background-color: rgba(51, 51, 51, 0.95); /* Semi-transparent background */
  padding: 1rem 0;
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'Lobster', cursive;
  color: rgb(131, 54, 255);
  font-size: 1.8rem;
  text-decoration: none;
}

nav ul {
  display: flex;
  justify-content: flex-end;
  list-style: none;
  gap: 2rem;
}

nav ul li a {
  color: #fff;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
}

nav ul li a:hover {
  color: rgb(131, 54, 255);
  background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: #fff;
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Header styling - More impactful and modern */
header {
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('categorybackground5.jpg');
  background-size: cover;
  background-position: center center;
  text-align: center;
  padding: 8rem 2rem;
  margin: 2rem auto 5rem auto;
  border-radius: 15px;
  max-width: 1000px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(131, 54, 255, 0.4) 0%, rgba(20, 220, 255, 0.2) 100%);
  z-index: 1;
}

header * {
  position: relative;
  z-index: 2;
}

h1 {
  font-family: 'Lobster', cursive;
  font-size: 4.5rem;
  color: #fff;
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
  margin-bottom: 1rem;
}

header p {
  font-size: 1.5rem;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  margin-top: 0.5rem;
  font-weight: 300;
}

/* Header Image Section - More polished presentation */
.header-image {
  margin: 2rem 0;
}

.header-image img {
  max-width: 250px;
  height: auto;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.header-image img:hover {
  transform: scale(1.05);
}

/* Section styling - Consistent and visually appealing */
.section {
  background-color: #fff;
  text-align: center;
  padding: 5rem 2rem;
  margin: 0 auto 5rem auto;
  border-radius: 15px;
  max-width: 1000px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('categorybackground5.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  z-index: 0;
}

.section-content {
  position: relative;
  z-index: 1;
}

/* Common Section styling */
h2 {
  font-family: 'Lobster', cursive;
  font-size: 3.5rem;
  color: rgb(131, 54, 255);
  margin-bottom: 1.5rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section p {
  font-size: 1.2rem;
  color: #555;
  margin-bottom: 1rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Gallery styling - Modern grid with hover effects */
.gallery-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  color: #fff;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item-caption {
  transform: translateY(0);
}

.gallery-item-caption p {
  font-family: 'Lobster', cursive;
  font-size: 1.3rem;
  margin: 0;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Services Section */
.services-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.service-card {
  background-color: rgba(255, 255, 255, 0.9);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(131, 54, 255, 0.2);
}

.service-card i {
  font-size: 2.5rem;
  color: rgb(131, 54, 255);
  margin-bottom: 1rem;
}

.service-card h3 {
  font-family: 'Lobster', cursive;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #444;
}

.service-card p {
  font-size: 1rem;
  color: #666;
}

/* About Section */
.about-container {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) 2fr;
  gap: 2rem;
  margin-top: 2rem;
  text-align: left;
  align-items: start; /* Align items to the top */
}

.about-image {
  text-align: center; /* Center the image in its container */
  max-width: 300px; /* Control max width */
  margin: 0 auto; /* Center if smaller than container */
}

.about-image img {
  width: 100%;
  max-width: 250px; /* Slightly smaller than container */
  height: auto;
  border-radius: 50%;
  border: 5px solid rgba(131, 54, 255, 0.2);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  object-fit: cover; /* Ensure proper image scaling */
  display: block; /* Removes extra space below image */
  margin: 0 auto; /* Center the image */
}

.about-text p {
  margin-bottom: 1rem;
  text-align: left;
}

.testimonial {
  background-color: rgba(255, 255, 255, 0.8);
  padding: 1.5rem;
  border-radius: 10px;
  border-left: 4px solid rgb(131, 54, 255);
  margin-top: 2rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.testimonial .quote {
  font-style: italic;
  font-size: 1.1rem;
  position: relative;
  padding-left: 1.5rem;
}

.testimonial .quote::before {
  content: '\201C';
  font-size: 2rem;
  position: absolute;
  left: 0;
  top: -0.5rem;
  color: rgb(131, 54, 255);
}

.testimonial .author {
  text-align: right;
  font-weight: 600;
  margin-top: 0.5rem;
  color: #555;
}

/* Contact form styling - More professional look */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: #555;
}

.contact-form input, 
.contact-form textarea, 
.contact-form button,
.contact-form select {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  transition: all 0.3s ease;
}

.contact-form input:focus, 
.contact-form textarea:focus,
.contact-form select:focus {
  outline: none;
  border-color: rgb(131, 54, 255);
  box-shadow: 0 0 0 2px rgba(131, 54, 255, 0.2);
}

.contact-form button {
  background-color: rgb(131, 54, 255);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background-color 0.3s;
  margin-top: 1rem;
}

.contact-form button:hover {
  background-color: rgb(111, 34, 235);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(131, 54, 255, 0.3);
}

/* Form validation styles */
.contact-form input.invalid,
.contact-form textarea.invalid,
.contact-form select.invalid {
  border-color: #ff4d4d;
  box-shadow: 0 0 0 2px rgba(255, 77, 77, 0.2);
}

/* Footer styling */
footer {
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1000px;
  margin: 0 auto;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.social-links a {
  color: #fff;
  font-size: 1.5rem;
  transition: color 0.3s;
}

.social-links a:hover {
  color: rgb(131, 54, 255);
}

.contact-info {
  margin: 1rem 0;
}

.contact-info p {
  color: #ddd;
  margin: 0.5rem 0;
}

.copyright {
  font-size: 0.9rem;
  color: #aaa;
  margin-top: 1rem;
}

/* Animation classes */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Alert message styling */
.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: none;
}

.alert-success {
  background-color: rgba(76, 175, 80, 0.2);
  border: 1px solid #4CAF50;
  color: #2e7d32;
}

.alert-error {
  background-color: rgba(244, 67, 54, 0.2);
  border: 1px solid #F44336;
  color: #c62828;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: rgb(131, 54, 255);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 99;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: rgb(111, 34, 235);
  transform: translateY(-3px);
}

/* Image optimization for performance */
img {
  max-width: 100%;
  height: auto;
}

/* Loading spinner styles */
.btn-loading i {
  margin-right: 8px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.fa-spinner {
  animation: spin 1s linear infinite;
}

/* Media Queries for Responsive Design */
@media screen and (max-width: 992px) {
  .gallery-items {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  
  h1 {
    font-size: 4rem;
  }
  
  h2 {
    font-size: 3rem;
  }
}

@media screen and (max-width: 768px) {
  nav .container {
    flex-direction: column;
    padding: 1rem;
  }
  
  nav ul {
    margin-top: 1rem;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  header {
    padding: 4rem 1.5rem;
  }
  
  .section {
    padding: 4rem 1.5rem;
  }
  
  h1 {
    font-size: 3.5rem;
  }
  
  h2 {
    font-size: 2.5rem;
  }
  
  .gallery-items {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  
  .about-container {
    grid-template-columns: 1fr; /* Stack vertically on mobile */
  }
  
  .about-image {
    text-align: center;
    margin-bottom: 2rem;
    margin-left: auto;
    margin-right: auto;
  }
  
  .about-text {
    text-align: center;
  }
  
  .about-text p {
    text-align: center;
  }
}

@media screen and (max-width: 576px) {
  .container {
    width: 95%;
  }
  
  nav .container {
    flex-direction: row;
  }
  
  .menu-toggle {
    display: flex;
  }
  
  nav ul {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    background-color: rgba(51, 51, 51, 0.95);
    padding: 1rem 0;
    gap: 0;
    display: none;
  }
  
  nav ul.active {
    display: flex;
  }
  
  nav ul li {
    width: 100%;
  }
  
  nav ul li a {
    display: block;
    padding: 1rem;
    text-align: center;
  }
  
  h1 {
    font-size: 3rem;
  }
  
  h2 {
    font-size: 2.2rem;
  }
  
  .gallery-items {
    grid-template-columns: 1fr;
  }
  
  .header-image img {
    max-width: 200px;
  }
}