/* ==========================================================================
   Omor Ekushe - Authentic Bangladesh UI/UX & Dual Light/Dark Theme Engine
   Design Colors: National Emerald Green (#006A4E), National Red (#F42A41),
   Ekushe Gold (#D4AF37), Mint (#00E699), Slate (#64748B)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Light Theme Tokens
   -------------------------------------------------------------------------- */
:root,
[data-theme="light"] {
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-alt: #f1f5f9;
  --bg-nav: rgba(255, 255, 255, 0.94);
  --bg-hero: radial-gradient(circle at 50% 0%, rgba(0, 106, 78, 0.08) 0%, rgba(248, 250, 252, 1) 80%);
  --bg-footer: #021a13;
  --bg-card-hover: #ffffff;

  --border-color: #e2e8f0;
  --border-subtle: #cbd5e1;
  --border-emerald: rgba(0, 106, 78, 0.25);

  --text-heading: #004d38;
  --text-body: #1e293b;
  --text-muted: #64748b;
  --text-emerald: #006a4e;
  --text-red: #d91b36;
  --text-gold: #b48500;

  --bd-green: #006a4e;
  --bd-red: #f42a41;
  --bd-gold: #d4af37;

  --code-bg: #0f172a;
  --code-header-bg: #1e293b;
  --code-text: #38bdf8;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(0, 106, 78, 0.15);
  --shadow-red: 0 0 20px rgba(244, 42, 65, 0.25);
}

/* --------------------------------------------------------------------------
   Dark Theme Tokens
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
  --bg-app: #03140e;
  --bg-surface: #07261c;
  --bg-surface-alt: #0b382a;
  --bg-nav: rgba(3, 20, 14, 0.94);
  --bg-hero: radial-gradient(circle at 50% 0%, rgba(0, 230, 153, 0.12) 0%, rgba(3, 20, 14, 1) 80%);
  --bg-footer: #010d09;
  --bg-card-hover: #0c3a2b;

  --border-color: rgba(0, 230, 153, 0.18);
  --border-subtle: rgba(0, 230, 153, 0.3);
  --border-emerald: rgba(0, 230, 153, 0.35);

  --text-heading: #e2f5ee;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  --text-emerald: #00e699;
  --text-red: #ff3b5c;
  --text-gold: #ffc107;

  --bd-green: #00e699;
  --bd-red: #ff3b5c;
  --bd-gold: #ffc107;

  --code-bg: #010f0b;
  --code-header-bg: #031c15;
  --code-text: #a7f3d0;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 25px rgba(0, 230, 153, 0.25);
  --shadow-red: 0 0 25px rgba(255, 59, 92, 0.35);
}

/* Base Setup */
body {
  font-family: 'Inter', 'Hind Siliguri', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-body);
  line-height: 1.65;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-heading);
  transition: color 0.3s ease;
}

.font-outfit {
  font-family: 'Outfit', sans-serif;
}

.font-bangla {
  font-family: 'Hind Siliguri', sans-serif;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* National Flag Accent Top Bar */
.flag-accent-bar {
  height: 4px;
  background: linear-gradient(90deg, #006A4E 0%, #006A4E 75%, #F42A41 75%, #F42A41 100%);
  width: 100%;
}

/* Glass Navbar */
.navbar-glass {
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.3s ease, border-color 0.3s ease;
  z-index: 1030;
}

/* --------------------------------------------------------------------------
   CRITICAL FIX: Tailwind CSS vs Bootstrap Navbar Collapse Conflict
   Tailwind's .collapse utility sets visibility: collapse; which hides the
   navbar container in browsers. We explicitly override it for navbar-collapse.
   -------------------------------------------------------------------------- */
.navbar-collapse,
.navbar-collapse.collapse {
  visibility: visible !important;
}

@media (max-width: 991.98px) {
  .navbar-collapse.collapse:not(.show) {
    display: none !important;
  }

  .navbar-collapse.collapse.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

@media (min-width: 992px) {

  .navbar-expand-lg .navbar-collapse,
  .navbar-expand-lg .navbar-collapse.collapse {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* Brand styling */
.navbar-brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-circle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #006A4E 0%, #004D38 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1.5px solid var(--bd-gold);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.navbar-brand-logo:hover .brand-circle {
  transform: scale(1.05);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  color: var(--text-heading);
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.brand-bangla {
  color: var(--bd-red);
  font-size: 0.78rem;
  font-weight: 700;
  margin-left: 3px;
}

.brand-subtitle {
  color: var(--bd-green);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Nav links */
.nav-link {
  font-weight: 600;
  color: var(--text-heading) !important;
  padding: 0.5rem 0.85rem !important;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  visibility: visible !important;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-emerald) !important;
  background: rgba(0, 106, 78, 0.12);
}

.nav-divider {
  width: 1px;
  height: 24px;
  background: var(--border-color);
}

/* Theme Switcher Button */
.btn-theme-toggle,
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  color: var(--text-heading);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 1.1rem;
}

.btn-theme-toggle:hover,
.theme-toggle:hover {
  background: var(--border-emerald);
  color: var(--text-emerald);
  transform: rotate(20deg) scale(1.05);
}

/* Buttons */
.btn-github-nav,
.github-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 106, 78, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-heading) !important;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.45rem 1rem;
  border-radius: 50rem;
  text-decoration: none;
  transition: all 0.25s ease;
}

.btn-github-nav:hover,
.github-button:hover {
  background: rgba(0, 106, 78, 0.18);
  border-color: var(--text-emerald);
  color: var(--text-emerald) !important;
}

.btn-nav-cta,
.installer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #F42A41 0%, #D91B36 100%);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.5rem 1.4rem;
  border-radius: 50rem;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-red);
}

