:root {
  --primary: #e10600;
  --secondary: #ffffff;
  --accent: #00963f;
  --dark: #0a315f;
  --bg: #f3f5f7;
  --text: #111111;
  --muted: #5a5f6a;
}

body {
  font-family: 'SolaimanLipi', sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  background: var(--primary);
  color: #fff;
}

.topbar a,
.topbar strong {
  color: #fff;
}

.topbar-link {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}

.site-header {
  background: #fff;
  border-bottom: 5px solid var(--primary);
}

.site-header .logo {
  height: 60px;
  width: 60px;
  object-fit: contain;
  border-radius: 50%;
  background: var(--secondary);
  padding: 8px;
}

.brand h1 {
  font-size: 1.15rem;
  color: var(--dark);
}

.brand small {
  color: var(--muted);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-nav .nav-link {
  color: var(--dark) !important;
  font-weight: 600;
  padding: 0.55rem 0.9rem;
  border-radius: 50px;
}

.site-nav .nav-link:hover,
.site-nav .nav-link.active {
  color: var(--primary) !important;
  background: rgba(225, 16, 0, 0.08);
}

.language-switch {
  min-width: 100px;
}

.header-hero {
  position: relative;
  width: 100%;
  background-size: cover;
  background-position: center center;
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.header-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(224, 6, 0, 0.55), rgba(0, 150, 63, 0.45));
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 49, 106, 0.55);
}

.clear-cover-hero {
  min-height: 88vh;
  background-color: #f3f5f7;
}

.clear-cover-hero::before {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.18));
}

