/* ==========================================================================
   IBRAHIM ENTERPRISE - AGRICULTURAL IMPORT & EXPORT
   Brand Design System & Core Stylesheet
   Extracted Brand Colors:
   - Primary Logo Green: #0fa14a (rgb 15, 161, 74)
   - Deep Forest Green: #095226
   - Brand Dark: #231f20 (rgb 35, 31, 32)
   - Soft Sage Tint: #f2f8f4
   ========================================================================== */

:root {
  --color-brand-primary: #0fa14a;
  --color-brand-primary-hover: #0d853e;
  --color-brand-primary-dark: #095226;
  --color-brand-sage-50: #f4f9f6;
  --color-brand-sage-100: #e5f2eb;
  --color-brand-sage-200: #cbe5d7;
  --color-brand-dark: #231f20;
  --color-brand-charcoal: #2d3330;
  --color-brand-muted: #5f6b64;
  --color-border-subtle: #e5ebe7;
  --color-surface-card: #ffffff;
  
  --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  
  --transition-fast: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 240ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-body);
  color: var(--color-brand-dark);
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.025em;
  color: var(--color-brand-dark);
}

/* ==========================================================================
   Utility Classes & Layout Tokens
   ========================================================================== */

.bg-sage-subtle {
  background-color: var(--color-brand-sage-50);
}

.border-subtle {
  border-color: var(--color-border-subtle);
}

.text-brand-green {
  color: var(--color-brand-primary);
}

.bg-brand-green {
  background-color: var(--color-brand-primary);
}

.hover\:bg-brand-green-dark:hover {
  background-color: var(--color-brand-primary-hover);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  transition: all var(--transition-normal);
  border-bottom: 1px solid rgba(229, 235, 231, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: rgba(255, 255, 255, 0.94);
}

.site-header.scrolled {
  box-shadow: 0 4px 20px -2px rgba(15, 161, 74, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
}

.nav-link {
  position: relative;
  font-weight: 500;
  color: var(--color-brand-charcoal);
  transition: color var(--transition-fast);
  padding: 0.5rem 0.25rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--color-brand-primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--color-brand-primary);
  transition: width var(--transition-normal);
  border-radius: 9999px;
}

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

/* ==========================================================================
   Buttons & Micro-interactions
   ========================================================================== */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--color-brand-primary);
  color: #ffffff;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px -1px rgba(15, 161, 74, 0.35);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  background-color: var(--color-brand-primary-hover);
  box-shadow: 0 4px 14px -1px rgba(15, 161, 74, 0.45);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: #ffffff;
  color: var(--color-brand-dark);
  border: 1px solid var(--color-border-subtle);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  border-color: var(--color-brand-primary);
  color: var(--color-brand-primary);
  background-color: var(--color-brand-sage-50);
  transform: translateY(-1px);
}

