/* Reset default browser style */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  will-change: transform, opacity;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

/* HEADER STYLES */
header {
  background: #000;
  padding: 15px 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.nav-left, .nav-right {
  display: flex;
  gap: 30px;
  flex: 1;
}

.nav-left {
  justify-content: flex-start;
}

.nav-right {
  justify-content: flex-end;
}

.logo {
  flex: 0 0 auto;
  margin: 0 20px;
}

.navbar a {
  color: #fff;
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  transition: color 0.3s;
}

.navbar a:hover {
  color: #c8102e;
}

.logo img {
  max-width: 180px;
  height: auto;
}

.burger-menu {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
}

/* KEYFRAME ANIMATIONS */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes glow {
  0% {
    text-shadow: 0 0 5px #c8102e;
  }
  50% {
    text-shadow: 0 0 20px #c8102e, 0 0 30px #c8102e;
  }
  100% {
    text-shadow: 0 0 5px #c8102e;
  }
}

@keyframes shine {
  0% { left: -100%; }
  100% { left: 100%; }
}

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

@keyframes pulse {
  0% {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  }
  50% {
    box-shadow: 0 8px 25px rgba(200, 16, 46, 0.2);
  }
  100% {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* HERO TITLE WITH ENHANCED ANIMATIONS */
.services-hero {
  background: url('/image/bg\ home.png') center/cover no-repeat;
  text-align: center;
  padding: 80px 20px;
  position: relative;
  overflow: hidden;
}

/* Animated background overlay */
.services-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  animation: shine 4s ease-in-out infinite;
}

.services-hero h1 {
  color: #fff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 50px;
  letter-spacing: 2px;
  position: relative;
  z-index: 2;
  background: linear-gradient(45deg, #fff, #c8102e, #fff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 1s ease-out, gradientShift 3s ease infinite;
}

/* SERVICES CONTAINER WITH STAGGER ANIMATION */
.services-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 80px 40px;
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  color: #000;
  gap: 30px;
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.3s forwards;
}

/* SERVICE BOX WITH AMAZING ANIMATIONS */
.service-box {
  flex: 1 1 350px;
  max-width: 400px;
  border: 1px solid #ddd;
  padding: 40px 30px;
  margin: 10px;
  text-align: center;
  background: linear-gradient(135deg, #fff 0%, #fafafa 100%);
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Stagger animation for each box */
.service-box:nth-child(1) {
  animation: slideInFromBottom 0.8s ease-out 0.6s forwards, cardFloat 4s ease-in-out 1.5s infinite;
}

.service-box:nth-child(2) {
  animation: slideInFromBottom 0.8s ease-out 0.8s forwards, cardFloat 4s ease-in-out 1.7s infinite;
}

.service-box:nth-child(3) {
  animation: slideInFromBottom 0.8s ease-out 1.0s forwards, cardFloat 4s ease-in-out 1.9s infinite;
}

/* Hover effects */
.service-box:hover {
  transform: translateY(-15px) scale(1.02);
  box-shadow: 0 15px 35px rgba(200, 16, 46, 0.2);
  border-color: #c8102e;
  background: linear-gradient(135deg, #fff 0%, #fff8f8 100%);
}

/* Animated border on hover */
.service-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 15px;
  padding: 2px;
  background: linear-gradient(45deg, #c8102e, #ff4d6d, #c8102e);
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: subtract;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.service-box:hover::before {
  opacity: 1;
}

/* SERVICE BOX HEADING ANIMATIONS */
.service-box h2 {
  color: #c8102e;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  margin-bottom: 20px;
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
}

.service-box h2::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #c8102e, transparent);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.service-box:hover h2 {
  transform: translateY(-5px);
  text-shadow: 0 0 10px rgba(200, 16, 46, 0.3);
}

.service-box:hover h2::after {
  width: 80%;
}

/* SERVICE BOX PARAGRAPH ANIMATIONS */
.service-box p {
  font-size: 17px;
  font-family: 'Poppins', sans-serif;
  line-height: 1.8;
  transition: all 0.3s ease;
  position: relative;
}

.service-box:hover p {
  color: #333;
  transform: translateY(5px);
}

/* FOOTER STYLES */
footer {
  background: #000;
  color: #fff;
  padding: 40px 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  gap: 30px;
}
footer img {
  max-width: 160px;
  margin-bottom: 10px;
}
footer p {
  margin: 5px 0;
  font-family: 'Poppins', sans-serif;
}
.footer-left {
  flex: 1;
}
.footer-right {
  flex: 1;
  text-align: right;
}

/* Biar main content dorong footer ke bawah */
main {
  flex: 1;
}

/* Footer tetap di bawah */
footer {
  margin-top: auto;
}

/* ===== MEDIA QUERIES UNTUK RESPONSIVITAS ===== */

/* Tablet (lebar maksimal 1024px) */
@media (max-width: 1024px) {
  .services-hero h1 {
    font-size: 40px;
  }
  
  .services-container {
    padding: 60px 30px;
  }
  
  .nav-left, .nav-right {
    gap: 20px;
  }
}

/* Mobile (lebar maksimal 768px) */
@media (max-width: 768px) {
  /* Header dan Navigasi */
  .nav-left, .nav-right {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background: #000;
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    gap: 0;
  }
  
  .nav-left.active, .nav-right.active {
    display: flex;
    animation: slideDown 0.3s ease forwards;
  }
  
  .nav-left {
    top: 70px;
  }
  
  .nav-right {
    top: 220px;
  }
  
  .navbar a {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    width: 100%;
    display: block;
    text-align: center;
  }
  
  /* Tombol Burger */
  .burger-menu {
    display: block;
  }
  
  /* Atur ulang tata letak navbar untuk mobile */
  .navbar {
    justify-content: space-between;
  }
  
  .logo {
    margin: 0;
    order: -1;
  }
  
  .nav-left, .nav-right {
    flex: none;
  }
  
  /* Hero Section */
  .services-hero {
    padding: 60px 20px;
  }
  
  .services-hero h1 {
    font-size: 36px;
  }
  
  /* Services Container */
  .services-container {
    padding: 40px 20px;
    gap: 20px;
  }
  
  .service-box {
    max-width: 100%;
    margin: 10px 0;
    padding: 30px 20px;
  }
  
  .service-box:hover {
    transform: translateY(-5px) scale(1.01);
  }
  
  .service-box h2 {
    font-size: 24px;
  }
  
  .service-box p {
    font-size: 16px;
  }
  
  /* Footer */
  footer {
    flex-direction: column;
    text-align: center;
    padding: 30px 20px;
    gap: 20px;
  }
  
  .footer-right {
    text-align: center;
    margin-top: 20px;
  }
  
  .footer-center {
    margin: 15px 0;
  }
  
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Mobile Kecil (lebar maksimal 480px) */
@media (max-width: 480px) {
  .services-hero h1 {
    font-size: 32px;
  }
  
  .services-container {
    padding: 30px 15px;
  }
  
  .service-box {
    padding: 25px 15px;
  }
  
  .service-box h2 {
    font-size: 22px;
  }
  
  .service-box p {
    font-size: 15px;
  }
  
  .nav-left, .nav-right {
    padding: 15px;
  }
  
  .nav-right {
    top: 210px;
  }
}

/* Performance optimizations */
.service-box {
  will-change: transform, box-shadow;
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Preload animations */
.services-container,
.service-box {
  animation-fill-mode: both;
}