.hero-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-persona {
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.hero-persona h3,
.hero-persona h4 {
  color: #fff;
}

.profile-card {
  margin-top: -90px;
  background: rgba(255,255,255,0.95);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
}

.profile-picture {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid var(--secondary);
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}

.section-title {
  margin-bottom: 1.5rem;
  font-weight: 700;
  border-left: 6px solid var(--primary);
  padding-left: 1rem;
}

.card-blog, .card-event {
  border: none;
  border-radius: 18px;
  overflow: hidden;
}

.card-blog img, .card-event img {
  height: 190px;
  object-fit: cover;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background: #bf0500;
  border-color: #bf0500;
}

.btn-success {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-outline-light {
  color: var(--dark);
  border-color: rgba(10, 49, 95, 0.15);
}

.btn-outline-light:hover {
  background: rgba(10, 49, 95, 0.08);
}

.footer-logo {
  width: 128px;
  height: auto;
}

.site-footer {
  background: #0a2345;
  color: #fff;
}

.site-footer a {
  color: #fff;
}

.facebook-embed-card {
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.facebook-embed-card iframe {
  width: 100%;
  min-height: 260px;
  border: none;
}

.chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999;
}

.chat-toggle {
  border-radius: 999px;
  padding: 0.65rem 1rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.chat-panel {
  width: 360px;
  max-width: calc(100vw - 40px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.22);
  overflow: hidden;
  border: 1px solid rgba(10, 49, 95, 0.1);
}

.chat-header {
  background: linear-gradient(135deg, #0a315f, #0d4d8f);
  color: #fff;
  padding: 13px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-messages {
  height: 330px;
  overflow-y: auto;
  padding: 14px 12px;
  background: linear-gradient(180deg, #f8fafc, #eef3f8);
}

.leader-theme .section-title {
  border-left-color: #006e4b;
}

.leader-sidebar-card {
  border-radius: 14px;
  overflow: hidden;
}

.leader-sidebar-card .card-body {
  background: #f6fffb;
}

.leader-list .leader-btn {
  font-weight: 700;
  border-radius: 6px;
  text-align: left;
  padding: 0.6rem 0.75rem;
}

.leader-btn-idle {
  background: #007d57;
  color: #fff;
  border: 1px solid #007d57;
}

.leader-btn-idle:hover {
  background: #006948;
  color: #fff;
  border-color: #006948;
}

.leader-btn-active {
  background: #00563b;
  color: #fff;
  border: 1px solid #00563b;
}

.leader-detail-card {
  border-radius: 14px;
}

.leader-detail-body {
  background: #ffffff;
}

.leader-detail-image {
  max-height: 420px;
  object-fit: cover;
  width: 100%;
}

.chat-message {
  margin-bottom: 10px;
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.4;
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.chat-message.user {
  text-align: left;
  margin-left: auto;
  background: #0d4d8f;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-message.bot {
  text-align: left;
  margin-right: auto;
  background: #ffffff;
  color: #1f2937;
  border: 1px solid rgba(10, 49, 95, 0.12);
  border-bottom-left-radius: 4px;
}

.chat-message.typing {
  color: #4b5563;
  font-style: italic;
}

.chat-form {
  padding: 12px;
  border-top: 1px solid rgba(10, 49, 95, 0.1);
  background: #fff;
  display: grid;
  gap: 8px;
}

.chat-form input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(10, 49, 95, 0.18);
}

@media (max-width: 767px) {
  .topbar {
    text-align: center;
  }

  .site-header {
    padding: 0.5rem 0;
  }

  .site-nav {
    justify-content: center;
  }

  .profile-card {
    margin-top: -70px;
    text-align: center;
  }

  .hero-content {
    padding-top: 2rem;
  }
}

.profile-card {
  margin-top: -90px;
  background: rgba(255,255,255,0.95);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
}

.profile-picture {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid var(--secondary);
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}

.section-title {
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.card-blog, .card-event {
  border: none;
  border-radius: 18px;
  overflow: hidden;
}

.card-blog img, .card-event img {
  height: 190px;
  object-fit: cover;
}

.chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999;
}

.facebook-embed-card {
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.facebook-embed-card iframe {
  width: 100%;
  min-height: 260px;
  border: none;
}

.chat-toggle {
  border-radius: 50px;
}

.chat-panel {
  width: 320px;
  max-width: calc(100vw - 40px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.2);
  overflow: hidden;
}

.chat-header {
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-messages {
  height: 300px;
  overflow-y: auto;
  padding: 16px;
  background: #f8f9fa;
}

.chat-message {
  margin-bottom: 12px;
}

.chat-message.user {
  text-align: right;
}

.chat-message.bot {
  text-align: left;
}

.chat-form {
  padding: 16px;
}

.chat-form input {
  width: 100%;
}

.footer-logo {
  width: 128px;
  height: auto;
}

@media (max-width: 767px) {
  .profile-card {
    margin-top: -70px;
    text-align: center;
  }

  .hero-content {
    padding-top: 2rem;
  }
}

/* Final chat UI overrides */
.chat-widget .chat-toggle {
  border-radius: 999px;
  padding: 0.65rem 1rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.chat-widget .chat-panel {
  width: 360px;
  max-width: calc(100vw - 40px);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.22);
  border: 1px solid rgba(10, 49, 95, 0.1);
}

.chat-widget .chat-header {
  background: linear-gradient(135deg, #0a315f, #0d4d8f);
  padding: 13px 16px;
}

.chat-widget .chat-messages {
  height: 330px;
  padding: 14px 12px;
  background: linear-gradient(180deg, #f8fafc, #eef3f8);
}

.chat-widget .chat-message {
  margin-bottom: 10px;
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.4;
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.chat-widget .chat-message.user {
  margin-left: auto;
  background: #0d4d8f;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-widget .chat-message.bot {
  margin-right: auto;
  background: #fff;
  color: #1f2937;
  border: 1px solid rgba(10, 49, 95, 0.12);
  border-bottom-left-radius: 4px;
}

.chat-widget .chat-message.typing {
  color: #4b5563;
  font-style: italic;
}

.chat-widget .chat-form {
  padding: 12px;
  border-top: 1px solid rgba(10, 49, 95, 0.1);
  background: #fff;
  display: grid;
  gap: 8px;
}

.chat-widget .chat-form input {
  border-radius: 10px;
  border: 1px solid rgba(10, 49, 95, 0.18);
}

/* BNP-style home layout */
.bnp-top-banner {
  width: 100%;
  background: #fff;
}

.bnp-top-banner-img {
  width: 100%;
  height: auto;
  display: block;
}

.bnp-campaign-strip {
  background: linear-gradient(120deg, #005e4b, #006e56);
  color: #fff;
}

.bnp-strip-title {
  font-weight: 800;
  letter-spacing: 0.3px;
}

.bnp-manifesto-box {
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.14);
  display: inline-block;
  text-align: left;
}

.bnp-manifesto-box h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.bnp-manifesto-box p {
  margin-bottom: 8px;
}

.bnp-strip-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  padding: 8px;
}

.bnp-home-grid .bnp-panel {
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.bnp-block-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.bnp-points-panel {
  background: #17322f;
  color: #fff;
}

.bnp-point-item {
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 9px 10px;
  margin-bottom: 10px;
  font-weight: 600;
}

.bnp-quote {
  border-left: 4px solid var(--accent);
  padding-left: 12px;
  color: #1f2937;
}

.bnp-quote footer {
  font-size: 0.9rem;
  color: #0a315f;
  font-weight: 700;
}

.bnp-news-card {
  background: #fff;
  border: 1px solid rgba(10, 49, 95, 0.12);
  border-radius: 10px;
  padding: 12px;
  display: block;
  color: #111827;
  min-height: 110px;
}

.bnp-news-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

@media (max-width: 767px) {
  .bnp-manifesto-box {
    text-align: center;
  }

  .bnp-strip-logo {
    width: 72px;
    height: 72px;
  }
}

/* Bangladesh Political Theme (BNP-style) */
:root {
  --bd-green: #006a4e;
  --bd-green-dark: #00543f;
  --bd-red: #f42a41;
  --bd-red-dark: #d92037;
}

body {
  background: #f7faf8;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  border-bottom: 4px solid var(--bd-red);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.brand h1 {
  color: var(--bd-green-dark);
  font-weight: 800;
}

.site-nav .nav-link {
  color: var(--bd-green-dark) !important;
  font-weight: 700;
}

.site-nav .nav-link:hover,
.site-nav .nav-link.active {
  background: rgba(0, 106, 78, 0.08);
  color: var(--bd-red-dark) !important;
}

.site-nav .dropdown-menu {
  border: 1px solid rgba(0, 106, 78, 0.2);
  border-radius: 10px;
}

.site-nav .dropdown-item:active,
.site-nav .dropdown-item:hover {
  background: rgba(0, 106, 78, 0.08);
  color: var(--bd-green-dark);
}

.language-switch {
  border-color: rgba(0, 106, 78, 0.3);
  color: var(--bd-green-dark);
  font-weight: 700;
}

.language-switch:hover {
  background: rgba(0, 106, 78, 0.08);
  border-color: var(--bd-green);
}

.section-title {
  border-left-color: var(--bd-red);
  color: var(--bd-green-dark);
}

.btn-primary {
  background: var(--bd-red);
  border-color: var(--bd-red);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--bd-red-dark);
  border-color: var(--bd-red-dark);
}

.btn-success {
  background: var(--bd-green);
  border-color: var(--bd-green);
}

.btn-success:hover,
.btn-success:focus {
  background: var(--bd-green-dark);
  border-color: var(--bd-green-dark);
}

.bnp-campaign-strip {
  background:
    radial-gradient(circle at 15% 50%, rgba(244, 42, 65, 0.2), transparent 28%),
    linear-gradient(120deg, var(--bd-green), var(--bd-green-dark));
}

.bnp-strip-title {
  color: #fff;
}

.bnp-manifesto-box {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.18);
}

.bnp-home-grid .bnp-panel {
  border-top: 4px solid var(--bd-green);
}

.bnp-points-panel {
  background: linear-gradient(165deg, #18453b, #0d2f27);
}

.bnp-point-item {
  border-color: rgba(255, 255, 255, 0.35);
}

.bnp-quote {
  border-left-color: var(--bd-red);
}

.bnp-news-card {
  border: 1px solid rgba(0, 106, 78, 0.2);
}

.bnp-news-card strong {
  color: var(--bd-green-dark);
}

.bnp-news-card:hover {
  border-color: rgba(244, 42, 65, 0.4);
}

.site-footer {
  background: linear-gradient(135deg, #04362b, #062f55);
}

.chat-widget .chat-toggle {
  background: var(--bd-red);
  border-color: var(--bd-red);
}

.chat-widget .chat-toggle:hover {
  background: var(--bd-red-dark);
  border-color: var(--bd-red-dark);
}

.chat-widget .chat-header {
  background: linear-gradient(135deg, var(--bd-green-dark), var(--bd-green));
}

.chat-widget .chat-message.user {
  background: var(--bd-red);
}

.chat-widget .chat-message.bot {
  border-color: rgba(0, 106, 78, 0.25);
}

@media (max-width: 991px) {
  .site-header .container {
    gap: 10px;
    justify-content: center !important;
  }

  .site-nav {
    justify-content: center;
  }
}

/* Chat widget hard-fix: always floating at viewport bottom-right */
.chat-widget {
  position: fixed !important;
  right: 22px !important;
  bottom: 22px !important;
  left: auto !important;
  top: auto !important;
  z-index: 2147483000 !important;
  pointer-events: none;
}

.chat-widget > * {
  pointer-events: auto;
}

.chat-widget .chat-toggle {
  position: relative;
  z-index: 2;
}

.chat-widget .chat-panel {
  position: absolute !important;
  right: 0;
  bottom: 58px;
  margin: 0;
}

@media (max-width: 767px) {
  .chat-widget {
    right: 12px !important;
    bottom: 12px !important;
  }

  .chat-widget .chat-panel {
    right: 0;
    width: min(92vw, 360px) !important;
  }
}

/* ============================================================
   Home: full profile image (show the whole picture, no crop)
   ============================================================ */
.home-profile-img {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 16px;
  border: 4px solid var(--bd-green, #006a4e);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  background: #fff;
  object-fit: contain;
}

/* ============================================================
   Our Leaders — cards (need.php?section=leaders)
   ============================================================ */
.leader-card {
  border-radius: 14px;
  overflow: hidden;
  border-top: 4px solid var(--bd-green, #006a4e) !important;
  transition: transform 0.2s, box-shadow 0.2s;
}
.leader-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.12) !important;
}
.leader-card-img {
  height: 300px;
  object-fit: cover;
  object-position: top center;
  background: #eef4f1;
}
.leader-card .card-title {
  color: var(--bd-green-dark, #00543f);
  font-weight: 800;
}

/* ============================================================
   Leader detail page (leader.php) — BNP-style layout
   ============================================================ */
.leader-page {
  background: #f4f8f6;
}

.leader-banner {
  background: linear-gradient(120deg, var(--bd-green, #006a4e), var(--bd-green-dark, #00543f));
  border-radius: 12px;
  padding: 18px 24px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.10);
  border-left: 6px solid var(--bd-red, #f42a41);
}
.leader-banner-title {
  color: #fff;
  font-weight: 800;
  font-size: 1.55rem;
  text-align: center;
  letter-spacing: 0.2px;
}

/* Sidebar */
.leader-aside {
  position: sticky;
  top: 90px;
  background: #ffffff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.07);
  border: 1px solid rgba(0, 106, 78, 0.12);
}
.leader-aside-photo {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 3px solid var(--bd-green, #006a4e);
  background: #eef4f1;
  object-fit: cover;
}
.leader-aside hr {
  border-top: 1px dashed rgba(0, 106, 78, 0.3);
  opacity: 1;
}

.leader-nav-btn {
  background: var(--bd-green, #006a4e);
  color: #fff;
  font-weight: 700;
  text-align: center;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--bd-green, #006a4e);
  font-size: 0.95rem;
  transition: all 0.2s;
}
.leader-nav-btn:hover {
  background: var(--bd-green-dark, #00543f);
  color: #fff;
  border-color: var(--bd-green-dark, #00543f);
}
.leader-nav-btn.active {
  background: var(--bd-red, #f42a41);
  border-color: var(--bd-red, #f42a41);
  color: #fff;
  box-shadow: 0 4px 12px rgba(244, 42, 65, 0.30);
}

/* Detail content */
.leader-detail {
  background: #ffffff;
  border-radius: 14px;
  padding: 26px 30px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 106, 78, 0.10);
}
.leader-role {
  display: inline-block;
  background: rgba(0, 106, 78, 0.10);
  color: var(--bd-green-dark, #00543f);
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
}
.leader-intro {
  font-size: 1.08rem;
  line-height: 1.9;
  color: #24322c;
  font-weight: 500;
}
.leader-section-title {
  color: var(--bd-green-dark, #00543f);
  font-weight: 800;
  font-size: 1.35rem;
  margin-top: 1.8rem;
  margin-bottom: 0.8rem;
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(244, 42, 65, 0.5);
}
.leader-section-body {
  line-height: 1.95;
  color: #33413a;
  font-size: 1.02rem;
}

@media (max-width: 991.98px) {
  .leader-aside { position: static; margin-bottom: 1rem; }
  .leader-aside-photo { max-width: 260px; display: block; margin: 0 auto; }
  .leader-banner-title { font-size: 1.25rem; }
  .leader-detail { padding: 20px; }
}

/* ============================================================
   Mobile-friendly refinements  (phones ≤ 575px)
   ============================================================ */
/* Never let images overflow their box on small screens */
img { max-width: 100%; }

.home-profile-img {
  height: auto;          /* show the FULL profile image, never cropped */
  object-fit: contain;
}

@media (max-width: 575.98px) {
  /* Header brand smaller so it fits */
  .navbar-brand img { height: 42px; }
  .navbar-brand .h5 { font-size: 1.02rem; }
  .navbar-brand small { font-size: 0.68rem; }

  /* Home */
  .home-profile-img { max-width: 240px; }
  .bnp-strip-title { font-size: 1.25rem; }
  .bnp-strip-logo { width: 64px; height: 64px; }
  .section-title { font-size: 1.25rem; }

  /* Leader detail page */
  .leader-banner { padding: 12px 14px; }
  .leader-banner-title { font-size: 1.05rem; word-break: break-word; }
  .leader-aside { padding: 12px; }
  .leader-aside-photo { max-width: 220px; }
  .leader-detail { padding: 16px; border-radius: 12px; }
  .leader-role { font-size: 0.82rem; }
  .leader-intro { font-size: 0.98rem; line-height: 1.8; }
  .leader-section-title { font-size: 1.12rem; margin-top: 1.3rem; }
  .leader-section-body { font-size: 0.97rem; line-height: 1.85; }

  /* Leader cards */
  .leader-card-img { height: 240px; }

  /* Footer stacks & centers */
  .site-footer .text-md-end { text-align: left !important; }
}

/* Tablets (≤ 767px): keep the leader name banner readable */
@media (max-width: 767.98px) {
  .leader-banner-title { font-size: 1.2rem; }
  .leader-card-img { height: 260px; }
}

/* ============================================================
   Extra mobile safety — stop any horizontal overflow
   (fixed-width iframes / videos / embeds shrink to fit phone)
   ============================================================ */
img, iframe, video, embed, object {
  max-width: 100%;
}

/* Facebook video/post embeds: always fit the card width on phones */
.facebook-embed-card iframe {
  width: 100% !important;
  max-width: 100% !important;
  display: block;
}

@media (max-width: 575.98px) {
  .facebook-embed-card { padding: 8px !important; }
  .facebook-embed-card iframe { min-height: 300px; }
  .facebook-embeds .offset-lg-4 { margin-left: 0 !important; }
  /* Pagination wraps instead of overflowing */
  .pagination { flex-wrap: wrap; gap: 4px; }
}

/* Admin tables scroll horizontally on small screens instead of overflowing */
@media (max-width: 767.98px) {
  .table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}


/* ===== Hero slideshow (cover image + campaign videos, jcd.org.bd style) ===== */
.taj-hero {
  position: relative;
  width: 100%;
  /* Same footprint as the old cover.png banner (1215 x 880) */
  aspect-ratio: 1215 / 880;
  overflow: hidden;
  background: #00432f;
}

.taj-hero-track {
  position: absolute;
  inset: 0;
}

.taj-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease;
}

.taj-slide.is-active {
  opacity: 1;
  visibility: visible;
}

.taj-slide-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Subtle slow zoom (Ken Burns) on the active image slide for a premium feel */
.taj-slide[data-type="image"].is-active .taj-slide-media {
  animation: tajKenBurns 9s ease-out both;
}

@keyframes tajKenBurns {
  from { transform: scale(1.09); }
  to   { transform: scale(1); }
}

/* Green tint + diagonal stripe texture over the media */
.taj-hero-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    /* top scrim so the overlaid white navbar stays readable */
    linear-gradient(
      to bottom,
      rgba(0, 40, 28, 0.6) 0%,
      rgba(0, 40, 28, 0) 20%
    ),
    /* jcd.org.bd's diagonal 135deg party-green wash */
    linear-gradient(
      135deg,
      rgba(1, 71, 51, 0.82) 0%,
      rgba(6, 95, 70, 0.75) 40%,
      rgba(4, 120, 87, 0.70) 70%,
      rgba(6, 78, 59, 0.82) 100%
    );
  background-size: 100% 100%, 200% 200%;
  background-position: 0 0, 0% 50%;
  animation: tajMeshDrift 14s ease-in-out infinite;
}

/* Slow drift of the green wash — jcd's living "mesh" feel */
@keyframes tajMeshDrift {
  0%, 100% { background-position: 0 0, 0% 50%; }
  50%      { background-position: 0 0, 100% 50%; }
}

/* Grain/noise + faint diagonal texture (jcd-style) */
.taj-hero-grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40' fill='%23ffffff'/%3E%3C/svg%3E");
}
.taj-hero-grain::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* Soft floating emerald glow orbs (jcd's float-slow/medium blobs) */
.taj-hero-fx {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}
.taj-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
}
.taj-blob.b1 {
  width: 16rem; height: 16rem; left: -5rem; top: 22%;
  background: rgba(52, 211, 153, 0.14);
  animation: tajFloat 8s ease-in-out infinite;
}
.taj-blob.b2 {
  width: 20rem; height: 20rem; right: -4rem; top: 30%;
  background: rgba(134, 239, 172, 0.10);
  animation: tajFloat 6s ease-in-out -2s infinite;
}
.taj-blob.b3 {
  width: 12rem; height: 12rem; left: 33%; bottom: 12%;
  background: rgba(16, 185, 129, 0.12);
  animation: tajFloat 8s ease-in-out infinite;
}
@keyframes tajFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-22px) rotate(2deg); }
}

.taj-hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  color: #fff;
  z-index: 5;
}

.taj-hero-title {
  font-weight: 800;
  font-size: clamp(2rem, 5.5vw, 4.2rem);
  line-height: 1.1;
  margin-bottom: 0.75rem;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.35);
  max-width: 62%;
  animation: tajRise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.taj-hero-sub {
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  font-weight: 500;
  max-width: 52%;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  animation: tajRise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.taj-hero-btn {
  font-weight: 700;
  padding: 0.6rem 1.8rem;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
  animation: tajRise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

/* Text slides up + fades in on load (jcd's hero entrance) */
@keyframes tajRise {
  from { opacity: 0; transform: translateY(34px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Gentle light shimmer sweep across the title (jcd's text-shimmer) */
.taj-hero-title.taj-shimmer {
  background: linear-gradient(100deg, #ffffff 20%, #a7f3d0 42%, #ffffff 64%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 3px 14px rgba(0, 0, 0, 0.4));
  animation: tajShimmer 5s linear infinite,
             tajRise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}
@keyframes tajShimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* Arrows */
.taj-hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}

.taj-hero-arrow:hover {
  background: rgba(0, 0, 0, 0.5);
}

.taj-hero-prev { left: 18px; }
.taj-hero-next { right: 18px; }

/* Dots */
.taj-hero-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  z-index: 6;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.taj-dot {
  width: 11px;
  height: 11px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.taj-dot.is-active {
  background: #fff;
  transform: scale(1.15);
}

@media (max-width: 991.98px) {
  .taj-hero-title { max-width: 100%; }
  .taj-hero-sub { max-width: 85%; }
}

@media (max-width: 575.98px) {
  .taj-hero-title { max-width: 100%; }
  .taj-hero-sub { max-width: 100%; }
}

/* Respect users who prefer no motion */
@media (prefers-reduced-motion: reduce) {
  .taj-hero-overlay,
  .taj-blob,
  .taj-hero-title,
  .taj-hero-title.taj-shimmer,
  .taj-hero-sub,
  .taj-hero-btn,
  .taj-slide[data-type="image"].is-active .taj-slide-media {
    animation: none;
  }
}

/* ============================================================
   Chat widget — redesigned (contact choices + AI assistant)
   ============================================================ */
.chat-widget .chat-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; cursor: pointer;
  padding: 12px 20px; border-radius: 999px;
  background: linear-gradient(135deg, #006a4e, #00543f) !important;
  color: #fff; font-weight: 700; font-size: .98rem;
  box-shadow: 0 10px 26px rgba(0,84,63,.38);
  transition: transform .18s ease, box-shadow .18s ease;
}
.chat-widget .chat-toggle:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(0,84,63,.46); }
.chat-widget .chat-toggle i { font-size: 1.15rem; }
@media (max-width: 480px) { .chat-toggle-label { display: none; } .chat-widget .chat-toggle { padding: 14px; } }

.chat-widget .chat-panel {
  position: absolute; right: 0; bottom: 66px;
  width: 350px; max-width: calc(100vw - 32px);
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  border: 1px solid rgba(0,106,78,.14);
  animation: chatPop .22s cubic-bezier(.16,1,.3,1);
}
@keyframes chatPop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.chat-widget .chat-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 16px;
  background: linear-gradient(135deg, #00543f, #006a4e) !important;
  color: #fff;
}
.chat-head-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chat-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.6); background: #fff; }
.chat-head-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.chat-head-txt strong { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-status { font-size: .74rem; opacity: .92; display: inline-flex; align-items: center; gap: 6px; }
.chat-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.3); }
.chat-x { background: transparent; border: none; color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; opacity: .85; padding: 0 4px; }
.chat-x:hover { opacity: 1; }

/* Screen 1: contact choices */
.chat-choices { padding: 16px; }
.chat-choices-intro { font-weight: 600; color: #33413a; margin: 2px 2px 12px; font-size: .95rem; }
.chat-channel {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; margin-bottom: 10px;
  border: 1px solid rgba(0,0,0,.08); border-radius: 14px;
  text-decoration: none; color: #1f2937; background: #fff;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.chat-channel:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,.10); border-color: rgba(0,106,78,.25); }
.ch-ic { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 1.15rem; }
.ch-email .ch-ic { background: linear-gradient(135deg, #ea4335, #c5221f); }
.ch-wa .ch-ic { background: linear-gradient(135deg, #25d366, #128c7e); }
.ch-msg .ch-ic { background: linear-gradient(135deg, #00b2ff, #006aff); }
.ch-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.ch-txt strong { font-size: .95rem; }
.ch-txt small { color: #6b7280; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-arrow { margin-left: auto; color: #9ca3af; font-size: .8rem; }

.chat-skip {
  width: 100%; margin-top: 4px; padding: 11px 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px dashed rgba(0,106,78,.4); border-radius: 12px;
  background: rgba(0,106,78,.06); color: #00543f; font-weight: 700; cursor: pointer;
  transition: background .15s;
}
.chat-skip:hover { background: rgba(0,106,78,.12); }

/* Screen 2: AI chat */
.chat-ai { display: flex; flex-direction: column; }
.chat-back { align-self: flex-start; background: transparent; border: none; color: #00543f; font-weight: 600; padding: 10px 14px 4px; cursor: pointer; font-size: .85rem; }
.chat-back:hover { text-decoration: underline; }
.chat-widget .chat-ai .chat-messages { height: 300px; overflow-y: auto; padding: 12px 14px; background: linear-gradient(180deg, #f8faf9, #eef4f1); }
.chat-widget .chat-ai .chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid rgba(0,106,78,.12); background: #fff; }
.chat-widget .chat-ai .chat-form input { flex: 1; border-radius: 10px; border: 1px solid rgba(0,106,78,.2); }
.chat-widget .chat-ai .chat-form .btn { border-radius: 10px; white-space: nowrap; }
.chat-widget .chat-message { margin-bottom: 10px; max-width: 85%; padding: 9px 12px; border-radius: 12px; line-height: 1.4; font-size: .92rem; white-space: pre-wrap; }
.chat-widget .chat-message.user { margin-left: auto; background: #006a4e; color: #fff; border-bottom-right-radius: 4px; }
.chat-widget .chat-message.bot { margin-right: auto; background: #fff; color: #1f2937; border: 1px solid rgba(0,106,78,.15); border-bottom-left-radius: 4px; }
.chat-widget .chat-message.typing { color: #6b7280; font-style: italic; }

/* ---- Always-on "typing…" teaser + live pulse ---- */
.chat-teaser {
  position: absolute; right: 2px; bottom: 76px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 15px 9px 9px; border: none; cursor: pointer;
  background: #ffffff; border-radius: 22px 22px 22px 6px;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  animation: teaserBob 2.6s ease-in-out infinite;
}
.chat-teaser-av { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid #eaf3ee; }
.chat-teaser-text { display: inline-flex; align-items: center; font-weight: 600; font-size: .9rem; color: #14342a; white-space: nowrap; min-width: 118px; }
.chat-caret { display: inline-block; width: 2px; height: 15px; margin-left: 2px; background: #006a4e; animation: chatCaret 1s steps(1) infinite; }
@keyframes chatCaret { 50% { opacity: 0; } }
@keyframes teaserBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.chat-widget .chat-toggle { position: relative; }
.chat-widget .chat-toggle::before {
  content: ""; position: absolute; inset: 0; border-radius: 999px; pointer-events: none;
  box-shadow: 0 0 0 0 rgba(0,106,78,.45); animation: chatPulse 2.2s infinite;
}
@keyframes chatPulse {
  0%   { box-shadow: 0 0 0 0 rgba(0,106,78,.45); }
  70%  { box-shadow: 0 0 0 16px rgba(0,106,78,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,106,78,0); }
}
@media (prefers-reduced-motion: reduce) {
  .chat-teaser, .chat-caret, .chat-widget .chat-toggle::before { animation: none; }
}

/* ---- Prettier AI chat screen ---- */
.chat-widget .chat-ai .chat-messages { background: linear-gradient(180deg, #f4f9f6, #e9f3ee); padding: 14px; }
.chat-widget .chat-message { box-shadow: 0 2px 8px rgba(0,0,0,.06); font-size: .93rem; line-height: 1.45; border-radius: 16px; }
.chat-widget .chat-message.bot { border: none; background: #fff; border-bottom-left-radius: 5px; }
.chat-widget .chat-message.user { background: linear-gradient(135deg, #006a4e, #00543f); color: #fff; border-bottom-right-radius: 5px; }
.chat-widget .chat-message.typing { background: #fff; color: #6b7280; font-style: italic; }
.chat-widget .chat-ai .chat-form { padding: 10px; background: #fff; }
.chat-widget .chat-ai .chat-form input { border-radius: 999px; padding: .55rem 1rem; background: #f2f6f4; border: 1px solid #dfe9e4; }
.chat-widget .chat-ai .chat-form input:focus { background: #fff; border-color: #006a4e; box-shadow: 0 0 0 3px rgba(0,106,78,.12); }
.chat-widget .chat-ai .chat-form .btn { border-radius: 999px; padding: .55rem 1.15rem; font-weight: 700; }

/* ---- Mobile safety: never allow sideways scroll (clip keeps sticky header working) ---- */
@media (max-width: 767.98px) {
  html { overflow-x: clip; }
  .taj-hero-title { line-height: 1.12; }
  .taj-hero-content .container { padding-left: 18px; padding-right: 18px; }
}

/* ---- Performance: drop the GPU-heavy hero effects on phones (stops jank) ---- */
@media (max-width: 767.98px) {
  .taj-hero-fx { display: none; }        /* blurred glow orbs — expensive */
  .taj-hero-grain { display: none; }     /* noise repaint */
  .taj-hero-overlay { animation: none; } /* stop the drifting wash */
  .taj-slide[data-type="image"].is-active .taj-slide-media { animation: none; } /* no Ken-Burns zoom */
  .chat-teaser, .chat-widget .chat-toggle::before { animation: none; } /* calmer chat widget */
}

/* ---- Floating quick-contact buttons (WhatsApp / Telegram / Messenger) ---- */
.float-contact { position: fixed; right: 20px; bottom: 24px; z-index: 2147483000; display: flex; flex-direction: column; gap: 14px; }
.fc-btn { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 1.5rem; text-decoration: none; box-shadow: 0 10px 24px rgba(0,0,0,.25); transition: transform .18s ease; }
.fc-btn:hover { transform: scale(1.08); color: #fff; }
.fc-wa  { background: #25d366; }
.fc-tg  { background: #29a9ea; }
.fc-msg { background: linear-gradient(160deg, #22c07a, #0d9488); }
@media (max-width: 575.98px) { .float-contact { right: 14px; bottom: 16px; gap: 12px; } .fc-btn { width: 50px; height: 50px; font-size: 1.3rem; } }

/* ---- Smaller hero on desktop (was too tall) ---- */
@media (min-width: 768px) { .taj-hero { max-height: 600px; } }

/* ================= AI chat panel (opened by the floating chat button) ================= */
.aic-panel { position: fixed; right: 20px; bottom: 92px; width: 360px; max-width: calc(100vw - 32px);
  background: #fff; border-radius: 18px; overflow: hidden; z-index: 2147483001;
  display: flex; flex-direction: column; box-shadow: 0 26px 60px rgba(0,0,0,.30);
  animation: aicPop .22s cubic-bezier(.16,1,.3,1); }
.aic-panel.d-none { display: none; }
@keyframes aicPop { from { opacity:0; transform: translateY(14px) scale(.98); } to { opacity:1; transform:none; } }
.aic-head { background: linear-gradient(135deg,#00543f,#006a4e); color:#fff; padding:14px 16px; display:flex; align-items:center; justify-content:space-between; }
.aic-head .id { display:flex; align-items:center; gap:12px; min-width:0; }
.aic-head img { width:44px; height:44px; border-radius:50%; object-fit:cover; border:2px solid rgba(255,255,255,.6); background:#fff; }
.aic-head strong { display:block; font-size:.98rem; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.aic-head .st { font-size:.74rem; opacity:.92; display:inline-flex; align-items:center; gap:6px; }
.aic-head .st::before { content:""; width:8px; height:8px; border-radius:50%; background:#34d399; box-shadow:0 0 0 3px rgba(52,211,153,.3); }
.aic-x { background:transparent; border:none; color:#fff; font-size:1.7rem; line-height:1; cursor:pointer; opacity:.9; }
.aic-x:hover { opacity:1; }
.aic-msgs { height:350px; overflow-y:auto; padding:14px; background:linear-gradient(180deg,#f4f9f6,#e9f3ee); }
.aic-msg { max-width:85%; padding:9px 13px; border-radius:16px; margin-bottom:10px; font-size:.93rem; line-height:1.45;
  box-shadow:0 2px 8px rgba(0,0,0,.06); white-space:pre-wrap; word-wrap:break-word; }
.aic-msg.user { margin-left:auto; background:linear-gradient(135deg,#006a4e,#00543f); color:#fff; border-bottom-right-radius:5px; }
.aic-msg.bot  { margin-right:auto; background:#fff; color:#1f2937; border-bottom-left-radius:5px; }
.aic-form { display:flex; gap:8px; padding:10px; background:#fff; border-top:1px solid rgba(0,106,78,.12); }
.aic-form input { flex:1; border-radius:999px; border:1px solid #dfe9e4; padding:.55rem 1rem; background:#f2f6f4; }
.aic-form input:focus { outline:none; border-color:#006a4e; background:#fff; box-shadow:0 0 0 3px rgba(0,106,78,.12); }
.aic-send { border:none; border-radius:999px; padding:.55rem 1.15rem; font-weight:700; background:#006a4e; color:#fff; cursor:pointer; }
.aic-send:hover { background:#00432f; }
/* Animated "writing…" indicator (bouncing dots) */
.aic-typing { display:inline-flex; gap:6px; align-items:center; }
.aic-typing span { width:8px; height:8px; border-radius:50%; background:#93a49b; display:inline-block; animation: aicDot 1.2s infinite ease-in-out; }
.aic-typing span:nth-child(2) { animation-delay:.18s; }
.aic-typing span:nth-child(3) { animation-delay:.36s; }
@keyframes aicDot { 0%,60%,100% { transform:translateY(0); opacity:.4; } 30% { transform:translateY(-6px); opacity:1; } }
@media (max-width:575.98px){ .aic-panel { right:12px; bottom:84px; } .aic-msgs { height:300px; } }
