/* Custom Maritime Styling for PT. Mega Karya Maritim (Mega Karya Group) */
/* Enhanced v2 — Visual Upgrade with Animations & Micro-interactions */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
  --primary-navy: #0a192f;
  --ocean-blue: #0284c7;
  --ocean-dark: #0369a1;
  --marine-accent: #0284c7;
  --gold-accent: #d97706;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
  color: #1e293b;
  background-color: #f8fafc;
  overflow-x: hidden;
}

/* ========================================
   Custom Scrollbar
   ======================================== */
::-webkit-scrollbar {
  width: 9px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #94a3b8, #64748b);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #64748b, #475569);
}

/* ========================================
   Hero Section Gradients & Overlays
   ======================================== */
.hero-gradient {
  background: linear-gradient(135deg, rgba(10, 25, 47, 0.94) 0%, rgba(15, 39, 74, 0.88) 50%, rgba(2, 132, 199, 0.8) 100%);
}

.ocean-mesh {
  background-color: #0b1a30;
  background-image: 
    radial-gradient(at 0% 0%, rgba(14, 165, 233, 0.22) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(30, 64, 175, 0.3) 0px, transparent 50%);
}

/* Maritime wave divider */
.wave-divider {
  position: relative;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}
.wave-divider svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 50px;
}

/* ========================================
   WhatsApp Floating Button Pulsing Effect
   ======================================== */
@keyframes waPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  }
  70% {
    box-shadow: 0 0 0 18px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

.wa-pulse {
  animation: waPulse 2s infinite;
}

/* ========================================
   Card Hover Lift & Glow — Enhanced
   ======================================== */
.card-hover {
  transition: all 0.4s var(--ease-out-expo);
}
.card-hover:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 
    0 25px 50px -12px rgba(2, 132, 199, 0.12), 
    0 12px 20px -8px rgba(2, 132, 199, 0.08);
}

/* ========================================
   Glassmorphism
   ======================================== */
.glass-panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Flag badges */
.flag-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}

/* ========================================
   Scroll-triggered Reveal Animations
   ======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

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

/* Base state for elements before they animate */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-spring);
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays for grid children */
.stagger-1 { transition-delay: 0.05s; }
.stagger-2 { transition-delay: 0.1s; }
.stagger-3 { transition-delay: 0.15s; }
.stagger-4 { transition-delay: 0.2s; }
.stagger-5 { transition-delay: 0.25s; }
.stagger-6 { transition-delay: 0.3s; }

/* ========================================
   Hero Section Specific Animations
   ======================================== */
@keyframes heroFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes heroShine {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes subtlePan {
  0% {
    transform: scale(1.05) translate(0, 0);
  }
  50% {
    transform: scale(1.08) translate(-1%, -1%);
  }
  100% {
    transform: scale(1.05) translate(0, 0);
  }
}

.hero-bg-pan {
  animation: subtlePan 25s ease-in-out infinite;
}

.hero-float {
  animation: heroFloat 4s ease-in-out infinite;
}

/* Gradient text shimmer effect */
.gradient-text {
  background: linear-gradient(90deg, #ffffff 0%, #7dd3fc 30%, #ffffff 50%, #38bdf8 70%, #ffffff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: heroShine 5s linear infinite;
}

/* ========================================
   Enhanced Section Header Decorators
   ======================================== */
.section-tag {
  position: relative;
  display: inline-block;
  padding-left: 1.5rem;
}

.section-tag::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 3px;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: 999px;
}

/* ========================================
   Animated Underline for Navigation
   ======================================== */
#mainHeader > div {
  width: 100%;
  max-width: 90rem;
  padding-inline: 0.5rem;
}

@media (min-width: 640px) {
  #mainHeader > div {
    padding-inline: 1rem;
  }
}

#mainHeader nav,
#mobileMenu nav {
  column-gap: 0.25rem;
  row-gap: 0.25rem;
}

#mainHeader nav a,
#mobileMenu nav a {
  padding: 0.45rem 0.6rem;
  border-radius: 9999px;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

#mainHeader nav a:hover,
#mobileMenu nav a:hover {
  color: #0369a1;
  background-color: #f0f9ff;
}

#mainHeader nav a:focus-visible,
#mobileMenu nav a:focus-visible {
  outline: 2px solid #0284c7;
  outline-offset: 2px;
}

#mainHeader nav a[aria-current="page"],
#mobileMenu nav a[aria-current="page"] {
  color: #075985;
  background-color: #e0f2fe;
  box-shadow: inset 0 0 0 1px rgba(2, 132, 199, 0.12);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: 999px;
  transition: width 0.35s var(--ease-out-expo);
}

.nav-link:hover::after,
.nav-link.text-blue-600::after {
  width: 100%;
}

/* ========================================
   Animated Stats / Counter Numbers
   ======================================== */
.counter-value {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  transition: transform 0.3s var(--ease-spring);
}

/* ========================================
   Interactive Icon Hover Spin  
   ======================================== */
.icon-hover-spin {
  transition: transform 0.5s var(--ease-spring);
}
.card-hover:hover .icon-hover-spin,
.icon-hover-spin:hover {
  transform: rotateY(180deg);
}

/* ========================================
   Decorative Ambient Glow Orbs
   ======================================== */
@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-40px, 30px) scale(1.05); }
  66% { transform: translate(25px, -30px) scale(0.97); }
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.ambient-orb-1 {
  width: 300px;
  height: 300px;
  background: rgba(14, 165, 233, 0.12);
  animation: orbFloat1 15s ease-in-out infinite;
}

.ambient-orb-2 {
  width: 250px;
  height: 250px;
  background: rgba(99, 102, 241, 0.08);
  animation: orbFloat2 18s ease-in-out infinite;
}

/* ========================================
   Tooltip / Badge Glow
   ======================================== */
@keyframes badgePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(14, 165, 233, 0);
  }
}

.badge-glow {
  animation: badgePulse 2.5s ease-in-out infinite;
}

/* ========================================
   Smooth Parallax (for JS-driven transforms)
   ======================================== */
.parallax-slow {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* ========================================
   Image Hover Zoom
   ======================================== */
.img-zoom {
  overflow: hidden;
}
.img-zoom img {
  transition: transform 0.6s var(--ease-out-expo);
}
.img-zoom:hover img {
  transform: scale(1.06);
}

/* ========================================
   Focus Styles for Accessibility
   ======================================== */
input:focus, textarea:focus, select:focus, button:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}

/* ========================================
   Smooth Entrance for WA Card
   ======================================== */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.animate-fade-in {
  animation: fadeSlideUp 0.35s var(--ease-out-expo) both;
}

/* ========================================
   Responsive adjustments
   ======================================== */
@media (max-width: 640px) {
  .hero-title-responsive {
    font-size: 2.15rem;
    line-height: 1.25;
  }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
  .wa-pulse, #waFloatingCard, #waFloatingTrigger, #mobileMenuBtn {
    display: none !important;
  }
  .reveal, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
  }
}
