/* Navbar Styles */
.navbar {
  background-color: #f8f9fa !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand img {
  transition: transform 0.3s ease;
}

.navbar-brand img:hover {
  transform: scale(1.05);
}

.navbar .nav-link {
  font-weight: 500;
  transition: color 0.3s ease;
}

.navbar .nav-link:hover {
  color: #0d6efd !important;
}

.navbar .nav-link.active {
  font-weight: 600;
  color: #0d6efd !important;
  border-bottom: 2px solid #0d6efd;
}

.navbar-toggler {
  border: none;
}

.navbar-toggler:focus {
  box-shadow: none;
}

.dropdown-menu {
  border: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dropdown-item:hover {
  background-color: #f8f9fa;
  color: #0d6efd;
}

#searchForm .form-control {
  border-radius: 20px 0 0 20px;
}

#searchForm .btn {
  border-radius: 0 20px 20px 0;
  border-left: none;
}

#searchForm .btn:hover {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

/* CSS Variables for Theming */
:root {
  --bg-color: linear-gradient(135deg, #f4f7fc 0%, #e8f4fd 100%);
  --text-color: #1b2945;
  --navbar-bg: #ffffff;
  --navbar-text: #1b2945;
  --card-bg: #ffffff;
  --card-border: #007bff;
  --primary-color: #007bff;
  --section-title: #ff6b35;
  --footer-bg: #fafafa;
  --footer-text: #445577;
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --bg-color: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  --text-color: #e0e0e0;
  --navbar-bg: #2d3748;
  --navbar-text: #e0e0e0;
  --card-bg: #2d3748;
  --card-border: #63b3ed;
  --primary-color: #63b3ed;
  --section-title: #f6ad55;
  --footer-bg: #1a202c;
  --footer-text: #a0aec0;
}

/* General Styles */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  transition: background 0.5s ease, color 0.5s ease;
}

/* Add smooth font rendering */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Hero Section */
.hero-section {
  position: relative;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
  padding: 3rem 1rem;
  box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.3);
  animation: fadeInSlideDown 1s ease forwards;
}

.hero-bg {
  opacity: 0.2;
  z-index: 0;
  top: 0;
  left: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  transition: opacity 0.7s ease;
}

.hero-section:hover .hero-bg {
  opacity: 0.3;
}

/* Hero Text Effects */
.hero-title {
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  font-weight: 700;
  animation: fadeIn 1.5s ease forwards;
}

.hero-tagline {
  color: #ffffff;
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.6;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  animation: fadeIn 1.5s ease forwards 0.5s;
  opacity: 0;
  animation-fill-mode: forwards;
}

.hero-subtitle {
  color: #ffffff;
  max-width: 520px;
  margin: 0 auto 1.5rem;
  line-height: 1.5;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  opacity: 0.9;
  font-weight: bold;
}

.hero-cta {
  background: #ffffff;
  color: #007bff;
  border: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  animation: fadeIn 1.5s ease forwards 1s;
  opacity: 0;
  animation-fill-mode: forwards;
}

.hero-cta:hover {
  background: #f8f9fa;
  color: #0056b3;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Social Icons */
.hero-social-links a {
  color: #ffffff;
  margin: 0 10px;
  transition: color 0.3s ease, transform 0.3s ease;
  opacity: 0.8;
}

.hero-social-links a:hover {
  color: #f8f9fa;
  transform: scale(1.2);
  opacity: 1;
}

/* Main Headings */
.main-heading {
  animation: fadeIn 1.2s ease forwards;
}

.section-title {
  color: #ff6b35;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 1rem;
  position: relative;
  font-size: 1.2rem;
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #ff6b35, #f7931e);
  margin: 0.5rem auto 0;
  border-radius: 2px;
}

/* Who We Are Section */
.who-we-are-section p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #3d475a;
  opacity: 0;
  transform: translateX(-20px);
  animation: slideInFromLeft 1s forwards;
  animation-delay: 0.5s;
  letter-spacing: 0.5px;
}

.who-we-are-section img {
  max-width: 80%;
  height: auto;
  margin: 0 auto;
  display: block;
}

/* Factory Images */
.factory-images img {
  max-width: 100%;
  height: auto;
  margin-bottom: 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Factory Video */
.factory-video {
  margin-top: 2rem;
}

.factory-video video {
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.video-caption {
  margin-top: 1rem;
  font-style: italic;
  color: #666;
  text-align: center;
}

/* Contact Form Styles */
.contact-form-container {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 20px;
  padding: 3rem 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 123, 255, 0.1);
  transition: all 0.3s ease;
  animation: fadeInUp 0.8s ease forwards;
}

.contact-form-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

.contact-title {
  color: #2c3e50;
  font-weight: 700;
  font-size: 2.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  animation: slideInFromLeft 0.8s ease forwards;
}

.contact-subtitle {
  color: #6c757d;
  font-size: 1.1rem;
  font-weight: 300;
  animation: slideInFromRight 0.8s ease forwards 0.2s;
  opacity: 0;
  animation-fill-mode: forwards;
}

.contact-form .form-group {
  position: relative;
  margin-bottom: 2rem;
}

.contact-form .form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
  font-size: 1rem;
}

