/* =========================================================================
   PERFECT BENGALI TYPOGRAPHY & TEXTBOOK NUMERALS (KALPURUSH & SOLAIMANLIPI)
   1. Textbook Numeral '১' (নকশামুক্ত আসল পাঠ্যপুস্তকের ১)
   2. Authentic Unified Ligatures: 'ন্দ' (আন্দোলনের), 'ক্ষ', 'জ্ঞ', 'স্থ', 'ষ্ণ'
   ========================================================================= */

/* Kalpurush - Regular (400) */
@font-face {
  font-family: 'Kalpurush';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Kalpurush'),
       url('/assets/fonts/Kalpurush.ttf') format('truetype');
}

/* Kalpurush - Medium (500) */
@font-face {
  font-family: 'Kalpurush';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: local('Kalpurush'),
       url('/assets/fonts/Kalpurush.ttf') format('truetype');
}

/* Kalpurush - SemiBold (600) */
@font-face {
  font-family: 'Kalpurush';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: local('Kalpurush'),
       url('/assets/fonts/Kalpurush.ttf') format('truetype');
}

/* Kalpurush - Bold (700) */
@font-face {
  font-family: 'Kalpurush';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Kalpurush Bold'), local('Kalpurush'),
       url('/assets/fonts/Kalpurush.ttf') format('truetype');
}

/* Kalpurush - ExtraBold (800) */
@font-face {
  font-family: 'Kalpurush';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: local('Kalpurush Bold'), local('Kalpurush'),
       url('/assets/fonts/Kalpurush.ttf') format('truetype');
}

/* Kalpurush - Black (900) */
@font-face {
  font-family: 'Kalpurush';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: local('Kalpurush Bold'), local('Kalpurush'),
       url('/assets/fonts/Kalpurush.ttf') format('truetype');
}

/* SolaimanLipi - Regular (400) */
@font-face {
  font-family: 'SolaimanLipi';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('SolaimanLipi'), local('SolaimanLipi Normal'),
       url('/assets/fonts/SolaimanLipi.woff') format('woff'),
       url('/assets/fonts/SolaimanLipi.ttf') format('truetype');
}

/* SolaimanLipi - Medium (500) */
@font-face {
  font-family: 'SolaimanLipi';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: local('SolaimanLipi'), local('SolaimanLipi Normal'),
       url('/assets/fonts/SolaimanLipi.woff') format('woff'),
       url('/assets/fonts/SolaimanLipi.ttf') format('truetype');
}

/* SolaimanLipi - SemiBold (600) */
@font-face {
  font-family: 'SolaimanLipi';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: local('SolaimanLipi Bold'), local('SolaimanLipi'),
       url('/assets/fonts/SolaimanLipi.woff') format('woff'),
       url('/assets/fonts/SolaimanLipi.ttf') format('truetype');
}

/* SolaimanLipi - Bold (700) */
@font-face {
  font-family: 'SolaimanLipi';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('SolaimanLipi Bold'), local('SolaimanLipi'),
       url('/assets/fonts/SolaimanLipi.woff') format('woff'),
       url('/assets/fonts/SolaimanLipi.ttf') format('truetype');
}

/* SolaimanLipi - ExtraBold (800) */
@font-face {
  font-family: 'SolaimanLipi';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: local('SolaimanLipi Bold'), local('SolaimanLipi'),
       url('/assets/fonts/SolaimanLipi.woff') format('woff'),
       url('/assets/fonts/SolaimanLipi.ttf') format('truetype');
}

/* SolaimanLipi - Black (900) */
@font-face {
  font-family: 'SolaimanLipi';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: local('SolaimanLipi Bold'), local('SolaimanLipi'),
       url('/assets/fonts/SolaimanLipi.woff') format('woff'),
       url('/assets/fonts/SolaimanLipi.ttf') format('truetype');
}

/* =========================================================================
   GLOBAL BENGALI RENDERING & SHAPING ENGINE
   ========================================================================= */

