/* ===== IICCI Premium Stylesheet ===== */

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  background: #081120;
  scroll-behavior: smooth;
}

html.lenis, html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

::selection {
  background: #d4af37;
  color: #081120;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #081120;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #1e40af, #d4af37);
  border-radius: 8px;
}

/* ===== Gradients ===== */
.bg-radial-navy {
  background: radial-gradient(ellipse at top, #142a4a 0%, #081120 60%);
}
.bg-gradient-gold {
  background: linear-gradient(135deg, #d4af37 0%, #f6efce 50%, #d4af37 100%);
}
.text-gradient-gold {
  background: linear-gradient(135deg, #d4af37 0%, #f3e5a1 50%, #d4af37 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.text-gradient-royal {
  background: linear-gradient(135deg, #ffffff 0%, #86a5cf 50%, #3b82f6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.text-gradient-white {
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 50%, rgba(255,255,255,0.6) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== Glassmorphism ===== */
.glass {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.glass-dark {
  background: rgba(8, 17, 32, 0.6);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.glass-light {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(8, 17, 32, 0.08);
}

/* ===== Premium Shadows ===== */
.shadow-premium {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.05);
}
.shadow-gold {
  box-shadow: 0 10px 40px -10px rgba(212, 175, 55, 0.4), 0 0 0 1px rgba(212, 175, 55, 0.2);
}
.shadow-royal {
  box-shadow: 0 10px 40px -10px rgba(30, 64, 175, 0.5);
}

/* ===== Animated Background Grid ===== */
.bg-grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
}
.bg-grid-fade {
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}
.bg-grid-light {
  background-image:
    linear-gradient(rgba(8, 17, 32, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 17, 32, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ===== Aurora / Glow Background ===== */
.aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.aurora::before, .aurora::after {
  content: '';
  position: absolute;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  animation: aurora-float 20s ease-in-out infinite;
}
.aurora::before {
  background: radial-gradient(circle, #1e40af 0%, transparent 70%);
  top: -20vw;
  left: -10vw;
}
.aurora::after {
  background: radial-gradient(circle, #d4af37 0%, transparent 70%);
  bottom: -20vw;
  right: -10vw;
  animation-delay: -10s;
}
@keyframes aurora-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(50px, -30px) scale(1.1); }
  66% { transform: translate(-30px, 40px) scale(0.95); }
}

/* ===== Custom Cursor ===== */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transition: opacity 0.2s ease;
}
/* Difference blend inverts text on light mega menus — hide custom cursor in navbar */
body.nav-cursor-hidden .cursor-dot,
body.nav-cursor-hidden .cursor-ring {
  opacity: 0 !important;
}
.cursor-dot {
  width: 6px;
  height: 6px;
  background: #d4af37;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(212,175,55,0.6);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, border-color 0.3s, transform 0.1s ease-out;
}
.cursor-ring.hover-active {
  width: 64px;
  height: 64px;
  border-color: #d4af37;
  background: rgba(212,175,55,0.05);
}
@media (max-width: 1024px) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ===== Scroll Progress ===== */
.scroll-progress {
  position: fixed;
  top: var(--navbar-height, 88px);
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, #1e40af, #d4af37);
  z-index: 45;
  width: 0%;
  transition: width 0.1s ease-out;
  box-shadow: none;
  pointer-events: none;
}
.scroll-progress.is-visible {
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.45);
}

/* ===== Animated Underline ===== */
.link-underline {
  position: relative;
}
.link-underline::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, #d4af37, transparent);
  transition: width 0.4s cubic-bezier(0.7, 0, 0.3, 1);
}
.link-underline:hover::after {
  width: 100%;
}

/* ===== Premium Button ===== */
.btn-premium {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: all 0.4s cubic-bezier(0.7, 0, 0.3, 1);
}
.btn-premium::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  z-index: -1;
}
.btn-premium:hover::before {
  width: 400px;
  height: 400px;
}
.btn-shine {
  position: relative;
  overflow: hidden;
}
.btn-shine::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.8s;
}
.btn-shine:hover::after {
  left: 100%;
}

/* ===== Globe / World Map ===== */
.globe-container {
  perspective: 1000px;
  transform-style: preserve-3d;
}
.globe-rotate {
  animation: rotate-globe 60s linear infinite;
}
@keyframes rotate-globe {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

/* ===== Floating Particles ===== */
.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: particle-float linear infinite;
}
@keyframes particle-float {
  0% {
    transform: translateY(100vh) translateX(0) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
    transform: translateY(80vh) translateX(20px) scale(1);
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-10vh) translateX(-30px) scale(0.5);
    opacity: 0;
  }
}

/* ===== Trade Route Lines ===== */
@keyframes trade-line {
  0% { stroke-dashoffset: 1000; opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
.trade-route {
  stroke-dasharray: 1000;
  animation: trade-line 4s ease-in-out infinite;
}

/* ===== Pulse Ring ===== */
.pulse-ring {
  position: absolute;
  border-radius: 50%;
  animation: pulse-ring 2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes pulse-ring {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }
  100% {
    transform: scale(3);
    opacity: 0;
  }
}

/* ===== Reveal animations ===== */
/* SSR / pre-JS: content visible (Next.js). app.js adds html.iicci-animate to enable scroll reveals. */
.reveal-up,
.reveal-fade,
.reveal-scale {
  opacity: 1;
  transform: none;
  filter: none;
}
html.iicci-animate .reveal-up:not(.in-view) {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-up.in-view {
  opacity: 1;
  transform: translateY(0);
}
html.iicci-animate .reveal-fade:not(.in-view) {
  opacity: 0;
  filter: blur(10px);
  transition: opacity 1.2s ease, filter 1.2s ease;
}
.reveal-fade.in-view {
  opacity: 1;
  filter: blur(0);
}
html.iicci-animate .reveal-scale:not(.in-view) {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale.in-view {
  opacity: 1;
  transform: scale(1);
}

/* ===== Marquee ===== */
.marquee {
  display: flex;
  overflow: hidden;
  user-select: none;
  gap: 3rem;
}
.marquee-track {
  display: flex;
  gap: 3rem;
  flex-shrink: 0;
  animation: marquee 40s linear infinite;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* ===== Card hover lift ===== */
.card-lift {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease, border-color 0.5s ease;
}
.card-lift:hover {
  transform: translateY(-8px);
  border-color: rgba(212, 175, 55, 0.4) !important;
}

/* ===== Shimmer Text ===== */
.shimmer-text {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.6) 0%,
    #d4af37 50%,
    rgba(255,255,255,0.6) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer-move 4s linear infinite;
}
@keyframes shimmer-move {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* ===== Number counter ===== */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* ===== Nav (light header) scroll state ===== */
.nav-blur #main-nav {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  box-shadow: 0 4px 24px rgba(8, 17, 32, 0.1);
}

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

/* Section padding helpers */
.section-padding {
  padding-top: 7rem;
  padding-bottom: 7rem;
}
@media (max-width: 768px) {
  .section-padding {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
}

/* Mega Menu */
.has-mega-menu {
  position: relative;
}
/* Invisible bridge so hover does not drop between link and panel */
.has-mega-menu::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 14px;
}
.mega-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s, visibility 0.25s, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
  pointer-events: none;
}
/* Visibility controlled only by JS (.is-open) — not CSS :hover */
.mega-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.mega-menu a,
.mega-menu button {
  position: relative;
  z-index: 1;
}
.mega-menu a:hover,
.mega-menu a:focus-visible {
  color: #081120;
}
.mega-menu a:hover .mega-item-title,
.mega-menu a:focus-visible .mega-item-title {
  color: #081120 !important;
}
.mega-menu a:hover .mega-item-desc,
.mega-menu a:focus-visible .mega-item-desc {
  color: #4b5563 !important;
}
.mega-menu .mega-chapter-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.35rem;
  border-radius: 0.5rem;
  background: rgba(8, 17, 32, 0.06);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #142a4a;
  flex-shrink: 0;
}

/* Mobile menu */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.7, 0, 0.3, 1);
}
.mobile-menu.open {
  transform: translateX(0);
}

/* Service Card */
.service-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(212,175,55,0.15), transparent 40%);
  opacity: 0;
  transition: opacity 0.4s;
  z-index: -1;
}
.service-card:hover::before {
  opacity: 1;
}