.contact-form .form-control {
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: #ffffff;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.contact-form .form-control:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  transform: translateY(-2px);
  background-color: #f8f9ff;
}

.contact-form .form-control:hover {
  border-color: #007bff;
  transform: translateY(-1px);
}

.contact-form textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.contact-form .error-message {
  display: none;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  animation: fadeIn 0.3s ease;
}

.contact-form .btn-primary {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  border: none;
  border-radius: 50px;
  padding: 1rem 3rem;
  font-weight: 600;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.contact-form .btn-primary:before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.contact-form .btn-primary:hover:before {
  left: 100%;
}

.contact-form .btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 123, 255, 0.4);
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

.contact-form .btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(0, 123, 255, 0.3);
}

/* Form validation states */
.contact-form .form-control.is-valid {
  border-color: #28a745;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.contact-form .form-control.is-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .contact-form-container {
    padding: 2rem 1.5rem;
    margin: 0 1rem;
  }

  .contact-title {
    font-size: 2rem;
  }

  .contact-form .btn-primary {
    width: 100%;
    padding: 1rem 2rem;
  }
}

/* Animation keyframes for contact form */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Our Products Section */
.our-products-section {
  margin-top: 3rem;
}

.our-products-section img {
  border-radius: 12px;
  box-shadow: 0 15px 40px rgb(27 41 69 / 0.25);
  animation: fadeIn 1.3s ease forwards;
  max-width: 100%;
  height: auto;
}

.our-products-section p {
  font-size: 1.05rem;
  color: #3d475a;
  animation: slideInFromRight 1s forwards;
  animation-delay: 0.7s;
}

.our-products-section ul {
  list-style: none;
  padding-left: 0;
  margin-top: 1rem;
  margin-bottom: 1rem;
  animation: fadeIn 1.7s ease forwards;
}

.our-products-section ul li {
  padding-left: 1.3em;
  position: relative;
  margin-bottom: 0.6rem;
  color: #1b2945;
  font-weight: 600;
}

.our-products-section ul li::before {
  content: "\2713";
  color: #007bff;
  font-weight: bold;
  position: absolute;
  left: 0;
}

/* Cards inside Why Choose Us */
.card {
  border-radius: 15px;
  border: 1px solid var(--card-border);
  background-color: var(--card-bg);
  box-shadow: 0 20px 40px rgb(27 41 69 / 0.1);
  padding: 1.8rem;
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.3s ease;
  cursor: default;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 30px 50px rgb(27 41 69 / 0.15);
  border-color: var(--section-title);
}

