/* Base Styles */
body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: #f9f9f9;
  color: #333;
  position: relative; /* Added to fix overlay issue */
}

/* Box Sizing Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Accessibility Focus Styles */
a:focus, button:focus, input:focus, textarea:focus {
  outline: 2px dashed #8a2387;
  outline-offset: 4px;
}

header {
  background: linear-gradient(90deg, #f27121, #e94057, #8a2387);
  padding: 15px;
}

.nav-container, nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

nav a {
  color: #fff;
  margin: 0 12px;
  font-weight: 500;
}

.consult-btn, .buy-button {
  background: #fff;
  color: #8a2387;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
}

/* Back to Home Button */
.back-to-home {
  background-color: #8a2387;
  color: white;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 30px;
  position: fixed;
  z-index: 999;
  transition: background-color 0.3s ease;
}

.back-to-home.bottom-left {
  bottom: 20px;
  left: 20px;
}

.back-to-home:hover {
  background-color: #e94057;
}

/* Hero */
.hero {
  background-image: url('images/hero-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
  padding: 100px 20px;
  text-align: center;
  position: relative; /* Added to fix overlay */
}

/* Gradient Overlay */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom right, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7));
  z-index: 0;
}

.hero-text {
  position: relative;
  z-index: 1;
}

.hero-text h1 {
  color: #fff;
  font-size: 48px;
}

.hero-text p {
  color: #ddd;
  margin-bottom: 20px;
}

.btn-primary {
  background: #8a2387;
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
}

/* Our Services Section */
.our-services {
  background: url('images/services-bg.jpg') center/cover no-repeat;
  background-size: cover;
  color: #fff;
  padding: 80px 20px;
  text-align: center;
  position: relative;
}

.our-services .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.our-services h1 {
  font-size: 3rem;
  margin-bottom: 20px;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
  z-index: 2;
  position: relative;
}

.our-services p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
  z-index: 2;
  position: relative;
}

/* Features */
.features {
  display: flex;
  justify-content: space-around;
  padding: 50px 20px;
  background: #fff;
  flex-wrap: wrap;
}

.feature {
  text-align: center;
  flex: 1 1 30%;
  margin: 20px;
}

/* About */
.about {
  text-align: center;
  padding: 40px;
  background: #eee;
}

.about img {
  margin-top: 20px;
  width: 300px;
  border-radius: 10px;
}

/* Services Landing Page */
.services {
  text-align: center;
  padding: 50px 20px;
}

.service-cards {
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
  flex-wrap: wrap;
}

.card {
  width: 30%;
  margin: 20px 10px;
}

.card img {
  width: 100%;
  border-radius: 10px;
}

/* Services Page */
.page-banner {
  background-size: cover;
  background-position: center;
  padding: 100px 20px;
  color: black;
  text-align: center;
  position: relative; /* Added */
}

.page-banner .banner-content h1,
.page-banner .banner-content p {
  color: black !important;
}

.banner-content h1 {
  font-size: 3rem;
  margin-bottom: 10px;
}

.banner-content p {
  font-size: 1.2rem;
}

.services-section {
  padding: 80px 20px;
  background-color: #f9f9f9;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 50px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
  max-width: 1100px;
  margin: 0 auto;
}

.service-card {
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
  text-align: center;
  transition: transform 0.3s ease;
}

.service-card:hover {
  transform: translateY(-5px);
}

.service-card img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 20px;
}

/* Blog Page */
.blog-hero {
  background: url('images/blog-hero.jpg') center/cover no-repeat;
  color: white;
  padding: 100px 20px;
  text-align: center;
}

.blog-hero h1 {
  font-size: 3rem;
  margin-bottom: 10px;
}

.blog-posts {
  max-width: 1000px;
  margin: 50px auto;
  padding: 0 20px;
}

.post {
  display: flex;
  gap: 20px;
  margin-bottom: 50px;
  flex-wrap: wrap;
}

.post img {
  width: 100%;
  max-width: 400px;
  border-radius: 8px;
}

