/* Pan Africa Business (PAB Tech) - Design System & Custom Styles */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Noto+Sans+Ethiopic:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --navy-950: #050c18;
  --navy-900: #0a192f;
  --navy-800: #112240;
  --navy-700: #1a3050;
  --navy-600: #233654;
  --gold-500: #e5a93c;
  --gold-400: #f0b94d;
  --gold-300: #f5cc6e;
  --gold-600: #c48a2a;
  --emerald-500: #10b981;
  --emerald-400: #34d399;
  --emerald-600: #059669;
  --glass-bg: rgba(10, 25, 47, 0.65);
  --glass-border: rgba(229, 169, 60, 0.15);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--navy-950);
  color: #e2e8f0;
  overflow-x: hidden;
  line-height: 1.6;
}

body.amharic-mode {
  font-family: 'Noto Sans Ethiopic', 'Plus Jakarta Sans', sans-serif;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--navy-950);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold-500), var(--emerald-500));
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-400);
}

/* Background Grid & Mesh */
.grid-pattern {
  background-image: 
    linear-gradient(rgba(229, 169, 60, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(229, 169, 60, 0.035) 1px, transparent 1px);
  background-size: 50px 50px;
}

.radial-glow {
  background: radial-gradient(circle at 50% 50%, rgba(229, 169, 60, 0.08) 0%, transparent 70%);
}

/* 3D Scene */
#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: auto;
}

/* Floating Gradient Mesh Orbs
   The orbs are intentionally larger than the viewport and sit at negative
   offsets. Without a clipping container, browsers still count that overflow
   toward the document's scrollable width — which breaks any
   `position: fixed` element (navbar, mobile drawer) on mobile. This wrapper
   is itself viewport-sized and clips its children, so the orbs' overflow
   never leaks into the page's layout. */
.orb-container {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

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

.orb-1 {
  width: 750px;
  height: 750px;
  background: radial-gradient(circle, rgba(229, 169, 60, 0.15) 0%, transparent 70%);
  top: -200px;
  right: -180px;
  animation: floatOrb1 14s ease-in-out infinite;
}

.orb-2 {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
  bottom: -150px;
  left: -150px;
  animation: floatOrb2 18s ease-in-out infinite alternate;
}

.orb-3 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(229, 169, 60, 0.08) 0%, transparent 70%);
  top: 40%;
  left: 35%;
  animation: floatOrb1 20s ease-in-out infinite reverse;
}

@keyframes floatOrb1 {
  0%, 100% { transform: translateY(0) translateX(0) scale(1); }
  33% { transform: translateY(-35px) translateX(25px) scale(1.05); }
  66% { transform: translateY(20px) translateX(-30px) scale(0.95); }
}

@keyframes floatOrb2 {
  0% { transform: translateY(0) translateX(0); }
  100% { transform: translateY(-40px) translateX(30px); }
}

/* Glassmorphism Classes */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
}

.glass-card {
  background: rgba(10, 25, 47, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
  border-color: rgba(229, 169, 60, 0.4);
  box-shadow: 0 25px 50px -12px rgba(229, 169, 60, 0.18), 0 0 30px rgba(16, 185, 129, 0.06);
  transform: translateY(-4px);
}

.glass-dark {
  background: rgba(5, 12, 24, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 3D Card Hover System */
.card-3d {
  perspective: 1200px;
}

.card-3d-inner {
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.5s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.card-3d:hover .card-3d-inner {
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(229, 169, 60, 0.15);
}

/* Glow Utilities */
.glow-gold {
  text-shadow: 0 0 35px rgba(229, 169, 60, 0.4), 0 0 70px rgba(229, 169, 60, 0.2);
}

.glow-emerald {
  text-shadow: 0 0 35px rgba(16, 185, 129, 0.4);
}

/* Nav Link Hover Animation */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-500), var(--emerald-500));
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 2px;
}

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

/* 3D Button Effects */
.btn-3d {
  position: relative;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  transform-style: preserve-3d;
}

.btn-3d:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 30px -5px rgba(229, 169, 60, 0.35);
}

.btn-3d:active {
  transform: translateY(0) scale(0.99);
}

/* Scroll Fade-in observer classes */
.fade-up {
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Telemetry Wave Divider */
.wave-divider {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  z-index: 2;
}

.wave-divider svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 70px;
}

