/* ==========================================================================
   BRIGHTVISTA INNOVATION HUB
   Climate Resilience • Community Empowerment • Digital Infrastructure
   Theme: Golden Yellow (#f59e0b), Light Blue (#0284c7), & Emerald Green (#059669)
   Typography: Montserrat
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap');

:root {
  --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --theme-gold: #f59e0b;      /* Golden Yellow Primary */
  --theme-gold-light: #fef3c7;
  --theme-gold-dark: #d97706;
  --theme-blue: #0284c7;      /* Light Sky Blue Primary */
  --theme-blue-light: #e0f2fe;
  --theme-blue-dark: #0369a1;
  --theme-green: #059669;
  --theme-dark: #0f172a;
}

*, *::before, *::after {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  letter-spacing: -0.01em;
}

html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  min-width: 100% !important;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  background-color: #f8fafc;
  color: #0f172a;
  margin: 0;
  padding: 0;
}

/* Institutional Top Accent Ribbon (Light Blue, Golden Yellow, Emerald Green) */
.brand-ribbon {
  height: 4px;
  background: linear-gradient(90deg, #012167 0%, #3258ae 30%, #638ff5 55%, #f59e0b 75%, #059669 100%);
}

/* User-Specified Palette Gradient: Deep Sapphire (#012167) to Cobalt (#3258ae) to Sky Cerulean (#638ff5) */
.user-blue-gradient {
  background: linear-gradient(180deg, #012167 0%, #3258ae 50%, #638ff5 100%) !important;
}

.user-blue-gradient-horizontal {
  background: linear-gradient(135deg, #012167 0%, #3258ae 55%, #638ff5 100%) !important;
}

.user-blue-btn {
  background: linear-gradient(135deg, #012167 0%, #1e4ea4 50%, #3258ae 100%) !important;
  color: #ffffff !important;
  transition: all 0.2s ease-in-out !important;
}

.user-blue-btn:hover {
  background: linear-gradient(135deg, #0b2f82 0%, #285ec4 50%, #4674dc 100%) !important;
  box-shadow: 0 4px 14px rgba(50, 88, 174, 0.35) !important;
}

/* Glassmorphism Header */
.bv-nav,
.ajira-nav {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #e2e8f0;
}

/* Base Navigation Item: Strict horizontal alignment, compact executive pills */
.nav-item {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.15rem !important;
  white-space: nowrap !important;
  font-weight: 700 !important;
  font-size: 0.71875rem !important; /* 11.5px for crisp, complete desktop fit of all 12 tabs */
  padding: 0.25rem 0.28rem !important;
  border-radius: 0.5rem !important;
  transition: all 0.15s ease-in-out !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
  user-select: none !important;
  line-height: 1.25 !important;
}

@media (min-width: 1440px) {
  .nav-item {
    font-size: 0.8125rem !important; /* 13px */
    padding: 0.38rem 0.65rem !important;
    gap: 0.3rem !important;
  }
}

.nav-item.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px -1px rgba(2, 132, 199, 0.35) !important;
}

.nav-item.active i,
.nav-item.active svg {
  color: #fde047 !important; /* Golden yellow accent on active icon */
}

.nav-item:not(.active) {
  color: #334155 !important;
  background-color: transparent !important;
}

.nav-item:not(.active):hover {
  background-color: #f0f9ff !important;
  color: #0284c7 !important;
}

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

/* Page Transition */
.page-view {
  animation: fadeIn 0.2s ease-in-out;
}

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

/* Card Hover States */
.bv-card,
.ajira-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.875rem;
  transition: all 0.2s ease;
}

.bv-card:hover,
.ajira-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(2, 132, 199, 0.08);
  border-color: #7dd3fc;
}

/* Badges */
.badge-gold,
.badge-orange {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-blue,
.badge-lightblue {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-green {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-purple {
  background-color: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

/* Live Session Indicator Pulse */
@keyframes livePulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.live-pulse-badge {
  animation: livePulse 1.8s infinite;
}

/* Golden yellow buttons & accents */
.btn-gold {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  font-weight: 700;
  transition: all 0.15s ease-in-out;
}
.btn-gold:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.btn-lightblue {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  font-weight: 700;
  transition: all 0.15s ease-in-out;
}
.btn-lightblue:hover {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

/* Media Studio & LMS Styling */
.media-thumb {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  background-color: #0f172a;
}

.media-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.2) 0%, rgba(15, 23, 42, 0.85) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.media-thumb:hover .media-thumb-overlay {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0.7) 100%);
}

.play-button-glow {
  box-shadow: 0 0 20px rgba(234, 88, 12, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.media-thumb:hover .play-button-glow {
  transform: scale(1.1);
  box-shadow: 0 0 28px rgba(234, 88, 12, 0.8);
}

/* Social Platform Accents */
.social-yt { border-top: 3px solid #ef4444; }
.social-tiktok { border-top: 3px solid #0f172a; }
.social-x { border-top: 3px solid #1d4ed8; }
.social-wa { border-top: 3px solid #16a34a; }
.social-linkedin { border-top: 3px solid #0284c7; }
.social-ig { border-top: 3px solid #ea580c; }

/* Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #ea580c;
}

@keyframes bounceSubtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.animate-bounce-subtle {
  animation: bounceSubtle 2.5s infinite ease-in-out;
}

/* ==========================================================================
   VOICE SOS & DISTRESS RECORDING STYLES
   ========================================================================== */
@keyframes recordPulseRing {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.75); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 16px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.record-pulse-active {
  animation: recordPulseRing 1.4s infinite ease-in-out;
}

@keyframes voiceWaveAnim {
  0%, 100% { height: 6px; }
  50% { height: 28px; }
}

.voice-wave-bar {
  width: 4px;
  background-color: #ef4444;
  border-radius: 9999px;
  display: inline-block;
  animation: voiceWaveAnim 1s infinite ease-in-out;
}
.voice-wave-bar:nth-child(2) { animation-delay: 0.15s; }
.voice-wave-bar:nth-child(3) { animation-delay: 0.3s; }
.voice-wave-bar:nth-child(4) { animation-delay: 0.45s; }
.voice-wave-bar:nth-child(5) { animation-delay: 0.2s; }
.voice-wave-bar:nth-child(6) { animation-delay: 0.35s; }
.voice-wave-bar:nth-child(7) { animation-delay: 0.5s; }
.voice-wave-bar:nth-child(8) { animation-delay: 0.1s; }

/* Floating Persistent Voice SOS Button (Bottom Centred) */
.floating-voice-sos {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.floating-voice-sos:hover {
  transform: translateX(-50%) translateY(-3px) scale(1.04);
}

/* Whisper Stealth Mode (High privacy, ultra-low glare screen) */
.stealth-mode-active {
  background-color: #020617 !important;
  color: #94a3b8 !important;
}
.stealth-mode-active .bg-white {
  background-color: #0f172a !important;
  color: #e2e8f0 !important;
  border-color: #1e293b !important;
}

/* ==========================================================================
   ASK BRIHUB RESPONSIVE INTERACTIVE CHATBOT (ALL DEVICE FORM FACTORS)
   ========================================================================== */

/* Launcher Container: Anchored at bottom right, adaptive margins */
.brihub-launcher-wrapper {
  position: fixed;
  bottom: 1.15rem;
  right: 1rem;
  z-index: 45;
  pointer-events: auto;
}

@media (min-width: 640px) {
  .brihub-launcher-wrapper {
    bottom: 1.5rem;
    right: 1.5rem;
  }
}

/* Launcher Button: Compact circular FAB on mobile (< 640px) to prevent collision with Voice SOS;
   Expands to informative pill on desktop (>= 640px) */
.brihub-launcher-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #012167 0%, #0284c7 60%, #0ea5e9 100%);
  color: #ffffff;
  border: 2px solid #7dd3fc;
  box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.4), 0 8px 10px -6px rgba(1, 33, 103, 0.3);
  cursor: pointer;
  user-select: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 639px) {
  .brihub-launcher-btn {
    width: 3.25rem;  /* 52px */
    height: 3.25rem; /* 52px */
    border-radius: 9999px;
    padding: 0;
  }
}

@media (min-width: 640px) {
  .brihub-launcher-btn {
    padding: 0.75rem 1.15rem;
    border-radius: 9999px;
  }
  .brihub-launcher-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 15px 30px -5px rgba(2, 132, 199, 0.5);
  }
}

.brihub-launcher-btn:active {
  transform: scale(0.94);
}

/* Chat Popup Window: Full-screen mobile bottom sheet with safe-area padding;
   Floating card modal on tablet & desktop */
.brihub-chat-popup-container {
  display: none; /* toggled to flex via JS */
  flex-direction: column;
  background-color: #ffffff;
  z-index: 50;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

/* Mobile Devices (< 640px): Edge-to-edge full height sheet */
@media (max-width: 639px) {
  .brihub-chat-popup-container {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    border-radius: 0;
    border: none;
  }
  .brihub-mobile-header {
    padding-top: max(0.875rem, env(safe-area-inset-top));
  }
  .brihub-mobile-footer {
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }
  .brihub-chat-input-field {
    font-size: 1rem !important; /* 16px prevents iOS Safari auto-zoom on focus */
  }
}

/* Tablets & Desktops (>= 640px): Elegant floating anchored card */
@media (min-width: 640px) {
  .brihub-chat-popup-container {
    position: fixed;
    bottom: 5.5rem; /* 88px */
    right: 1.5rem;  /* 24px */
    width: 420px;
    max-width: calc(100vw - 2rem);
    height: 570px;
    max-height: calc(100vh - 7rem);
    border-radius: 1.5rem; /* rounded-3xl */
    border: 1px solid #bae6fd; /* border-sky-200 */
  }
}

/* Mobile backdrop overlay */
.brihub-chat-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 49;
}
@media (min-width: 640px) {
  .brihub-chat-backdrop {
    display: none !important;
  }
}

/* Smooth slide animation */
@keyframes brihubSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.brihub-animate-in {
  animation: brihubSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}



