:root {
  --primary-red: #e63946;
  --primary-blue: #1d3557;
  --light-blue: #457b9d;
  --background-light: #f8f9fa;
  --text-light: #212529;
  --text-secondary-light: #6c757d;
  --card-bg-light: #ffffff;
  --border-light: #dee2e6;

  --background-dark: #121212;
  --text-dark: #f8f9fa;
  --text-secondary-dark: #adb5bd;
  --card-bg-dark: #1e1e1e;
  --border-dark: #2d2d2d;
}

body {
  font-family: "Roboto", sans-serif;
  transition: background-color 0.3s, color 0.3s;
  scroll-behavior: smooth;
  padding-top: 76px; /* Adjusted for fixed navbar */
}

body.light-mode {
  background-color: var(--background-light);
  color: var(--text-light);
}

body.dark-mode {
  background-color: var(--background-dark);
  color: var(--text-dark);
}

h1,
h2,
h3,
h4,
h5,
h6,
.nav-link {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
}

.navbar {
  padding: 1rem 0;
  transition: all 0.3s ease;
}

.navbar.light-mode {
  background-color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar.dark-mode {
  background-color: #1a1a1a !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary-red);
}

.nav-link {
  font-weight: 500;
  margin: 0.5rem;
  position: relative;
  transition: all 0.3s ease;
  display: block;
  padding: 0.5rem 1rem;
}

.light-mode .nav-link {
  color: var(--primary-blue);
}

.dark-mode .nav-link {
  color: #ffffff;
}

.nav-link:hover {
  color: var(--primary-red) !important;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  background-color: var(--primary-red);
  bottom: -3px;
  left: 0;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.btn-primary {
  background-color: var(--primary-red);
  border-color: var(--primary-red);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: #d62b39;
  border-color: #d62b39;
  transform: translateY(-2px);
}

.btn-outline-primary {
  color: var(--primary-red);
  border-color: var(--primary-red);
  transition: all 0.3s ease;
}

.btn-outline-primary:hover {
  background-color: var(--primary-red);
  color: white;
  transform: translateY(-2px);
}

.hero-section {
  padding: 8rem 0;
  position: relative;
  overflow: hidden;
  color: white;
}

.light-mode .hero-section {
  background-color: var(--primary-blue);
}

.dark-mode .hero-section {
  background-color: #0a0a0a;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.9);
}

.section-title {
  position: relative;
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  display: inline-block;
}

.section-title::after {
  content: "";
  position: absolute;
  width: 50%;
  height: 3px;
  background-color: var(--primary-red);
  bottom: 0;
  left: 0;
}

.about-section,
.services-section,
.portfolio-section,
.testimonials-section,
.contact-section {
  padding: 6rem 0;
}

.service-card,
.portfolio-card,
.testimonial-card {
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.3s ease;
  height: 100%;
  border: none;
}

.light-mode .service-card,
.light-mode .portfolio-card,
.light-mode .testimonial-card {
  background-color: var(--card-bg-light);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.dark-mode .service-card,
.dark-mode .portfolio-card,
.dark-mode .testimonial-card {
  background-color: var(--card-bg-dark);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.service-card:hover,
.portfolio-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.service-icon {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary-red);
}

.portfolio-card img {
  transition: all 0.5s ease;
}

.portfolio-card:hover img {
  transform: scale(1.05);
}

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(29, 53, 87, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
}

.portfolio-card:hover .portfolio-overlay {
  opacity: 1;
}

.testimonial-card {
  padding: 2rem;
  margin: 1rem 0;
}

.testimonial-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
}

.testimonial-quote {
  font-style: italic;
  margin-bottom: 1rem;
}

.light-mode .testimonial-quote {
  color: var(--text-secondary-light);
}

.dark-mode .testimonial-quote {
  color: var(--text-secondary-dark);
}

.contact-info-item {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.contact-icon {
  font-size: 1.5rem;
  margin-right: 1rem;
  color: var(--primary-red);
}

.form-control {
  padding: 0.75rem 1rem;
  border-radius: 5px;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.light-mode .form-control {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-light);
}

.dark-mode .form-control {
  background-color: #2d2d2d;
  border: 1px solid var(--border-dark);
  color: var(--text-dark);
}

.dark-mode .form-control::placeholder {
  color: var(--text-dark);
}

.form-control:focus {
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.25);
}

.light-mode .form-control:focus {
  border-color: var(--primary-red);
}

.dark-mode .form-control:focus {
  border-color: var(--primary-red);
}

footer {
  padding: 3rem 0;
  color: white;
}

.light-mode footer {
  background-color: var(--primary-blue);
}

.dark-mode footer {
  background-color: #0a0a0a;
}

.footer-link {
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
  text-decoration: none;
  margin: 0 0.5rem;
}

.footer-link:hover {
  color: white;
}

.social-icon {
  font-size: 1.5rem;
  margin: 0 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
}

.social-icon:hover {
  color: white;
  transform: translateY(-3px);
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary-blue);
}

input:checked + .slider:before {
  transform: translateX(30px);
}

.theme-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  color: #f8f9fa;
  font-size: 0.8rem;
}

