/* Box-sizing for all elements */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Root Variables for Easy Theming */
:root {
  --primary-color: #BB86FC; /* Soft Purple */
  --secondary-color: #03DAC6; /* Teal */
  --accent-color: #03DAC6; /* Teal */
  --background-color: #121212; /* Almost Black */
  --text-color: #FFFFFF; /* White */
  --footer-background: #1E1E1E; /* Rich Black */
  --footer-text: #BB86FC; /* Soft Purple */
  --card-background: #1E1E1E; /* Rich Black */
  --shadow-color: rgba(0, 0, 0, 0.7);
  --transition-speed: 0.3s;
}

/* Preloader Styles */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--background-color);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  border: 8px solid #333;
  border-top: 8px solid var(--primary-color);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
}

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

/* Body Styles */
body {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  scroll-behavior: smooth;
  background-color: var(--background-color);
}

/* Heading Styles */
h1, h2, h3 {
  font-family: 'Roboto', sans-serif;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header Styles */
header {
  background: rgba(18, 18, 18, 0.9);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.logo {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--primary-color);
  cursor: pointer;
  transition: color var(--transition-speed);
}

.logo:hover {
  color: var(--secondary-color);
}

nav {
  position: relative;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color var(--transition-speed);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0%;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--primary-color);
  transition: width var(--transition-speed);
}

.nav-links a:hover::after,
.nav-links a:focus::after {
  width: 100%;
}

.burger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
}

.burger span {
  width: 25px;
  height: 3px;
  background-color: var(--text-color);
  transition: all var(--transition-speed) ease;
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  background-color: rgba(18, 18, 18, 0.95);
  position: absolute;
  top: 60px;
  right: 0;
  width: 100%;
  box-shadow: 0 8px 16px var(--shadow-color);
}

.mobile-menu.open {
  display: block;
  animation: slideDown 0.5s forwards;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-menu ul {
  list-style: none;
  padding: 1.5rem 2rem;
}

.mobile-menu ul li {
  margin-bottom: 1rem;
}

.mobile-menu ul li a {
  text-decoration: none;
  color: var(--text-color);
  font-size: 1.2rem;
  transition: color var(--transition-speed);
}

.mobile-menu ul li a:hover,
.mobile-menu ul li a:focus {
  color: var(--primary-color);
}

/* Hero Section */
.hero {
  height: 100vh;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  text-align: center;
  padding-top: 60px; /* To offset the fixed header */
  position: relative;
}

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

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 1rem;
}

.hero h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: fadeInDown 1s ease-out forwards;
  opacity: 0;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease-out forwards;
  opacity: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background-color: var(--accent-color);
  color: var(--text-color);
  border: none;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-speed), transform var(--transition-speed);
  animation: fadeInUp 1s ease-out forwards;
  opacity: 0;
}

.btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-3px);
}

.btn i {
  margin-left: 0.5rem;
  transition: transform var(--transition-speed);
}

.btn:hover i {
  transform: translateX(5px);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sections */
.section {
  padding: 6rem 0;
  background-color: var(--background-color);
}

.section:nth-of-type(even) {
  background-color: #1E1E1E; /* Rich Black */
}

.section h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  position: relative;
}

.section h2::after {
  content: '';
  width: 50px;
  height: 4px;
  background-color: var(--secondary-color);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -10px;
}

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

.services .service-card,
.about .about-card {
  background-color: var(--card-background);
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 4px 6px var(--shadow-color);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.services .service-card:hover,
.about .about-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 20px var(--shadow-color);
}

.services .service-card i,
.about .about-card i {
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

/* About Us Section */
.about .about-content {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
}

.about .about-text {
  flex: 1;
  animation: slideInLeft 1s ease-out forwards;
  opacity: 0;
  transform: translateX(-50px);
}

.about .about-image {
  flex: 1;
  text-align: center;
  animation: slideInRight 1s ease-out forwards;
  opacity: 0;
  transform: translateX(50px);
}

@keyframes slideInLeft {
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  to { opacity: 1; transform: translateX(0); }
}

/* Contact Form */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  position: relative;
  margin-bottom: 2rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem 1rem 1rem 0.5rem;
  border: none;
  border-bottom: 2px solid #555;
  background: transparent;
  font-size: 1rem;
  resize: none;
  transition: border-color var(--transition-speed);
  color: var(--text-color);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-bottom-color: var(--secondary-color);
}

.form-group label {
  position: absolute;
  top: 1rem;
  left: 0.5rem;
  font-size: 1rem;
  color: #999;
  pointer-events: none;
  transition: all var(--transition-speed);
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
  top: -0.5rem;
  font-size: 0.8rem;
  color: var(--secondary-color);
  background-color: var(--background-color);
  padding: 0 0.3rem;
}

.contact-form button {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--secondary-color);
  color: var(--text-color);
  border: none;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-speed), transform var(--transition-speed);
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-form button:hover {
  background-color: var(--primary-color);
  transform: translateY(-3px);
}

.contact-form button i {
  margin-left: 0.5rem;
  transition: transform var(--transition-speed);
}

.contact-form button:hover i {
  transform: translateX(5px);
}

/* Footer Styles */
footer {
  width: 100%;
  background-color: var(--footer-background);
  color: var(--footer-text);
  padding: 2rem 0;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-links {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--footer-text);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-speed);
}

.footer-links a:hover,
.footer-links a:focus {
  color: var(--secondary-color);
}

.footer-container p {
  margin: 0;
  font-size: 0.9rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .nav-links {
      display: none;
  }

  .burger {
      display: flex;
  }

  .mobile-menu {
      display: none;
  }

  .mobile-menu.open {
      display: block;
  }

  .about .about-content {
      flex-direction: column;
  }

  .about .about-image {
      margin-top: 2rem;
  }

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

  .footer-links {
      flex-direction: column;
      gap: 1rem;
  }
}