.btn-nav-cta:hover,
.installer-button:hover {
  background: linear-gradient(135deg, #ff4763 0%, #F42A41 100%);
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(244, 42, 65, 0.5);
  color: #ffffff !important;
}

/* Page Hero Banner */
.page-hero-banner {
  background: var(--bg-hero);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.3s ease;
}

.hero-bg-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse at center, rgba(0, 106, 78, 0.15), transparent 70%);
  pointer-events: none;
}

.badge-bd-pill-pulse {
  background: rgba(0, 106, 78, 0.1);
  color: var(--text-emerald);
  border: 1px solid var(--border-emerald);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.45rem 1.1rem;
  border-radius: 50rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #F42A41;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(244, 42, 65, 0.7);
  animation: pulse-red 1.8s infinite;
}

@keyframes pulse-red {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(244, 42, 65, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(244, 42, 65, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(244, 42, 65, 0);
  }
}

/* Action Buttons */
.btn-emerald-primary {
  background: linear-gradient(135deg, #006A4E 0%, #004D38 100%);
  color: #ffffff !important;
  font-weight: 700;
  padding: 0.85rem 2rem;
  border-radius: 14px;
  border: 1px solid rgba(0, 106, 78, 0.35);
  box-shadow: var(--shadow-glow);
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.btn-emerald-primary:hover {
  background: linear-gradient(135deg, #008a66 0%, #006A4E 100%);
  color: #ffffff !important;
  transform: translateY(-3px);
  box-shadow: 0 0 30px rgba(0, 106, 78, 0.4);
}

.btn-emerald-outline {
  border: 1.5px solid var(--border-emerald);
  color: var(--text-emerald);
  background: rgba(0, 106, 78, 0.05);
  font-weight: 700;
  padding: 0.85rem 1.8rem;
  border-radius: 14px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.btn-emerald-outline:hover {
  background: var(--text-emerald);
  color: #ffffff !important;
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

/* Cards & Surfaces */
.glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2rem;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: var(--shadow-md);
  height: 100%;
}

.glass-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-5px);
  border-color: var(--border-emerald);
  box-shadow: var(--shadow-glow);
}

.feature-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(0, 106, 78, 0.1);
  color: var(--text-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-color);
}

.feature-icon-box.red {
  background: rgba(244, 42, 65, 0.1);
  color: var(--text-red);
  border-color: rgba(244, 42, 65, 0.25);
}

.feature-icon-box.gold {
  background: rgba(212, 175, 55, 0.12);
  color: var(--text-gold);
  border-color: rgba(212, 175, 55, 0.3);
}

/* Live Keyboard Layout Simulator */
.simulator-box {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-emerald);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
}

.simulator-textarea {
  background: var(--bg-surface-alt);
  color: var(--text-body);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 1.25rem;
  padding: 1rem;
  width: 100%;
  resize: vertical;
  min-height: 130px;
  font-family: 'Hind Siliguri', sans-serif;
  transition: all 0.25s ease;
}

.simulator-textarea:focus {
  outline: none;
  border-color: var(--text-emerald);
  box-shadow: var(--shadow-glow);
}

.layout-pill-btn {
  background: var(--bg-surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 0.45rem 1.2rem;
  border-radius: 50rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.layout-pill-btn.active,
.layout-pill-btn:hover {
  background: linear-gradient(135deg, #006A4E 0%, #004D38 100%);
  color: #ffffff;
  border-color: var(--bd-gold);
  box-shadow: var(--shadow-sm);
}

/* Keycaps Visualizer (<kbd>) */
kbd.hotkey-cap {
  background-color: var(--bg-surface-alt);
  color: var(--text-heading);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 3px 0 var(--border-subtle), 0 3px 8px rgba(0, 0, 0, 0.15);
  padding: 0.35rem 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  font-weight: 700;
  display: inline-block;
}

kbd.hotkey-cap.gold {
  background-color: rgba(212, 175, 55, 0.15);
  color: var(--text-gold);
  border-color: var(--bd-gold);
}

/* Code Snippet Window */
.code-window {
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
}

.code-header {
  background: var(--code-header-bg);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.code-dots {
  display: flex;
  gap: 8px;
}

.code-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot-red {
  background: #F42A41;
}

.dot-yellow {
  background: #D4AF37;
}

.dot-green {
  background: #006A4E;
}

.code-body {
  padding: 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--code-text);
  overflow-x: auto;
  line-height: 1.55;
}

/* Download Cards */
.card-download {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  height: 100%;
}

.card-download.featured {
  border-color: var(--text-emerald);
  box-shadow: var(--shadow-glow);
}

.card-download.featured::before {
  content: 'RECOMMENDED INSTALLER';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #F42A41 0%, #D91B36 100%);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.35rem 1.2rem;
  border-radius: 50rem;
  box-shadow: var(--shadow-red);
}

.card-download:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow);
}

/* Repository & GitHub UI Chips */
.github-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all 0.25s ease;
}

.github-stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--text-emerald);
  box-shadow: var(--shadow-glow);
}