:root {
  --font-bangla: 'Kalpurush', 'SolaimanLipi', 'Vrinda', 'Siyam Rupali', 'Nirmala UI', 'Shonar Bangla', sans-serif;
}

html, body, button, input, textarea, select, optgroup, option {
  font-family: var(--font-bangla) !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fallback for monospace containing Bengali numerals or words */
code, kbd, samp, pre, .font-mono, [class*="font-mono"] {
  font-family: 'Kalpurush', 'SolaimanLipi', Consolas, 'Courier New', monospace;
}

/* Never allow artificial letter-spacing to rip Bengali conjuncts apart */
html:lang(bn) *,
[lang="bn"] *,
body, p, span, h1, h2, h3, h4, h5, h6, div, label, button, a, strong, b, em, small {
  letter-spacing: normal !important;
}


/* Custom Styles for Awami Digital Network */

/* Custom scrollbars */
.scrollbar-thin::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 9999px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background: rgba(51, 65, 85, 0.8);
  border-radius: 9999px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.6);
}

/* Cheer / Joy Bangla burst effect */
@keyframes cheerPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.35) rotate(-5deg); }
  100% { transform: scale(1); }
}

.cheer-animate {
  animation: cheerPop 0.3s ease-out;
}

/* Chat bubble subtle gradients */
.chat-bubble-me {
  background: linear-gradient(135deg, #006a4e 0%, #064e3b 100%);
}

.chat-bubble-other {
  background: rgba(30, 41, 59, 0.9);
}

/* Glass background */
.glass-panel {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Active indicator pulse */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(16, 185, 129, 0.3); }
  50% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.7); }
}

.active-seat-card {
  border-color: #059669 !important;
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.4) 0%, rgba(15, 23, 42, 0.9) 100%) !important;
  animation: pulseGlow 3s infinite;
}

/* Telegram Voice Chat Animated Rings */
@keyframes tgWaveGreen {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.8), 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 15px rgba(16, 185, 129, 0), 0 0 0 30px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0), 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes tgWaveBlue {
  0% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.8); }
  50% { box-shadow: 0 0 0 18px rgba(14, 165, 233, 0); }
  100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
}

.tg-speaking-wave {
  animation: tgWaveGreen 1.8s infinite ease-out;
}

.tg-speaking-wave-leader {
  animation: tgWaveBlue 1.6s infinite ease-out;
}

