/* ============================================
   BNLV GROUP — BMS Enterprise Platform
   Animations CSS · v1.0 · May 2026
   ============================================ */

/* === KEYFRAMES === */
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeLeft {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes barGrow {
  from { transform: scaleY(0); transform-origin: bottom; }
  to   { transform: scaleY(1); transform-origin: bottom; }
}
@keyframes progressFill {
  from { width: 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}
@keyframes borderPulse {
  0%, 100% { border-color: rgba(184,150,12,0.2); }
  50%       { border-color: rgba(184,150,12,0.5); }
}
@keyframes cardAppear {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(120%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(120%); }
}

/* === SCROLL-TRIGGERED ANIMATION BASE === */
[data-animate] {
  opacity: 0;
  transition: opacity 0.55s ease, transform 0.55s ease;
}
[data-animate="fade-up"]   { transform: translateY(30px); }
[data-animate="fade-left"] { transform: translateX(40px); }
[data-animate="fade-in"]   { transform: none; }
[data-animate="scale-in"]  { transform: scale(0.95); }

[data-animate].animated {
  opacity: 1;
  transform: none !important;
}

/* Stagger delays */
[data-delay="0"]   { transition-delay: 0ms; }
[data-delay="50"]  { transition-delay: 50ms; }
[data-delay="100"] { transition-delay: 100ms; }
[data-delay="150"] { transition-delay: 150ms; }
[data-delay="200"] { transition-delay: 200ms; }
[data-delay="250"] { transition-delay: 250ms; }
[data-delay="300"] { transition-delay: 300ms; }
[data-delay="350"] { transition-delay: 350ms; }
[data-delay="400"] { transition-delay: 400ms; }
[data-delay="450"] { transition-delay: 450ms; }
[data-delay="500"] { transition-delay: 500ms; }

/* === HERO SECTION ENTRANCE === */
.hero-content { animation: fadeUp 0.8s ease both; }
.hero-visual  { animation: fadeLeft 0.9s 0.2s ease both; }
.hero-stats-band .stat-item { animation: fadeUp 0.6s ease both; }
.hero-stats-band .stat-item:nth-child(1)  { animation-delay: 0.1s; }
.hero-stats-band .stat-item:nth-child(3)  { animation-delay: 0.2s; }
.hero-stats-band .stat-item:nth-child(5)  { animation-delay: 0.3s; }
.hero-stats-band .stat-item:nth-child(7)  { animation-delay: 0.4s; }
.hero-stats-band .stat-item:nth-child(9)  { animation-delay: 0.5s; }

/* === NAV ENTRANCE === */
nav { animation: slideDown 0.5s ease both; }

/* === HERO CARD FLOAT === */
.hc-card-main { animation: float 6s ease-in-out infinite; }
.hc-card-back-1 { animation: float 6s 0.3s ease-in-out infinite; }
.hc-card-back-2 { animation: float 6s 0.6s ease-in-out infinite; }

/* === HERO BAR CHART ANIMATION === */
.hcp-bar {
  animation: barGrow 1.2s ease both;
}
.hcp-bar:nth-child(1)  { animation-delay: 0.4s; }
.hcp-bar:nth-child(2)  { animation-delay: 0.5s; }
.hcp-bar:nth-child(3)  { animation-delay: 0.6s; }
.hcp-bar:nth-child(4)  { animation-delay: 0.7s; }
.hcp-bar:nth-child(5)  { animation-delay: 0.8s; }
.hcp-bar:nth-child(6)  { animation-delay: 0.9s; }
.hcp-bar:nth-child(7)  { animation-delay: 1.0s; }
.hcp-bar:nth-child(8)  { animation-delay: 1.1s; }
.hcp-bar:nth-child(9)  { animation-delay: 1.2s; }
.hcp-bar:nth-child(10) { animation-delay: 1.3s; }
.hcp-bar:nth-child(11) { animation-delay: 1.4s; }

/* === DASHBOARD BAR CHART ANIMATION === */
.bcw-bar {
  animation: barGrow 1s ease both;
}
.bcw-group:nth-child(1) .bcw-bar { animation-delay: 0.1s; }
.bcw-group:nth-child(2) .bcw-bar { animation-delay: 0.2s; }
.bcw-group:nth-child(3) .bcw-bar { animation-delay: 0.3s; }
.bcw-group:nth-child(4) .bcw-bar { animation-delay: 0.4s; }
.bcw-group:nth-child(5) .bcw-bar { animation-delay: 0.5s; }
.bcw-group:nth-child(6) .bcw-bar { animation-delay: 0.6s; }

/* === PROGRESS BAR ANIMATION === */
.progress-fill {
  animation: progressFill 1.4s 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* === METRIC CARD ANIMATION === */
.metric-card {
  animation: cardAppear 0.5s ease both;
}
.metric-card:nth-child(1) { animation-delay: 0.05s; }
.metric-card:nth-child(2) { animation-delay: 0.12s; }
.metric-card:nth-child(3) { animation-delay: 0.19s; }
.metric-card:nth-child(4) { animation-delay: 0.26s; }

/* === SIDEBAR ITEM ANIMATION === */
.sidebar-item {
  animation: fadeUp 0.35s ease both;
}
.sidebar-item:nth-child(1) { animation-delay: 0.05s; }
.sidebar-item:nth-child(2) { animation-delay: 0.10s; }
.sidebar-item:nth-child(3) { animation-delay: 0.15s; }
.sidebar-item:nth-child(4) { animation-delay: 0.20s; }
.sidebar-item:nth-child(5) { animation-delay: 0.25s; }
.sidebar-item:nth-child(6) { animation-delay: 0.30s; }
.sidebar-item:nth-child(7) { animation-delay: 0.35s; }

/* === TABLE ROW STAGGER === */
.data-table tbody tr {
  animation: fadeIn 0.35s ease both;
}
.data-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.data-table tbody tr:nth-child(2) { animation-delay: 0.10s; }
.data-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.data-table tbody tr:nth-child(4) { animation-delay: 0.20s; }
.data-table tbody tr:nth-child(5) { animation-delay: 0.25s; }
.data-table tbody tr:nth-child(6) { animation-delay: 0.30s; }

/* === ACTIVITY FEED ANIMATION === */
.activity-item {
  animation: fadeUp 0.4s ease both;
}
.activity-item:nth-child(1) { animation-delay: 0.05s; }
.activity-item:nth-child(2) { animation-delay: 0.12s; }
.activity-item:nth-child(3) { animation-delay: 0.19s; }
.activity-item:nth-child(4) { animation-delay: 0.26s; }
.activity-item:nth-child(5) { animation-delay: 0.33s; }

/* === QUICK ACTION CARD ANIMATION === */
.quick-action-card {
  animation: cardAppear 0.45s ease both;
}
.quick-action-card:nth-child(1) { animation-delay: 0.05s; }
.quick-action-card:nth-child(2) { animation-delay: 0.12s; }
.quick-action-card:nth-child(3) { animation-delay: 0.19s; }
.quick-action-card:nth-child(4) { animation-delay: 0.26s; }

/* === HOVER MICRO-INTERACTIONS === */
.btn-hero-primary:active,
.btn-nav-cta:active,
.btn-form-submit:active,
.btn-cta-primary:active {
  transform: scale(0.97);
}

.company-card { transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease, border-color 0.2s; }
.svc-card, .metric-card, .port-card, .leader-card, .testi-card { transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s; }
.quick-action-card { transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, border-color 0.2s; }

/* Form focus glow */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  animation: borderPulse 2s ease infinite;
}

/* === TOAST NOTIFICATIONS === */
.toast {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  background: #fff;
  border: 1px solid #E8EBF0;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 360px;
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.toast.removing { animation: toastOut 0.3s ease forwards; }
.toast-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.toast-icon.success { color: var(--bms); }
.toast-icon.error   { color: #E24B4A; }
.toast-icon.warning { color: var(--lim); }
.toast-icon.info    { color: var(--vih); }
.toast-title { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 3px; }
.toast-msg   { font-size: 12px; color: var(--muted); line-height: 1.5; }
.toast-close { margin-left: auto; color: var(--muted); font-size: 16px; cursor: pointer; padding: 2px; flex-shrink: 0; }
.toast-close:hover { color: var(--navy); }

/* === PAGE LOADER === */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--navy);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.page-loader.hidden { opacity: 0; visibility: hidden; }
.loader-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  animation: float 2s ease-in-out infinite;
}
.loader-bar-wrap {
  width: 200px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 1px;
  overflow: hidden;
}
.loader-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 1px;
  animation: loaderBar 1.2s ease-in-out forwards;
}
@keyframes loaderBar {
  0%   { width: 0%; }
  60%  { width: 75%; }
  100% { width: 100%; }
}

/* === CHART TOOLTIP === */
.chart-tooltip {
  position: absolute;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  box-shadow: var(--shadow-md);
}
.chart-tooltip.visible { opacity: 1; }
.chart-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--navy);
}

/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,27,42,0.65);
  backdrop-filter: blur(4px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  padding: 24px 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 20px; font-weight: 300; color: var(--navy); }
.modal-close { width: 32px; height: 32px; border-radius: 8px; background: var(--ash-light); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 17px; color: var(--muted); transition: all var(--ease-fast); }
.modal-close:hover { background: var(--ash); color: var(--navy); }
.modal-body { padding: 20px 28px 28px; }

/* === SKELETON LOADERS === */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeletonWave 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}
@keyframes skeletonWave {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text  { height: 14px; border-radius: 4px; }
.skeleton-title { height: 24px; border-radius: 6px; }
.skeleton-card  { height: 120px; border-radius: var(--radius-lg); }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }

/* === REDUCE MOTION === */
@media (prefers-reduced-motion: reduce) {
  [data-animate],
  .hc-card-main,
  .hc-card-back-1,
  .hc-card-back-2,
  .hcp-bar,
  .bcw-bar,
  .progress-fill,
  .metric-card,
  .sidebar-item,
  .data-table tbody tr,
  .activity-item,
  .quick-action-card,
  .hero-content,
  .hero-visual,
  .marquee-track,
  nav {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