.sun-icon {
  left: 8px;
}

.moon-icon {
  right: 8px;
}

.login-btn {
  margin-top: 1rem;
  width: 100%;
}

/* Hero pattern overlay */
.hero-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

/* Modal styles */
.modal-content {
  border-radius: 10px;
  overflow: hidden;
  border: none;
}

.light-mode .modal-content {
  background-color: var(--card-bg-light);
}

.dark-mode .modal-content {
  background-color: var(--card-bg-dark);
  color: var(--text-dark);
}

.modal-header {
  border-bottom: none;
  padding: 2rem 2rem 1rem;
}

.modal-body {
  padding: 1rem 2rem;
}

.modal-footer {
  border-top: none;
  padding: 2rem 0rem 1rem;
}

.light-mode .modal-header .btn-close {
  filter: none;
}

.dark-mode .modal-header .btn-close {
  filter: invert(1);
}

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

.animate-fadeInUp {
  animation: fadeInUp 0.5s ease forwards;
}

.delay-100 {
  animation-delay: 0.1s;
}
.delay-200 {
  animation-delay: 0.2s;
}
.delay-300 {
  animation-delay: 0.3s;
}
.delay-400 {
  animation-delay: 0.4s;
}
.delay-500 {
  animation-delay: 0.5s;
}

/* Offcanvas Menu Styles */
.offcanvas {
  transition: transform 0.3s ease-in-out;
}

.light-mode .offcanvas {
  background-color: #ffffff;
}

.dark-mode .offcanvas {
  background-color: #1a1a1a;
  color: var(--text-dark);
}

.offcanvas-header {
  padding: 1.5rem;
  border-bottom: 1px solid;
}

.light-mode .offcanvas-header {
  border-color: var(--border-light);
}

.dark-mode .offcanvas-header {
  border-color: var(--border-dark);
}

.offcanvas-title {
  font-weight: 700;
  color: var(--primary-red);
}

.offcanvas-body {
  padding: 1.5rem;
}

.offcanvas-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.offcanvas-nav .nav-item {
  margin-bottom: 0.5rem;
}

.offcanvas-nav .nav-link {
  font-size: 1.1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid;
  margin: 0;
  display: block;
}

.light-mode .offcanvas-nav .nav-link {
  border-color: var(--border-light);
}

.dark-mode .offcanvas-nav .nav-link {
  border-color: var(--border-dark);
}

.offcanvas-nav .nav-link:last-child {
  border-bottom: none;
}

.offcanvas-footer {
  padding: 1.5rem;
  border-top: 1px solid;
  position: absolute;
  bottom: 0;
  width: 100%;
}

.light-mode .offcanvas-footer {
  border-color: var(--border-light);
}

.dark-mode .offcanvas-footer {
  border-color: var(--border-dark);
}

.menu-toggle-btn {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: all 0.3s ease;
  display: none; /* Hide by default, show only on mobile */
}

.light-mode .menu-toggle-btn {
  color: var(--primary-blue);
}

.dark-mode .menu-toggle-btn {
  color: var(--text-dark);
}

.menu-toggle-btn:hover {
  color: var(--primary-red);
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .hero-title {
    font-size: 2.5rem;
  }
  .hero-subtitle {
    font-size: 1.2rem;
  }
}

@media (max-width: 768px) {
  .hero-section {
    padding: 6rem 0;
  }
  .about-section,
  .services-section,
  .portfolio-section,
  .testimonials-section,
  .contact-section {
    padding: 4rem 0;
  }
  .section-title {
    font-size: 1.8rem;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 2rem;
  }
  .hero-subtitle {
    font-size: 1rem;
  }
  .theme-switch-container {
    margin-top: 1rem;
  }
}

/* Show mobile menu toggle only on mobile */
@media (max-width: 991px) {
  .menu-toggle-btn {
    display: block;
  }
  .desktop-menu {
    display: none;
  }
}