.btn-hero-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-hero-glass:hover {
  background-color: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ==========================================================================
   Product Cards & Image Zoom
   ========================================================================== */

.product-card {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  border: 1px solid var(--color-border-subtle);
  background: #ffffff;
  border-radius: 0.75rem;
  overflow: hidden;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -6px rgba(15, 161, 74, 0.1), 0 4px 8px -2px rgba(0, 0, 0, 0.04);
  border-color: var(--color-brand-sage-200);
}

.product-card .img-zoom {
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .img-zoom {
  transform: scale(1.05);
}

/* ==========================================================================
   Card & Text Appear Animations (Scroll & Entrance Reveal)
   ========================================================================== */

/* Resilient initialization: Only animate when reveal-ready is active */
.reveal-ready .reveal-card {
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow var(--transition-normal),
              border-color var(--transition-normal);
  will-change: opacity, transform;
}

.reveal-ready .reveal-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Ensure smooth hover after card has appeared */
.reveal-ready .reveal-card.is-visible:hover,
.reveal-ready .product-card.is-visible:hover {
  transform: translateY(-4px) scale(1);
}

.reveal-ready .reveal-text {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-ready .reveal-text.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-ready .reveal-fade {
  opacity: 0;
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity;
}

.reveal-ready .reveal-fade.is-visible {
  opacity: 1;
}

/* Stagger delay utility classes */
.delay-75  { transition-delay: 75ms !important; }
.delay-100 { transition-delay: 100ms !important; }
.delay-150 { transition-delay: 150ms !important; }
.delay-200 { transition-delay: 200ms !important; }
.delay-250 { transition-delay: 250ms !important; }
.delay-300 { transition-delay: 300ms !important; }
.delay-350 { transition-delay: 350ms !important; }
.delay-400 { transition-delay: 400ms !important; }
.delay-450 { transition-delay: 450ms !important; }
.delay-500 { transition-delay: 500ms !important; }

/* Hero Entrance Animations for Instant Aesthetic Impact */
@keyframes heroFadeInUp {
  0% {
    opacity: 0;
    transform: translateY(28px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroBadgePop {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.94);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hero-anim-badge {
  animation: heroBadgePop 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-anim-title {
  animation: heroFadeInUp 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

.hero-anim-desc {
  animation: heroFadeInUp 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.24s both;
}

.hero-anim-cta {
  animation: heroFadeInUp 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.36s both;
}

.hero-anim-metrics {
  animation: heroFadeInUp 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.48s both;
}


/* ==========================================================================
   Interactive Map & Route Pulsing
   ========================================================================== */

@keyframes pulse-route {
  0% {
    stroke-dashoffset: 200;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.trade-route {
  stroke-dasharray: 6 6;
  animation: pulse-route 12s linear infinite;
}

@keyframes ping-node {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.6);
    opacity: 0.3;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

.node-ping {
  transform-origin: center;
  animation: ping-node 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* ==========================================================================
   Form Controls
   ========================================================================== */

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.5rem;
  color: var(--color-brand-dark);
  font-size: 0.9375rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--color-brand-primary);
  box-shadow: 0 0 0 3px rgba(15, 161, 74, 0.15);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: #94a3b8;
}

/* ==========================================================================
   Badge Tags
   ========================================================================== */

.badge-green {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  background-color: var(--color-brand-sage-100);
  color: var(--color-brand-primary-dark);
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid var(--color-brand-sage-200);
}

.badge-neutral {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  background-color: #f1f5f3;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 9999px;
}

/* ==========================================================================
   Accessibility & Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-ready .reveal-card,
  .reveal-ready .reveal-text,
  .reveal-ready .reveal-fade {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   Floating Communication Suite & Trade Assistant Chatbot
   ========================================================================== */

.floating-comms-suite {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 45;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}

.floating-comms-suite > * {
  pointer-events: auto;
}

.whatsapp-float-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  background-color: #25D366;
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  position: relative;
  text-decoration: none;
}

.whatsapp-float-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.6);
}

.whatsapp-float-btn:active {
  transform: scale(0.96);
}

.whatsapp-float-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  background-color: #22c55e;
  border: 2px solid #ffffff;
}

.chat-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 9999px;
  background-color: #0fa14a;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(15, 161, 74, 0.35);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.chat-trigger-btn:hover {
  transform: translateY(-2px);
  background-color: #0d853e;
  box-shadow: 0 6px 22px rgba(15, 161, 74, 0.5);
}

.trade-bot-widget {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 50;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.trade-bot-widget.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.trade-bot-header {
  background: linear-gradient(135deg, #095226 0%, #0fa14a 100%);
  color: #ffffff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trade-bot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: #f8fafc;
  font-size: 13px;
  line-height: 1.5;
}

.trade-bot-msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 14px;
  word-wrap: break-word;
}

.trade-bot-msg.bot {
  align-self: flex-start;
  background-color: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.trade-bot-msg.user {
  align-self: flex-end;
  background-color: #0fa14a;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.trade-bot-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.trade-bot-pill {
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.trade-bot-pill:hover {
  background-color: #0fa14a;
  color: #ffffff;
  border-color: #0fa14a;
}

.trade-bot-input-bar {
  padding: 10px 14px;
  background-color: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.trade-bot-input-bar input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
}

.trade-bot-input-bar input:focus {
  border-color: #0fa14a;
}

.trade-bot-send-btn {
  background-color: #0fa14a;
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.trade-bot-send-btn:hover {
  background-color: #0d853e;
}

@media (max-width: 640px) {
  .floating-comms-suite {
    bottom: 16px;
    right: 16px;
    gap: 8px;
  }
  .whatsapp-float-btn {
    width: 50px;
    height: 50px;
  }
  .chat-trigger-btn span {
    display: none;
  }
  .chat-trigger-btn {
    padding: 12px;
    width: 50px;
    height: 50px;
    justify-content: center;
  }
  .trade-bot-widget {
    bottom: 80px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    height: calc(100vh - 100px);
  }
}