.post-content {
  flex: 1;
}

.read-more {
  display: inline-block;
  margin-top: 10px;
  color: #007bff;
  text-decoration: none;
}

.read-more:hover {
  text-decoration: underline;
}

.blog-preview {
  padding: 60px 20px;
  text-align: center;
  background-color: #f9f9f9;
}

.blog-preview h2 {
  font-size: 2.2em;
  margin-bottom: 40px;
}

.blog-grid {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.blog-card {
  width: 100%;
  max-width: 300px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease;
}

.blog-card img {
  width: 100%;
  border-radius: 10px;
  height: auto;
}

.blog-card h3 {
  margin-top: 15px;
  font-size: 1.1em;
  font-weight: 600;
}

.blog-card:hover {
  transform: scale(1.03);
}

/* Footer */
footer {
  background: #333;
  color: #aaa;
  text-align: center;
  padding: 20px;
}

/* Forms & Admin */
.form-container, .admin-container, .page-container, .success-message {
  margin: 50px auto;
  width: 90%;
  max-width: 500px;
  text-align: center;
}

input, textarea {
  width: 90%;
  margin: 10px 0;
  padding: 12px;
  border: 2px solid #8a2387;
  border-radius: 12px;
}

button {
  margin-top: 20px;
  background: #8a2387;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
}

button:hover, .btn-primary:hover, .consult-btn:hover, .buy-button:hover {
  transform: scale(1.05);
  transition: transform 0.3s ease, background-color 0.3s ease;
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease-out, transform 1s ease-out;
}

.fade-in.show {
  opacity: 1;
  transform: translateY(0);
}

.loader {
  border: 8px solid #f3f3f3;
  border-top: 8px solid #8a2387;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  margin: 30px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Dark Mode */
body.dark {
  background: #121212;
  color: #ddd;
}

body.dark header {
  background: #333;
}

body.dark footer {
  background: #111;
}

body.dark nav a, body.dark .logo, body.dark .consult-btn {
  color: #fff;
}

.dark-mode-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
}

.dark-mode-toggle button {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .features, .service-cards {
    flex-direction: column;
    align-items: center;
  }

  .nav-links {
    flex-direction: column;
    gap: 10px;
  }

  .post {
    flex-direction: column;
    text-align: center;
  }

  .card, .service-card {
    width: 90%;
  }

  .hero-text h1 {
    font-size: 36px;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }
}

/* Consultation Page Styles */
body.consult-page {
  background: linear-gradient(to right, #f8f9fa, #e0e0e0);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  position: relative;
}

body.consult-page .back-to-home {
  position: absolute;
  top: 20px;
  left: 20px;
  background: #fff;
  color: #8a2387;
  padding: 10px 18px;
  border-radius: 25px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

body.consult-page .back-to-home:hover {
  background: #f3f3f3;
}

body.consult-page .form-container {
  background: #fff;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 700px;
  width: 90%;
  margin: 80px auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.consult-page .form-container h2 {
  margin-bottom: 25px;
  color: #8a2387;
}

body.consult-page input,
body.consult-page textarea {
  width: 100%;
  max-width: 500px;
  margin: 10px auto;
  padding: 12px 16px;
  border: 2px solid #ccc;
  border-radius: 10px;
  font-size: 16px;
  display: block;
  box-sizing: border-box;
}

body.consult-page input:focus,
body.consult-page textarea:focus {
  border-color: #8a2387;
  outline: none;
}

body.consult-page button.btn-primary {
  background: #8a2387;
  color: white;
  padding: 14px 28px;
  border: none;
  border-radius: 30px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s ease;
}

body.consult-page button.btn-primary:hover {
  background: #e94057;
}

@media (max-width: 600px) {
  body.consult-page .form-container {
    padding: 30px 20px;
  }

  body.consult-page button.btn-primary {
    width: 100%;
  }
}

.buy-button:hover {
  background-color: #e64a19;
}
