/**
 * Baheera Project Management Website - Main Stylesheet
 * Modern, responsive design with mobile-first approach
 */

/* ============================================================================
   CSS VARIABLES
   ============================================================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #3b82f6;
  --secondary: #10b981;
  --secondary-dark: #059669;
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --dark: #1f2937;
  --dark-light: #374151;
  --light: #f9fafb;
  --light-gray: #f3f4f6;
  --text: #374151;
  --text-light: #6b7280;
  --white: #ffffff;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
  max-width: 100%;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  padding: 0;
}

/* Touch-friendly elements */
button,
a,
.btn,
input,
textarea,
select {
  -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
  touch-action: manipulation;
}

/* Responsive images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

section,
nav,
.hero-content,
.footer-content {
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
  /* Prevent horizontal scroll */
  html,
  body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
  }

  /* Better table handling */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Improved image loading */
  img {
    max-width: 100%;
    height: auto;
    display: block;
  }

  /* Better text wrapping */
  h1, h2, h3, h4, h5, h6 {
    word-wrap: break-word;
    hyphens: auto;
  }

  /* Improved button spacing */
  .cta-buttons {
    gap: 0.75rem;
  }

  /* Better card shadows on mobile */
  .service-card,
  .project-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  /* Improved navigation */
  header {
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  /* Better hero background on mobile */
  .hero::after {
    display: none; /* Hide animated background on mobile for performance */
  }
}

/* ============================================================================
   HEADER & NAVIGATION
   ============================================================================ */

header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  width: 100%;
}

header.scrolled {
  box-shadow: var(--shadow-md);
  background: rgba(255, 255, 255, 0.98);
}

nav {
  width: 100%;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 3rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  transition: transform 0.3s ease;
  display: inline-block;
}

.logo:hover {
  transform: scale(1.05);
}

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

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.5rem 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

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

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  margin-left: auto;
  padding: 10px;
  z-index: 1001;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.mobile-menu-toggle:active {
  opacity: 0.7;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--dark);
  transition: all 0.3s ease;
  display: block;
  pointer-events: none;
}

/* ============================================================================
   HERO SECTION
   ============================================================================ */

.hero {
  background: url('../images/part-male-construction-worker.jpg') center/cover;
  background-size: cover;
  background-position: center;
  color: var(--white);
  padding: 5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  min-height: 60vh;
  max-height: 70vh;
  height: auto;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  margin: 0;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('../images/part-male-construction-worker.jpg') center/cover;
  background-size: cover;
  background-position: center;
  opacity: 1;
  z-index: 0;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 50%, rgba(240, 147, 251, 0.3) 100%);
  z-index: 1;
  overflow: hidden;
}