/* Command Center Terminal Styling */
.terminal-window {
  font-family: 'JetBrains Mono', monospace;
  background: #030811;
  border: 1px solid rgba(229, 169, 60, 0.2);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

.terminal-header {
  background: #081224;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Mobile Drawer
   NOTE: intentionally avoid `transform: translateX(100%)` to hide this panel.
   This element is `position: fixed; inset: 0` (full viewport size); translating
   it a full 100% off-screen still occupies layout space just past the visual
   viewport, which inflates the page's horizontal scrollable width and breaks
   other `position: fixed; left:0; right:0` elements (like the navbar) on some
   mobile browsers. A fade + scale transition avoids ever moving the box
   outside the viewport bounds. */
.mobile-menu {
  opacity: 0;
  transform: scale(0.98);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.35s;
}

.mobile-menu.open {
  opacity: 1;
  transform: scale(1);
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0s;
}

/* Product Tag Pill */
.product-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 0.375rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(229, 169, 60, 0.12);
  color: #f5cc6e;
  border: 1px solid rgba(229, 169, 60, 0.25);
}

.product-tag-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.25);
}

/* Software Product Search Input */
.product-search-input {
  background: rgba(5, 12, 24, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  transition: all 0.3s ease;
}

.product-search-input:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 15px rgba(229, 169, 60, 0.2);
  outline: none;
}

/* Biometric Fingerprint Pulse */
@keyframes bioPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.08); opacity: 1; filter: drop-shadow(0 0 12px #10b981); }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.bio-pulse {
  animation: bioPulse 2.2s infinite ease-in-out;
}

/* Amharic specific spacing refinements */
body.amharic-mode h1,
body.amharic-mode h2,
body.amharic-mode h3 {
  letter-spacing: normal !important;
  line-height: 1.28 !important;
}

/* Responsive Guardrails & Multi-Line Text Wrapping Prevention
   Forcing `white-space: nowrap` on long button/badge labels (e.g. "Explore
   14+ Software Products") looks great on desktop but is a common cause of
   real horizontal overflow on narrow phones — the label refuses to wrap, so
   its flex/inline-flex container is forced wider than the viewport. Only
   force the single-line look at sm+ (640px), where there's room for it;
   below that, let text wrap normally. */
@media (min-width: 640px) {
  .nav-link,
  .nav-link span,
  .product-filter-btn,
  .solution-tab-btn,
  .product-tag,
  .btn-3d {
    white-space: nowrap;
  }
}

/* Same reasoning for Tailwind's `.whitespace-nowrap` utility, used on many
   button/badge labels throughout the page: neutralize it below 640px so
   long labels wrap instead of pushing content off-screen. Where the text is
   already short enough to fit on one line, this has no visible effect. */
@media (max-width: 639px) {
  .whitespace-nowrap {
    white-space: normal !important;
  }
}

/* Prevent unwanted horizontal scroll */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Product filter button enhanced active & hover styles */
.product-filter-btn,
.solution-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.product-filter-btn:hover,
.solution-tab-btn:hover {
  border-color: rgba(229, 169, 60, 0.5);
  color: #fff;
  background: rgba(229, 169, 60, 0.1);
}

.product-filter-btn.active,
.solution-tab-btn.active {
  background: rgba(229, 169, 60, 0.2) !important;
  color: var(--gold-400) !important;
  border-color: rgba(229, 169, 60, 0.5) !important;
  box-shadow: 0 0 15px rgba(229, 169, 60, 0.15);
}

