
/* ===== CSS Variables ===== */
:root {
  /* Light Mode */
  --primary: #3a5ba0;
  --primary-dark: #2c3f66;
  --secondary: #10b981;
  --accent: #e76f51;
  --light: #f5f7fa;
  --dark: #1e293b;
  --gray: #cbd5e1;
  --white: #ffffff;
  --black: #000000;
  --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.15);
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 12px;
  --max-width: 1200px;
  --nav-height: 80px;
  --font-primary: "Inter", system-ui, sans-serif;
}

/* ===== Base Styles ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--dark);
  background-color: var(--light);
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--gray);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
h4 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

p {
  font-size: clamp(1rem, 2vw, 1.1rem);
  margin-bottom: 1.5rem;
  color: var(--dark);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* ===== Utility Classes ===== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
 
}

.section {
  padding: 6rem 0;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  margin-top: 2rem;
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-title {
  text-align: center;
  margin-bottom: 4rem;
  position: relative;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.6s ease, opacity 0.6s ease;
}

.section-title.visible {
  transform: scale(1);
  opacity: 1;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80px;
  height: 4px;
  background: var(--secondary);
  border-radius: 2px;
  transition: transform 0.6s ease 0.3s;
}

.section-title.visible::after {
  transform: translateX(-50%) scaleX(1);
}

.text-center { text-align: center; }

.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  background: var(--secondary);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.4s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  background: var(--primary);
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-hover);
}

.btn-accent {
  background: var(--accent);
}

.btn-accent:hover {
  background: #c0392b;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--secondary);
  color: var(--secondary);
}

.btn-outline:hover {
  background: var(--secondary);
  color: var(--white);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--primary);
  color: var(--white);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 1000;
  transform: scale(0.8);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-3px) scale(1.1);
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--dark);
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle:hover {
  color: var(--secondary);
  transform: rotate(360deg);
}

/* ===== Header & Navigation ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--white);
  box-shadow: var(--shadow);
  transition: var(--transition);
  height: var(--nav-height);
  z-index: 1001;
}

.header-scrolled {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--nav-height);
  overflow: visible;
  position: relative;
  z-index: 1002;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.6s ease 0.2s, opacity 0.6s ease 0.2s;
}

.logo.visible {
  transform: translateY(0);
  opacity: 1;
}

.logo-img {
  height: 70px;
  width: auto;
  transition: transform 0.4s ease;
}

.logo:hover .logo-img {
  transform: scale(1.1);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text h1 {
  font-size: 1.1rem;
  margin-bottom: 0;
  color: var(--primary);
}

.logo-text span {
  font-size: 1.1rem;
  color: var(--secondary);
  font-weight: 500;
}

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

.nav-links > li { 
  position: relative;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  z-index: 1000;
}

.nav-links > li:nth-child(1) { transition-delay: 0.1s; }
.nav-links > li:nth-child(2) { transition-delay: 0.2s; }
.nav-links > li:nth-child(3) { transition-delay: 0.3s; }
.nav-links > li:nth-child(4) { transition-delay: 0.4s; }
.nav-links > li:nth-child(5) { transition-delay: 0.5s; }
.nav-links > li:nth-child(6) { transition-delay: 0.6s; }
.nav-links > li:nth-child(7) { transition-delay: 0.7s; }
.nav-links > li:nth-child(8) { transition-delay: 0.8s; }

.nav-links.visible > li {
  opacity: 1;
  transform: translateY(0);
}

.nav-links a {
  font-weight: 600;
  color: var(--dark);
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.nav-links a i {
  font-size: 0.9rem;
  color: var(--dark);
  transition: var(--transition);
}

.nav-links a:hover i,
.nav-links .current a i {
  color: var(--secondary);
  transform: scale(1.2);
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary);
  transition: width 0.4s ease;
}

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

.nav-links .current a { color: var(--secondary); }

.dropdown {
  position: relative;
}
.dropdown-content {
  position: absolute;
  top: 100%; /* Position below the parent link */
  left: 0;
  background: var(--white);
  min-width: 220px;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease, visibility 0s ease 0.4s; /* Delay visibility transition */
  z-index: 1003; /* Higher z-index to ensure it appears above everything */
  padding: 0.5rem 0;
}