@keyframes moveBackground {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

.hero-content {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  padding: 0 2rem;
  box-sizing: border-box;
  overflow: hidden;
  overflow-x: hidden;
  overflow-y: hidden;
}

.hero h1 {
  font-size: 4rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.8s ease;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1.375rem;
  margin-bottom: 2.5rem;
  opacity: 0.95;
  animation: fadeInUp 1s ease;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 1.2s ease;
}

.btn {
  padding: 1rem 2.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* ============================================================================
   SECTIONS & TYPOGRAPHY
   ============================================================================ */

section {
  padding: 5rem 2rem;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Hero section specific - prevent scrollbars */
section.hero {
  overflow: hidden !important;
  overflow-y: hidden !important;
  overflow-x: hidden !important;
  position: relative;
}

/* Ensure no scrollbar appears on page load */
html:not(.no-scroll),
body:not(.no-scroll) {
  overflow-x: hidden;
}

/* Prevent horizontal scroll on hero specifically */
.hero,
.hero * {
  max-width: 100vw;
  box-sizing: border-box;
}

/* ============================================================================
   BANNER SCROLLER (Services main banner)
   ============================================================================ */

.banner-scroller {
  position: relative;
  width: 100%;
  max-width: 100vw;
  min-height: 60vh;
  max-height: 70vh;
  overflow: hidden;
  box-sizing: border-box;
  border: none;
  outline: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

.banner-scroller-track {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 60vh;
  max-height: 70vh;
}

.banner-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 60vh;
  max-height: 70vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #111;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  z-index: 0;
}

.banner-slide.active {
  opacity: 1;
  z-index: 1;
}

.banner-slide-caption {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.5);
  color: var(--white);
  font-size: 0.9rem;
  border-radius: 0.5rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.banner-slide.active .banner-slide-caption {
  opacity: 1;
}

/* Light neutral overlay so images show correctly; only darkens slightly for text readability */
.banner-scroller-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.4) 100%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.banner-scroller-overlay .hero-content {
  pointer-events: auto;
  color: var(--white);
  text-align: center;
  padding: 0 2rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.banner-scroller-overlay .hero-content h1 {
  color: var(--white);
  -webkit-text-fill-color: var(--white);
  background: none;
  background-clip: unset;
}

.banner-scroller-overlay .hero-content p {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.banner-scroller-prev,
.banner-scroller-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 3rem;
  height: 3rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.banner-scroller-prev:hover,
.banner-scroller-next:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-50%) scale(1.05);
}

.banner-scroller-prev {
  left: 1rem;
}

.banner-scroller-next {
  right: 1rem;
}

.banner-scroller-dots {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 0.5rem;
}

.banner-scroller-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.banner-scroller-dot:hover {
  background: rgba(255, 255, 255, 0.8);
}

.banner-scroller-dot.active {
  background: var(--white);
  transform: scale(1.25);
}

@media (max-width: 768px) {
  .banner-scroller,
  .banner-scroller-track,
  .banner-slide {
    min-height: 50vh;
    max-height: 60vh;
  }
  .banner-scroller-prev,
  .banner-scroller-next {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
  }
  .banner-scroller-prev { left: 0.5rem; }
  .banner-scroller-next { right: 0.5rem; }
}

.section-title {
  text-align: center;
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

/* Override gradient for white text in CTA sections */
.section-title[style*="color: var(--white)"],
.section-title[style*="color:white"],
.section-title[style*="color: white"],
.section-title[style*="color:#fff"],
.section-title[style*="color:#ffffff"],
section[style*="color: var(--white)"] .section-title,
section[style*="color:white"] .section-title,
section[style*="color: white"] .section-title {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: white !important;
  background-clip: unset !important;
  color: white !important;
}

.section-title[style*="color: var(--white)"]::after,
.section-title[style*="color:white"]::after,
.section-title[style*="color: white"]::after,
section[style*="color: var(--white)"] .section-title::after,
section[style*="color:white"] .section-title::after,
section[style*="color: white"] .section-title::after {
  background: rgba(255, 255, 255, 0.5) !important;
}

.section-subtitle {
  text-align: center;
  color: #6b7280;
  font-size: 1.125rem;
  margin-bottom: 3rem;
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.service-card {
  background: var(--white);
  border-radius: 1.5rem;
  padding: 2.5rem;
  box-shadow: var(--shadow);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
  transition: left 0.5s;
}

.service-card:hover::before {
  left: 100%;
}

.service-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: var(--shadow-xl);
  border-color: rgba(102, 126, 234, 0.2);
}

.service-icon {
  width: 90px;
  height: 90px;
  margin: 0 auto 1.5rem;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--white);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.service-card:hover .service-icon {
  transform: rotate(360deg) scale(1.1);
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--dark);
}

.service-card p {
  color: #6b7280;
  line-height: 1.8;
}

/* Hospitality gallery */
.hospitality-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.hospitality-gallery-item {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--light);
}

.hospitality-gallery-item img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.hospitality-gallery-item:hover img {
  transform: scale(1.03);
}

.hospitality-gallery-caption {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--dark);
  background: var(--white);
  text-align: center;
}

/* ============================================================================
   PROJECTS SECTION
   ============================================================================ */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.project-card {
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
}

.project-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.project-card:hover::after {
  opacity: 1;
}

.project-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: var(--shadow-xl);
}

.project-card:hover .project-content {
  transform: translateY(-10px);
}

.project-image {
  width: 100%;
  height: 280px;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .project-image {
  transform: scale(1.1);
}

.project-content {
  padding: 1.5rem;
  position: relative;
  z-index: 2;
  transition: transform 0.4s ease;
}

.project-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.project-card p {
  color: #6b7280;
  margin-bottom: 1rem;
}

.project-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  padding: 0.375rem 1rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  border-radius: 1.5rem;
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 600;
  border: 1px solid rgba(102, 126, 234, 0.2);
  transition: all 0.3s ease;
}

.tag:hover {
  background: var(--gradient-primary);
  color: var(--white);
  transform: scale(1.05);
}

/* ============================================================================
   ABOUT SECTION
   ============================================================================ */

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-top: 3rem;
}