/* Telegram Floating Banner Gradient */
.tg-bar-gradient {
  background: linear-gradient(90deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
}

/* Telegram Soundwave Equalizer Bars */
@keyframes tgEqualizer {
  0% { height: 4px; }
  50% { height: 18px; }
  100% { height: 4px; }
}

.tg-bar-1 { animation: tgEqualizer 0.8s ease-in-out infinite; }
.tg-bar-2 { animation: tgEqualizer 0.6s ease-in-out infinite 0.2s; }
.tg-bar-3 { animation: tgEqualizer 1.1s ease-in-out infinite 0.4s; }
.tg-bar-4 { animation: tgEqualizer 0.7s ease-in-out infinite 0.1s; }
.tg-bar-5 { animation: tgEqualizer 0.9s ease-in-out infinite 0.3s; }

/* Telegram Mic Big Button Glow */
@keyframes tgMicLiveGlow {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 20px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.tg-mic-live {
  animation: tgMicLiveGlow 1.5s infinite;
}

/* ================= FACEBOOK-STYLE UI ENHANCEMENTS ================= */

/* Facebook Stories Tray Horizontal Scroll */
.stories-scroll {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 0.35rem;
  -webkit-overflow-scrolling: touch;
}

.stories-scroll::-webkit-scrollbar {
  display: none;
}

.story-card {
  position: relative;
  flex-shrink: 0;
  width: 110px;
  height: 168px;
  border-radius: 1.15rem;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  user-select: none;
}

.story-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 25px -4px rgba(0, 0, 0, 0.6);
}

.story-card-avatar-ring {
  box-shadow: 0 0 0 3px #10b981;
}

.story-card-avatar-ring-live {
  box-shadow: 0 0 0 3px #ef4444;
  animation: pulseGlowRed 1.8s infinite;
}

@keyframes pulseGlowRed {
  0%, 100% { box-shadow: 0 0 0 3px #ef4444, 0 0 10px rgba(239, 68, 68, 0.5); }
  50% { box-shadow: 0 0 0 4px #dc2626, 0 0 18px rgba(239, 68, 68, 0.8); }
}

/* Facebook Story Viewer Progress Bar */
@keyframes storyProgress {
  from { width: 0%; }
  to { width: 100%; }
}

.story-progress-active {
  animation: storyProgress 6s linear forwards;
}

/* Facebook Reaction Popover */
.reaction-popover {
  animation: fbReactionPopup 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fbReactionPopup {
  0% { opacity: 0; transform: translateY(8px) scale(0.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.reaction-btn-icon:hover {
  transform: scale(1.3) translateY(-4px);
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Facebook Comment Bubble */
.fb-comment-bubble {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 1.15rem;
  padding: 0.6rem 0.9rem;
}

/* Subtle Facebook Post Card Elevation */
.fb-post-card {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fb-post-card:hover {
  border-color: rgba(51, 65, 85, 0.9);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

/* ================= MOBILE RESPONSIVENESS ENHANCEMENTS ================= */
@media (max-width: 1023px) {
  /* Feed Column: Natural full scroll with bottom clearance */
  #colFeed:not(.hidden) {
    display: flex !important;
    flex-direction: column !important;
    height: calc(100vh - 120px) !important;
    height: calc(100dvh - 120px) !important;
    width: 100% !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5.5rem !important;
  }

  /* 300 Seats Explorer Column: Fixed search on top, scrollable list below */
  #colNavigator:not(.hidden) {
    display: flex !important;
    flex-direction: column !important;
    height: calc(100vh - 120px) !important;
    height: calc(100dvh - 120px) !important;
    width: 100% !important;
    overflow: hidden !important;
    padding-bottom: 4.5rem !important;
  }
  #colNavigator:not(.hidden) #seatsListContainer {
    flex: 1 1 0% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Chat Messenger Column: Pinned input at bottom, scrollable message stream */
  #colChat:not(.hidden) {
    display: flex !important;
    flex-direction: column !important;
    height: calc(100vh - 120px) !important;
    height: calc(100dvh - 120px) !important;
    width: 100% !important;
    overflow: hidden !important;
    padding-bottom: 4.5rem !important;
  }
  #colChat:not(.hidden) #chatMessagesContainer {
    flex: 1 1 0% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Support iOS safe area for modern mobile browsers */
  nav.lg\:hidden {
    padding-bottom: max(0.45rem, env(safe-area-inset-bottom, 0.45rem));
  }

  /* Smooth momentum touch scrolling on mobile */
  #colNavigator, #colFeed, #colChat, .stories-scroll {
    -webkit-overflow-scrolling: touch;
  }

  /* Mobile reaction bar compact spacing */
  .reaction-btn-icon {
    font-size: 1.25rem !important;
  }
}

@media (max-width: 640px) {
  /* Facebook Mobile Compact Stories Tray */
  .story-card {
    width: 86px !important;
    height: 130px !important;
    border-radius: 0.95rem !important;
  }
  .story-card img.w-9.h-9 {
    width: 1.85rem !important;
    height: 1.85rem !important;
  }
  .story-card h5 {
    font-size: 9.5px !important;
    line-height: 1.15 !important;
  }
  .stories-scroll {
    gap: 0.45rem !important;
    padding-bottom: 0.25rem !important;
  }

  /* Compact Post Cards on small screens */
  .fb-post-card {
    padding: 0.75rem !important;
    border-radius: 1rem !important;
  }

  /* Compact Three Dots Drawer on mobile */
  #threeDotsDrawer {
    width: 86vw !important;
    max-width: 340px !important;
  }
}

/* ================= INTERNATIONAL STANDARD APP POLISH ================= */
:root {
  color-scheme: dark;
}

body {
  background-color: #020617;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(16, 185, 129, 0.10) 0px, transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(220, 38, 38, 0.08) 0px, transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(30, 41, 59, 0.6) 0px, transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

/* Floating Reaction Particles (Facebook Live / Instagram Live Hearts) */
.floating-reaction {
  position: fixed;
  bottom: 80px;
  right: 25px;
  pointer-events: none;
  z-index: 9999;
  font-size: 1.85rem;
  animation: floatUpAndDrift 2.4s ease-out forwards;
}

@keyframes floatUpAndDrift {
  0% {
    opacity: 1;
    transform: translateY(0) scale(0.6) rotate(0deg);
  }
  20% {
    transform: translateY(-40px) scale(1.2) rotate(-8deg);
  }
  50% {
    transform: translateY(-110px) translateX(15px) scale(1.05) rotate(6deg);
  }
  80% {
    opacity: 0.8;
    transform: translateY(-190px) translateX(-12px) scale(0.95) rotate(-4deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-260px) translateX(8px) scale(0.7) rotate(0deg);
  }
}

/* Micro-interaction tap animation for touch buttons */
button:active {
  transform: scale(0.96);
  transition: transform 0.08s ease;
}

/* Premium App Card Refinement */
.fb-post-card {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Stories Ring Iridescent Gradient */
.story-ring-live {
  background: linear-gradient(45deg, #f43f5e, #fbbf24, #10b981);
  padding: 2.5px;
  border-radius: 9999px;
  animation: rotateStoryGrad 4s linear infinite;
}

@keyframes rotateStoryGrad {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* ================= FACEBOOK MESSENGER & MEETING ROOMS POLISH ================= */
#messengerModal, #callModal, #meetingRoomModal {
  user-select: none;
}

#meetingVideoGrid {
  align-content: start;
}

#meetingVideoGrid video {
  background-color: #020617;
  object-fit: cover;
}

.pulse-call-ring {
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseCallGreen 2s infinite;
}

@keyframes pulseCallGreen {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 24px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}



/* ==========================================================================
   FACEBOOK SUITE STYLES (Gradients, Reactions, Touch & Mobile Optimization)
   ========================================================================== */

/* Facebook Colored Post / Story Gradients */
.fb-bg-emerald {
  background: linear-gradient(135deg, #059669 0%, #064e3b 100%) !important;
  color: #ffffff !important;
}
.fb-bg-crimson {
  background: linear-gradient(135deg, #e11d48 0%, #881337 100%) !important;
  color: #ffffff !important;
}
.fb-bg-purple {
  background: linear-gradient(135deg, #7c3aed 0%, #4c1d95 100%) !important;
  color: #ffffff !important;
}
.fb-bg-amber {
  background: linear-gradient(135deg, #d97706 0%, #78350f 100%) !important;
  color: #ffffff !important;
}
.fb-bg-ocean {
  background: linear-gradient(135deg, #0284c7 0%, #075985 100%) !important;
  color: #ffffff !important;
}
.fb-bg-midnight {
  background: linear-gradient(135deg, #1e293b 0%, #090d16 100%) !important;
  color: #ffffff !important;
}

/* Facebook Reaction Popover */
.reaction-popover {
  animation: fbReactionPopup 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes fbReactionPopup {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(0.92); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.reaction-btn-icon:hover {
  transform: scale(1.35) translateY(-5px);
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.reaction-btn-icon:active {
  transform: scale(1.1);
}

/* Touch friendly reactions drawer toggle */
.reaction-popover.active-touch {
  display: flex !important;
}

/* Scrollbar hide for horizontal tabs */
.scrollbar-none::-webkit-scrollbar {
  display: none;
}
.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