/* Icons for cards */
.icon-quality,
.icon-innovation,
.icon-customer {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  background-size: 60% auto;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.8;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

.icon-quality {
  animation: iconPulse 2s infinite ease-in-out;
}

.icon-innovation {
  animation: iconPulse 2s 0.3s infinite ease-in-out;
}

.icon-customer {
  animation: iconPulse 2s 0.6s infinite ease-in-out;
}

/* Customer Testimonials */
.card.fst-italic {
  font-style: italic;
  font-size: 1.05rem;
  color: #444c65;
  transition: color 0.3s ease;
}

.card.fst-italic:hover {
  color: #007bff;
}

/* Newsletter Section */
.newsletter-signup {
  background: #007bff;
  color: #ffffff;
  border-radius: 20px;
  max-width: 480px;
  margin: 3rem auto;
  padding: 2.5rem 1.5rem;
  box-shadow: 0 10px 30px rgb(0 123 255 / 0.3);
  text-align: center;
  animation: fadeInScale 1.2s ease forwards;
}

.newsletter-signup input {
  border-radius: 40px;
  border: none;
  padding: 0.7rem 1.2rem;
  width: 60%;
  max-width: 280px;
  margin-right: 8px;
  transition: box-shadow 0.3s ease;
  outline: none;
}

.newsletter-signup input:focus {
  box-shadow: 0 0 20px rgb(255 255 255 / 0.7);
}

.newsletter-signup button {
  border-radius: 40px;
  padding: 0.7rem 2rem;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.newsletter-signup button:hover {
  background-color: #0056b3;
}

/* Certifications Section */
.mb-5.text-center img {
  border-radius: 15px;
  box-shadow: 0 15px 40px rgb(27 41 69 / 0.25);
  transition: transform 0.5s ease;
  max-width: 100%;
  height: auto;
}

.mb-5.text-center img:hover {
  transform: scale(1.05) rotate(1.5deg);
}

/* Client Logos Marquee */
.clients-marquee {
  display: flex;
  gap: 30px;
  animation: marquee 30s linear infinite;
  align-items: center;
}

.clients-marquee img {
  max-height: 60px;
  filter: grayscale(60%);
  transition: filter 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}

.clients-marquee img:hover {
  filter: grayscale(0);
  transform: scale(1.1);
}

/* Social Media Icons */
.text-center a {
  transition: color 0.3s ease, transform 0.3s ease;
}

.text-center a:hover {
  color: #007bff;
  transform: scale(1.3);
}

/* Footer */
footer {
  font-size: 0.9rem;
  background-color: var(--footer-bg);
  color: var(--footer-text);
  box-shadow: inset 0 8px 10px -10px rgb(27 41 69 / 0.06);
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

footer .section-title {
  color: var(--text-color);
  font-weight: 700;
  margin-bottom: 0.8rem;
}

/* Links in footer */
footer a {
  color: var(--footer-text);
  transition: color 0.3s ease;
}

footer a:hover {
  color: var(--primary-color);
}

/* Animations */
@keyframes fadeInSlideDown {
  0% {
    opacity: 0;
    transform: translateY(-30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInFromLeft {
  0% {
    opacity: 0;
    transform: translateX(-40px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromRight {
  0% {
    opacity: 0;
    transform: translateX(40px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes iconPulse {
  0%,
  100% {
    opacity: 0.8;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Loaded State (trigger from JS) */
body.loaded {
  background-color: #f0f4ff;
}

/* Responsive Breakpoints */

/* Extra Small Devices (Phones) <576px */
@media (max-width: 575.98px) {
  .navbar-nav.ms-auto {
    text-align: center;
  }

  .hero-section {
    min-height: 350px;
    padding: 2rem 1rem;
  }

  .hero-section h2 {
    font-size: 1.75rem;
  }

  .hero-section p {
    font-size: 1rem;
    max-width: 95%;
  }

  .who-we-are-section,
  .our-products-section {
    flex-direction: column !important;
    text-align: center;
  }

  .who-we-are-section .col-md-6,
  .our-products-section .col-md-6 {
    max-width: 100%;
    padding: 0 !important;
  }

  .who-we-are-section img,
  .our-products-section img {
    margin-bottom: 1rem;
  }

  /* Make cards inside Why Choose Us stack vertically */
  .row.justify-content-center.mb-4 > div {
    max-width: 100% !important;
  }

  /* Newsletter input and button full width stack */
  .newsletter-signup input,
  .newsletter-signup button {
    width: 100%;
    max-width: none;
    margin: 0 0 0.7rem 0;
  }

  #searchForm {
    flex-wrap: wrap;
  }

  #searchForm input {
    flex: 1 1 100%;
    margin-bottom: 0.5rem;
  }

  #searchForm button {
    flex: 1 1 100%;
  }
}

/* Small Devices (Tablets) ≥576px and <768px */
@media (min-width: 576px) and (max-width: 767.98px) {
  .hero-section {
    min-height: 400px;
  }

  .hero-section h2 {
    font-size: 2.25rem;
  }

  .hero-section p {
    font-size: 1.1rem;
  }

  .who-we-are-section p,
  .our-products-section p {
    font-size: 1.1rem;
  }

  /* Stack cards in Why Choose Us two per row */
  .row.justify-content-center.mb-4 > div {
    max-width: 48% !important;
  }
}

/* Medium Devices (Laptops) ≥768px and <992px */
@media (min-width: 768px) and (max-width: 991.98px) {
  .hero-section {
    min-height: 450px;
    padding: 3rem 2rem;
  }

  .hero-section h2 {
    font-size: 2.75rem;
  }

  .hero-section p {
    font-size: 1.2rem;
  }

  /* Three cards in Why Choose Us side by side */
  .row.justify-content-center.mb-4 > div {
    max-width: 31% !important;
  }

  /* Make sure images scale nicely */
  .who-we-are-section img,
  .our-products-section img {
    width: 100%;
    height: auto;
  }
}

/* Large Devices (Desktops) ≥992px */
@media (min-width: 992px) {
  .hero-section {
    min-height: 500px;
    padding: 4rem 3rem;
  }

  .hero-section h2 {
    font-size: 3rem;
  }

  .hero-section p {
    font-size: 1.3rem;
  }
}