.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
opacity: 1;
visibility: visible;
transform: translateY(0);
transition: opacity 0.4s ease, transform 0.4s ease, visibility 0s ease; /* Remove visibility delay on show */
}

.dropdown-content a {
  display: block;
  padding: 0.8rem 1.5rem;
  color: var(--dark);
  transition: var(--transition);
}

.dropdown-content a:hover,
.dropdown-content a:focus {
  background: var(--light);
  color: var(--secondary);
  padding-left: 1.8rem;
  transform: translateX(5px);
}

.dropdown-content a i { color: var(--dark); }

.dropdown-content a:hover i,
.dropdown-content a:focus i {
  color: var(--secondary);
}

.hamburger {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary);
  transition: transform 0.4s ease;
}

.hamburger:hover {
  transform: rotate(90deg);
}

/* Mobile Menu Backdrop */
.nav-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.nav-backdrop.active {
  display: block;
  opacity: 1;
}

/* ===== Enhanced Image Gallery Styles ===== */
.gallery-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 0.5rem;
}

/* Updated Card with improved dimensions */
.gallery-card {
  position: relative;
  width: 100%;
  aspect-ratio: 3/2;
  min-height: 300px;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
  background: var(--white);
}

/* Improved image container */
.gallery-img-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Optimized image display */
.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease;
}

/* Hover effects */
.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

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

/* Caption styles */
.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: white;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  text-align: center;
}

.gallery-card:hover .gallery-caption {
  transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
  
  .gallery-card {
    min-height: 250px;
  
}

.nav-links {
  position: fixed;
  top: var(--nav-height);
  left: -100%;
  width: 80%;
  max-width: 100%;
  height: calc(100vh - var(--nav-height));
  background: var(--white);
  flex-direction: column;
  align-items: flex-start;
  padding: 2rem;
  gap: 1rem;
  transition: left 0.4s ease;
  box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.nav-links.active {
  left: 0;
}

.nav-links > li {
  opacity: 1;
  transform: translateY(0);
  transition: none;
}

.dropdown-content {
  position: static;
  opacity: 1;
  visibility: visible;
  box-shadow: none;
  background: rgba(0, 0, 0, 0.02);
  display: none;
  margin-left: 1rem;
  margin-top: 0.5rem;
}

.dropdown.active .dropdown-content {
  display: block;
}

.hamburger {
  display: block;
}

.theme-toggle {
  margin-left: 1rem;
}
}
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.2rem;
  }
  
  .gallery-card {
    aspect-ratio: 1/1;
    min-height: 260px;
  }
}

@media (max-width: 576px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .gallery-card {
    aspect-ratio: 16/9;
    max-height: 300px;
    min-height: auto;
  }
}

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-content {
  position: relative;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
}

.lightbox-img {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.lightbox-caption {
  color: var(--white);
  text-align: center;
  margin-top: 1.5rem;
}

.lightbox-caption h3 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: var(--white);
}

.lightbox-caption p {
  opacity: 0.8;
  max-width: 600px;
  margin: 0 auto;
  font-size: 1rem;
  color: var(--white);
}

.close-lightbox {
  position: absolute;
  top: 30px;
  right: 30px;
  color: var(--white);
  font-size: 2.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.close-lightbox:hover {
  color: var(--secondary);
  transform: scale(1.2);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--white);
  font-size: 3rem;
  cursor: pointer;
  padding: 0 1.5rem;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.lightbox-nav:hover {
  color: var(--secondary);
  transform: translateY(-50%) scale(1.2);
  background: rgba(255, 255, 255, 0.4);
}

.prev-lightbox {
  left: 20px;
}

.next-lightbox {
  right: 20px;
}

/* Lightbox responsive fixes */
@media (max-width: 768px) {
  .lightbox-content {
    width: 95%;
    padding: 20px 0;
  }
  
  .lightbox-img {
    max-height: 60vh;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    display: block;
  }
  
  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 1.8rem;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1001;
  }
  
  .prev-lightbox {
    left: 5px;
  }
  
  .next-lightbox {
    right: 5px;
  }
  
  .close-lightbox {
    top: 10px;
    right: 10px;
    font-size: 2rem;
    background: rgba(0, 0, 0, 0.7);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
  }
  
  .lightbox-caption {
    margin-top: 1rem;
    padding: 0 15px;
  }
  
  .lightbox-caption h3 {
    font-size: 1.3rem;
  }
  
  .lightbox-caption p {
    font-size: 0.9rem;
  }
}