.about-image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  box-shadow: var(--shadow-xl);
}

.about-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 1.5rem;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  object-fit: cover;
  min-height: 500px;
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: 1.5rem;
}

.about-image-wrapper:hover .image-overlay {
  opacity: 1;
}

.about-image-wrapper:hover .about-image {
  transform: scale(1.08);
}

.about-text h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--dark);
}

.about-text p {
  color: #6b7280;
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

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

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  line-height: 1;
}

.stat-label {
  color: #6b7280;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* Contact Form */
.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 3rem;
}

.contact-info {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  padding: 2.5rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(102, 126, 234, 0.1);
  backdrop-filter: blur(10px);
}

.contact-info h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--dark);
}

.contact-item {
  display: flex;
  align-items: start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-icon {
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  flex-shrink: 0;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
}

.contact-item:hover .contact-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.contact-form {
  background: var(--white);
  padding: 2.5rem;
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--dark);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: inherit;
  background: var(--light-gray);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

.form-group textarea {
  resize: vertical;
  min-height: 150px;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

footer {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  color: var(--white);
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.5), transparent);
}

.footer-content {
  width: 100%;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--white);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a {
  position: relative;
}

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}

.footer-links a:hover {
  color: var(--primary-light);
}

.footer-links a:hover::after {
  width: 100%;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

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

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.floating {
  animation: float 3s ease-in-out infinite;
}

.pulsing {
  animation: pulse 2s ease-in-out infinite;
}

.fade-in {
  animation: fadeInUp 0.8s ease;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

/* Tablet and below (1024px) */
@media (max-width: 1024px) {
  nav {
    padding: 1rem 1.5rem;
  }

  .hero h1 {
    font-size: 3.5rem;
  }

  .section-title {
    font-size: 2.5rem;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet (768px) */
@media (max-width: 768px) {
  nav {
    padding: 1rem;
    gap: 2rem;
  }

  .logo {
    font-size: 1.25rem;
  }

  .nav-links {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transition: left 0.3s ease;
    gap: 0;
    z-index: 999;
  }

  .nav-links li {
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  .nav-links a {
    display: block;
    padding: 1rem 0;
    font-size: 1.125rem;
  }

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

  .mobile-menu-toggle {
    display: flex !important;
    z-index: 1001;
    position: relative;
    pointer-events: auto;
    cursor: pointer;
  }

  .hero {
    padding: 4rem 1.5rem;
    min-height: 60vh;
  }

  .hero h1 {
    font-size: 2.25rem;
    line-height: 1.2;
    margin-bottom: 1rem;
  }

  .hero p {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .cta-buttons {
    flex-direction: column;
    width: 100%;
    gap: 1rem;
  }

  .btn {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1rem;
    text-align: center;
  }

  section {
    padding: 3rem 1.5rem;
  }

  .section-title {
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }

  .section-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .about-content,
  .contact-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-image {
    min-height: 300px;
    width: 100%;
  }

  .about-image-wrapper {
    order: -1;
  }

  .about-text h3 {
    font-size: 1.75rem;
  }

  .services-grid,
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .service-card {
    padding: 2rem 1.5rem;
  }

  .service-icon {
    width: 70px;
    height: 70px;
    font-size: 2rem;
  }

  .service-card h3 {
    font-size: 1.25rem;
  }

  .project-card {
    margin-bottom: 1rem;
  }

  .project-image {
    height: 220px;
  }

  .project-content {
    padding: 1.25rem;
  }

  .project-card h3 {
    font-size: 1.25rem;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .stat-number {
    font-size: 2.5rem;
  }

  .stat-label {
    font-size: 0.875rem;
  }

  .contact-info {
    padding: 2rem 1.5rem;
  }

  .contact-form {
    padding: 2rem 1.5rem;
  }

  .contact-item {
    margin-bottom: 1.25rem;
  }

  .contact-icon {
    width: 45px;
    height: 45px;
  }

  .form-group input,
  .form-group textarea {
    padding: 0.875rem;
    font-size: 1rem;
  }

  footer {
    padding: 2.5rem 1.5rem;
  }

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

/* Mobile (480px and below) */
@media (max-width: 480px) {
  nav {
    padding: 0.875rem 1rem;
  }

  .logo {
    font-size: 1.125rem;
  }

  .hero {
    padding: 3rem 1rem;
    min-height: 50vh;
  }

  .hero h1 {
    font-size: 1.875rem;
    margin-bottom: 0.875rem;
  }

  .hero p {
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
  }

  section {
    padding: 2.5rem 1rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .section-subtitle {
    font-size: 0.9375rem;
  }

  .service-card {
    padding: 1.5rem 1rem;
  }

  .service-icon {
    width: 60px;
    height: 60px;
    font-size: 1.75rem;
    margin-bottom: 1rem;
  }

  .service-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
  }

  .service-card p {
    font-size: 0.9375rem;
    line-height: 1.6;
  }

  .project-image {
    height: 200px;
  }

  .project-content {
    padding: 1rem;
  }

  .project-card h3 {
    font-size: 1.125rem;
  }

  .project-card p {
    font-size: 0.9375rem;
  }

  .tag {
    font-size: 0.8125rem;
    padding: 0.25rem 0.75rem;
  }

  .about-text h3 {
    font-size: 1.5rem;
  }

  .about-text p {
    font-size: 0.9375rem;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .contact-info,
  .contact-form {
    padding: 1.5rem 1rem;
  }

  .contact-info h3,
  .contact-form h3 {
    font-size: 1.25rem;
  }

  .btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
  }

  footer {
    padding: 2rem 1rem;
  }

  footer p {
    font-size: 0.875rem;
  }
}

/* Very small mobile (360px and below) */
@media (max-width: 360px) {
  .hero h1 {
    font-size: 1.625rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .service-card,
  .contact-info,
  .contact-form {
    padding: 1.25rem 0.875rem;
  }

  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
  }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    min-height: 50vh;
    padding: 3rem 1.5rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 0.9375rem;
  }

  section {
    padding: 2.5rem 1.5rem;
  }
}

/* Enhanced mobile touch targets */
@media (max-width: 768px) {
  /* Ensure minimum touch target size (44x44px) */
  .btn,
  .mobile-menu-toggle,
  .nav-links a {
    min-height: 44px;
    min-width: 44px;
  }

  /* Better spacing for touch */
  .service-card,
  .project-card {
    margin-bottom: 1.5rem;
  }

  /* Prevent text selection on buttons */
  .btn {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  /* Better form inputs for mobile */
  .form-group input,
  .form-group textarea {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 1rem;
    min-height: 44px;
  }

  /* Prevent zoom on input focus (iOS) */
  @supports (-webkit-touch-callout: none) {
    .form-group input,
    .form-group textarea,
    select {
      font-size: 16px !important;
    }
  }

  /* Better image handling */
  .project-image,
  .about-image {
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  /* Improved card spacing */
  .service-card h3,
  .project-card h3 {
    margin-bottom: 0.75rem;
  }

  /* Better tag spacing */
  .project-tags {
    gap: 0.5rem;
    margin-top: 0.75rem;
  }

  /* Improved stats display */
  .stats {
    gap: 1.5rem;
  }

  .stat-item {
    padding: 1rem;
  }

  /* Better contact items */
  .contact-item {
    padding: 0.5rem 0;
  }

  /* Improved footer */
  footer {
    padding: 2rem 1rem;
  }

  .footer-links a {
    padding: 0.5rem 0;
    display: block;
  }
}

/* Extra small devices (320px and below) */
@media (max-width: 320px) {
  nav {
    padding: 0.75rem 0.875rem;
  }

  .logo {
    font-size: 1rem;
  }

  .hero {
    padding: 2.5rem 0.875rem;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  section {
    padding: 2rem 0.875rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .service-card,
  .contact-info,
  .contact-form {
    padding: 1rem 0.75rem;
  }

  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .service-icon,
  .contact-icon {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */

/* Loading Animation - Elements visible by default for immediate display */
.loading {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Smooth fade-in animation when loaded class is added */
.loading.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================================
   CUSTOM SCROLLBAR
   ============================================================================ */

::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--light-gray);
}

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

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

/* Selection */
::selection {
  background: rgba(102, 126, 234, 0.3);
  color: var(--dark);
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Smooth transitions for all interactive elements */
a, button, input, textarea {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Image optimization */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Enhanced section backgrounds */
section:nth-child(even) {
  background: var(--light);
}

/* Success and Error Messages */
.success-message {
  animation: slideDown 0.3s ease;
}

.error-message {
  animation: slideDown 0.3s ease;
}

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

/* Loading spinner for buttons */
.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.6s linear infinite;
}

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