/* Hide scrollbar on horizontal track */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Magnetic */
.magnetic {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Accessibility focus */
:focus-visible {
  outline: 2px solid #d4af37;
  outline-offset: 4px;
}

/* Hero title large */
.hero-title {
  font-size: clamp(2rem, 5.5vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}
.display-title {
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

/* Country pin */
.country-pin {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #d4af37;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(212,175,55,0.3);
  transition: transform 0.3s, box-shadow 0.3s;
}
.country-pin:hover {
  transform: scale(1.5);
  box-shadow: 0 0 0 8px rgba(212,175,55,0.4);
}

/* Cool border gradient */
.border-gradient {
  position: relative;
  background: rgba(8, 17, 32, 0.6);
  background-clip: padding-box;
  border: 1px solid transparent;
}
.border-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(212,175,55,0.4), rgba(30,64,175,0.3), rgba(212,175,55,0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* AI Assistant popup — fixed above floating action buttons */
.ai-assistant-panel {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right, 0px));
  bottom: calc(max(1.5rem, env(safe-area-inset-bottom, 0px)) + 5.75rem);
  width: min(380px, calc(100vw - 2rem));
  max-height: min(560px, calc(100dvh - 7.5rem));
  z-index: 100;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.35s ease,
    visibility 0.35s ease;
  transform-origin: bottom right;
}

.ai-assistant-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (max-width: 640px) {
  .ai-assistant-panel {
    left: max(1rem, env(safe-area-inset-left, 0px));
    right: max(1rem, env(safe-area-inset-right, 0px));
    width: auto;
    max-height: min(520px, calc(100dvh - 6.5rem));
  }
}

/* Tilt effect */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.3s ease-out;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Premium light section */
.section-light {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 50%, #f1f5f9 100%);
  color: #081120;
}

/* Image placeholder gradient */
.img-gradient-1 { background: linear-gradient(135deg, #1e40af 0%, #081120 100%); }
.img-gradient-2 { background: linear-gradient(135deg, #d4af37 0%, #86551e 100%); }
.img-gradient-3 { background: linear-gradient(135deg, #3b82f6 0%, #142a4a 100%); }
.img-gradient-4 { background: linear-gradient(135deg, #c79328 0%, #1d3c66 100%); }

/* SVG world map dots */
.dot-map {
  background-image: radial-gradient(circle, rgba(255,255,255,0.2) 1px, transparent 1px);
  background-size: 16px 16px;
}

/* Floating chip */
.float-chip {
  animation: float-chip 6s ease-in-out infinite;
}
@keyframes float-chip {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-15px) rotate(2deg); }
}
.float-chip-slow {
  animation: float-chip 9s ease-in-out infinite;
}
.float-chip-fast {
  animation: float-chip 4s ease-in-out infinite;
}

/* Number with gold accent */
.huge-number {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

/* ===== Stats section grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
  align-items: stretch;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

@media (min-width: 1280px) {
  .stats-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

.stats-grid > li {
  position: relative;
  z-index: 1;
}

/* Above fixed float buttons (z-40) so the rightmost card receives hover */
.stats-grid > li:hover {
  z-index: 45;
}

.stats-card {
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  position: relative;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease,
    border-color 0.5s ease;
}

/* Lift + border on hover (incl. rightmost card under fixed floats) */
.stats-card:hover,
.stats-grid > li:hover .stats-card {
  transform: translateY(-8px) !important;
  border-color: rgba(212, 175, 55, 0.45) !important;
  box-shadow: 0 20px 40px -12px rgba(8, 17, 32, 0.12);
}

.stats-card:hover .stats-card-icon,
.stats-grid > li:hover .stats-card-icon {
  background-color: #d4af37;
  color: #081120;
}

/* reveal-up sets transform on .in-view — must not cancel stats-card hover */
html.iicci-animate .stats-card.reveal-up.in-view:hover,
html.iicci-animate .stats-grid > li:hover .stats-card.reveal-up.in-view {
  transform: translateY(-8px) !important;
}

.stats-card .stat-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 100%;
}

@media (max-width: 767px) {
  .stats-card {
    padding: 1rem !important;
  }

  .stats-card .stats-card-icon {
    width: 2.25rem;
    height: 2.25rem;
  }

  .stats-card .stats-card-icon i {
    font-size: 0.65rem;
  }

  .stats-card > div:first-child {
    margin-bottom: 0.75rem;
  }

  .stats-card .stat-value {
    font-size: clamp(1.35rem, 5.5vw, 1.65rem);
  }

  .stats-card .stat-suffix {
    font-size: clamp(1rem, 3.5vw, 1.25rem);
  }

  .stats-card p.text-sm {
    font-size: 0.75rem;
    margin-top: 0.375rem;
  }

  .stats-card p.text-xs {
    font-size: 0.65rem;
    margin-top: 0.25rem;
  }
}

@media (min-width: 1280px) {
  .stats-card .stat-value {
    font-size: clamp(1.65rem, 1.6vw, 2.5rem);
  }
}

.stats-card .stat-suffix {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1;
}

html.iicci-animate .stats-grid .reveal-up:not(.in-view) {
  transform: translateY(24px);
}