/* ===== Footer ===== */
.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 	2.5rem;
  margin-bottom: 4rem;
}

.footer-column {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.footer-column:nth-child(1) { transition-delay: 0.1s; }
.footer-column:nth-child(2) { transition-delay: 0.2s; }
.footer-column:nth-child(3) { transition-delay: 0.3s; }
.footer-column:nth-child(4) { transition-delay: 0.4s; }

.footer-column.visible {
  opacity: 1;
  transform: translateY(0);
}

footer {
  background: var(--primary);
  color: var(--white);
  padding: 4rem 0 2rem;
}

.footer-column p {
  color: rgba(255, 255, 255, 0.7);
}

.footer-column h3 {
  color: var(--white);
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 10px;
}

.footer-column h3::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 2px;
  background: var(--secondary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.footer-column.visible h3::after {
  transform: scaleX(1);
}

.footer-links { list-style: none; }

.footer-links li { margin-bottom: 0.8rem; }

.footer-links a {
  color: #bdc3c7;
  transition: var(--transition);
}

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

.contact-info { list-style: none; }

.contact-info li {
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}

.contact-info i {
  margin-top: 3px;
  color: var(--secondary);
  transition: transform 0.4s ease;
}

.contact-info li:hover i {
  transform: scale(1.2);
}

.social {
  display: flex;
  gap: 25px;
}

.social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--dark);
  color: var(--dark);
  font-size: 1.3rem;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.social a:nth-child(1) { color: #3b5998; }
.social a:nth-child(2) { color: #1da1f2; }
.social a:nth-child(3) { color: #e1306c; }
.social a:nth-child(4) { color: #25d366; }

.social a:hover,
.social a:focus {
  transform: translateY(-5px) scale(1.1);
  box-shadow: var(--shadow-hover);
}

.social a:nth-child(1):hover,
.social a:nth-child(1):focus { background: #3b5998; color: white; }
.social a:nth-child(2):hover,
.social a:nth-child(2):focus { background: #1da1f2; color: white; }
.social a:nth-child(3):hover,
.social a:nth-child(3):focus { background: #e1306c; color: white; }
.social a:nth-child(4):hover,
.social a:nth-child(4):focus { background: #25d366; color: white; }

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease 0.5s, transform 0.6s ease 0.5s;
}

.footer-bottom.visible {
  opacity: 1;
  transform: translateY(0);
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.7);
}

.tech-badge {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid #03fa6e;
  border-radius: 4px;
  background: rgba(0, 10, 20, 0.4);
  backdrop-filter: blur(4px);
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tech-badge span {
  font-size: 0.7em;
  color: #03fa6e;
  display: block;
}

.tech-badge strong {
  font-size: 0.9em;
  color: white;
  font-weight: 500;
}

.tech-badge:hover {
  background: rgba(0, 243, 255, 0.1);
  color: #03fa6e;
}
/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Mobile Styles ===== */
@media (max-width: 1138px) {
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: -100%;
    width: 80%;
    max-width: 100%;
    height: calc(100vh - var(--nav-height));
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem;
    gap: 1rem;
    transition: left 0.4s ease;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }

  .nav-links.active {
    left: 0;
  }

  .nav-links > li {
    opacity: 1;
    transform: translateY(0);
    transition: none;
  }

  .dropdown-content {
    position: static;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.02);
    display: none;
    margin-left: 1rem;
    margin-top: 0.5rem;
  }

  .dropdown.active .dropdown-content {
    display: block;
  }

  .hamburger {
    display: block;
  }

  .theme-toggle {
    margin-left: 1rem;
  }
}

@media (max-width: 768px) {
  .section { padding: 4rem 0; }

  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