.github-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.github-stat-icon.green {
  background: rgba(0, 106, 78, 0.12);
  color: var(--text-emerald);
}

.github-stat-icon.red {
  background: rgba(244, 42, 65, 0.12);
  color: var(--text-red);
}

.github-stat-icon.gold {
  background: rgba(212, 175, 55, 0.15);
  color: var(--text-gold);
}

.github-stat-icon.dark {
  background: var(--bg-surface-alt);
  color: var(--text-heading);
}

.badge-stat {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  color: var(--text-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 50rem;
}

.btn-github-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 106, 78, 0.1);
  border: 1px solid var(--border-color);
  color: var(--text-heading);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.5rem 1.25rem;
  border-radius: 50rem;
  text-decoration: none;
  transition: all 0.25s ease;
}

.btn-github-star:hover {
  background: rgba(0, 106, 78, 0.2);
  color: var(--text-emerald);
  border-color: var(--text-emerald);
}

.tribute-pill {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--bd-gold);
  padding: 0.35rem 0.85rem;
  border-radius: 50rem;
}

/* Footer Styling */
.footer-custom {
  background: var(--bg-footer);
  color: #94a3b8;
  padding: 4.5rem 0 2rem;
  border-top: 3px solid #006A4E;
}

.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  display: inline-block;
  padding: 0.25rem 0;
}

.footer-links a:hover {
  color: #00E699;
  transform: translateX(4px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  margin-top: 3.5rem;
}

/* Floating Back to Top Button */
.btn-back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #006A4E 0%, #004D38 100%);
  color: #ffffff;
  border: 1.5px solid var(--bd-gold);
  box-shadow: var(--shadow-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index: 999;
}

.btn-back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.btn-back-to-top:hover {
  background: #F42A41;
  border-color: #ffffff;
  transform: translateY(-4px);
  box-shadow: var(--shadow-red);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 9px;
}

::-webkit-scrollbar-track {
  background: var(--bg-app);
}

::-webkit-scrollbar-thumb {
  background: #006A4E;
  border-radius: 5px;
  border: 2px solid var(--bg-app);
}

::-webkit-scrollbar-thumb:hover {
  background: #F42A41;
}

/* Mobile & Responsive Navigation Tweaks */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background: var(--bg-surface);
    padding: 1.25rem;
    border-radius: 16px;
    margin-top: 0.75rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
  }

  .nav-link {
    width: 100%;
    padding: 0.75rem 1rem !important;
  }

  .btn-theme-toggle,
  .theme-toggle {
    width: 100%;
    border-radius: 12px;
    justify-content: flex-start;
    padding: 0.6rem 1rem;
  }

  .btn-github-nav,
  .github-button,
  .btn-nav-cta,
  .installer-button {
    width: 100%;
    justify-content: center;
  }
}