/* Ensure mobile drawer scrolls smoothly */
.mobile-menu {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* ===== Floating Action Buttons (WhatsApp / Telegram / AI Chat) ===== */
.fab-btn {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

#fab-quick-contacts {
  display: none;
}

#fab-quick-contacts.flex {
  display: flex;
  animation: fabPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fabPopIn {
  from { opacity: 0; transform: translateY(12px) scale(0.85); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== AI Chat Panel ===== */
#ai-chat-panel.flex {
  animation: chatPanelIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

#ai-chat-messages {
  scrollbar-width: thin;
}

.chat-bubble {
  max-width: 85%;
  padding: 0.65rem 0.9rem;
  border-radius: 1rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-bubble-bot {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border-bottom-left-radius: 0.25rem;
  align-self: flex-start;
}

.chat-bubble-user {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  color: var(--navy-950);
  font-weight: 600;
  border-bottom-right-radius: 0.25rem;
  align-self: flex-end;
  margin-left: auto;
}

.chat-row {
  display: flex;
}

.chat-quick-chip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--emerald-400);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-quick-chip:hover {
  background: rgba(16, 185, 129, 0.2);
}

.chat-typing-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 3px;
  border-radius: 50%;
  background: var(--emerald-400);
  animation: chatTyping 1.2s infinite ease-in-out;
}

.chat-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chatTyping {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* Keep the FAB stack clear of the mobile bottom safe-area and the browser's
   own collapsible bottom toolbar (common on Android Chrome), which can
   otherwise sit right on top of a `bottom: 1rem` fixed button. */
@media (max-width: 480px) {
  #fab-stack {
    bottom: max(1.5rem, calc(env(safe-area-inset-bottom) + 1rem));
  }

  #ai-chat-panel {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ===== Featured Spotlight — Product Advertising Carousel ===== */
#promo-carousel,
#promo-track,
#promo-slides {
  min-width: 0;
}

/* Animated gradient glow ring — makes the advert impossible to miss without
   being obnoxious. Sits behind #promo-track via a negative z-index, contained
   by isolation so it never escapes to sit behind other page content. */
.promo-glow {
  isolation: isolate;
  padding: 3px;
  border-radius: 1.6rem;
}

.promo-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  background: linear-gradient(135deg, var(--gold-500), var(--emerald-500), var(--gold-400), var(--emerald-400));
  background-size: 300% 300%;
  animation: promoGlowShift 6s ease infinite;
  filter: blur(2px);
}

.promo-glow::after {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: inherit;
  z-index: -2;
  background: radial-gradient(circle, rgba(229, 169, 60, 0.35) 0%, rgba(16, 185, 129, 0.2) 45%, transparent 75%);
  filter: blur(22px);
  opacity: 0.8;
  animation: promoPulseGlow 3.2s ease-in-out infinite;
}

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

@keyframes promoPulseGlow {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.04); }
}

#promo-track {
  border-radius: 1.4rem;
}

#promo-slides {
  will-change: transform;
}

.promo-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  padding: 0 2px;
}

.promo-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: 1.25rem;
  background: rgba(10, 25, 47, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (min-width: 640px) {
  .promo-card {
    border-radius: 1.5rem;
    padding: 2.25rem 2.5rem;
    gap: 2rem;
  }
}

.promo-theme-gold {
  border-color: rgba(229, 169, 60, 0.3);
}

.promo-theme-emerald {
  border-color: rgba(16, 185, 129, 0.3);
}

.promo-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .promo-icon-wrap {
    width: 68px;
    height: 68px;
    border-radius: 1.25rem;
  }
}

.promo-theme-gold .promo-icon-wrap {
  background: rgba(229, 169, 60, 0.15);
  color: var(--gold-400);
}

.promo-theme-emerald .promo-icon-wrap {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
}

.promo-icon-wrap iconify-icon {
  width: 20px !important;
  height: 20px !important;
}

@media (min-width: 640px) {
  .promo-icon-wrap iconify-icon {
    width: 36px !important;
    height: 36px !important;
  }
}

.promo-body {
  min-width: 0;
  flex: 1;
}

.promo-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.35rem;
}

@media (min-width: 640px) {
  .promo-badge {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.7rem;
    margin-bottom: 0.6rem;
  }
}

.promo-theme-gold .promo-badge {
  background: rgba(229, 169, 60, 0.15);
  color: var(--gold-400);
  border: 1px solid rgba(229, 169, 60, 0.3);
}

.promo-theme-emerald .promo-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.promo-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

@media (min-width: 640px) {
  .promo-title {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
  }
}

.promo-subtitle {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.45;
  margin-bottom: 0.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 640px) {
  .promo-subtitle {
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 1.1rem;
    -webkit-line-clamp: unset;
  }
}

.promo-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.4rem 0.8rem;
  border-radius: 0.6rem;
  transition: all 0.25s ease;
  text-decoration: none;
}

@media (min-width: 640px) {
  .promo-cta {
    font-size: 0.78rem;
    padding: 0.65rem 1.2rem;
    border-radius: 0.75rem;
    gap: 0.4rem;
  }
}

.promo-theme-gold .promo-cta {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  color: var(--navy-950);
}

.promo-theme-emerald .promo-cta {
  background: linear-gradient(135deg, var(--emerald-500), var(--emerald-600));
  color: #fff;
}

.promo-cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.promo-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.25s ease;
}

.promo-dot-active {
  width: 22px;
  background: linear-gradient(90deg, var(--gold-500), var(--emerald-500));
}

