/* ============================================
   Biography App — Custom CSS
   Bootstrap 5.3 Overrides + Custom Components
   ============================================ */

/* --- CSS Variables --- */
:root {
  --zia-primary: #1a5632;
  --zia-accent: #c9a227;
  --zia-gradient: linear-gradient(135deg, #1a5632 0%, #2d8a56 40%, #c9a227 100%);

  --khaleda-primary: #5b2c6f;
  --khaleda-accent: #e8a0bf;
  --khaleda-gradient: linear-gradient(135deg, #5b2c6f 0%, #8e44ad 40%, #e8a0bf 100%);

  --tarique-primary: #1a2a6c;
  --tarique-accent: #4facfe;
  --tarique-gradient: linear-gradient(135deg, #1a2a6c 0%, #2d5fad 40%, #4facfe 100%);

  --arafat-primary: #0d7377;
  --arafat-accent: #a8a8a8;
  --arafat-gradient: linear-gradient(135deg, #0d7377 0%, #14919b 40%, #a8a8a8 100%);

  --glass-bg: rgba(255,255,255,0.15);
  --glass-border: rgba(255,255,255,0.25);
  --shadow-soft: 0 8px 32px rgba(0,0,0,0.08);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.06);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
}

/* --- Bootstrap Overrides --- */
body {
  font-family: 'Hind Siliguri', 'Inter', sans-serif;
  font-size: 1.1rem;
  line-height: 1.85;
  color: #2c2c2c;
  background: #fafafa;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
}
h1 { font-size: 3rem; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.6rem; }
p { margin-bottom: 1.2rem; }

.container { max-width: 1100px; }

a { text-decoration: none; transition: all 0.3s ease; }
img { max-width: 100%; height: auto; }

/* --- Navbar --- */
.navbar-bio {
  padding: 14px 0;
  transition: background 0.4s ease, box-shadow 0.4s ease;
  z-index: 1050;
}
.navbar-bio.scrolled {
  background: rgba(255,255,255,0.95) !important;
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}
.navbar-bio .nav-link {
  font-weight: 500;
  font-size: 1rem;
  padding: 8px 18px;
  border-radius: 50px;
  transition: all 0.3s;
}
.navbar-bio .nav-link:hover,
.navbar-bio .nav-link.active {
  background: rgba(0,0,0,0.06);
}
.navbar-bio .navbar-brand {
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.5px;
}

/* --- Hero Section --- */
.section-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  position: relative;
  padding: 120px 20px 80px;
}
.section-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(to top, #fafafa, transparent);
  pointer-events: none;
}
.hero-img {
  width: 220px;
  height: 280px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 4px solid rgba(255,255,255,0.4);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  margin-bottom: 28px;
}
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 6px 22px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}
.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  text-shadow: 0 4px 20px rgba(0,0,0,0.3);
  margin-bottom: 10px;
}
.hero-subtitle {
  font-size: 1.3rem;
  opacity: 0.9;
  font-weight: 300;
}
.hero-dates {
  font-size: 1.1rem;
  opacity: 0.8;
  margin-top: 8px;
}

/* --- Quick Info Bar --- */
.quick-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding: 30px 0;
}
.quick-pill {
  background: #fff;
  border: 1px solid #e8e8e8;
  padding: 10px 22px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 8px;
}
.quick-pill .pill-icon {
  width: 20px;
  height: 20px;
  opacity: 0.6;
}

/* --- Section Base --- */
.bio-section {
  padding: 80px 0;
  position: relative;
}
.bio-section:nth-child(even) {
  background: #f4f4f4;
}
.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
  opacity: 0.5;
}
.section-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 30px;
  position: relative;
}
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  border-radius: 2px;
  margin-top: 14px;
}

/* Per-page title underline colors */
.page-zia .section-title::after { background: var(--zia-accent); }
.page-khaleda .section-title::after { background: var(--khaleda-accent); }
.page-tarique .section-title::after { background: var(--tarique-accent); }
.page-arafat .section-title::after { background: var(--arafat-accent); }

/* --- Glass Card --- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 30px;
  color: #fff;
}

/* --- Content Card --- */
.content-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-soft);
  border: 1px solid #f0f0f0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.content-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

/* --- Achievement Card --- */
.achievement-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border-left: 4px solid;
  transition: transform 0.3s;
}
.achievement-card:hover { transform: translateY(-3px); }
.achievement-card h5 { font-size: 1.1rem; margin-bottom: 8px; }
.achievement-card p { font-size: 0.95rem; color: #666; margin: 0; }

/* --- Timeline --- */
.timeline {
  position: relative;
  padding: 20px 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 3px;
  background: #ddd;
  transform: translateX(-50%);
}
.timeline-item {
  display: flex;
  margin-bottom: 40px;
  position: relative;
}
.timeline-item:nth-child(odd) { flex-direction: row; }
.timeline-item:nth-child(even) { flex-direction: row-reverse; }
.timeline-content {
  width: 45%;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
  position: relative;
}
.timeline-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid;
  z-index: 2;
  top: 30px;
}
.timeline-year {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 6px;
  opacity: 0.7;
}

/* --- Dark Section --- */
.section-dark {
  background: #1a1a2e !important;
  color: #e0e0e0;
}
.section-dark .section-title { color: #fff; }
.section-dark .section-label { color: rgba(255,255,255,0.4); }

/* --- Emotional / Mourning Section --- */
.section-mourning {
  background: linear-gradient(180deg, #111 0%, #1a1a1a 100%) !important;
  color: #ccc;
}
.section-mourning .section-title { color: #fff; }

/* --- Victory Section --- */
.section-victory {
  background: linear-gradient(135deg, #f0fff4 0%, #e8f5e9 100%) !important;
}

/* --- Quote Block --- */
.quote-block {
  background: rgba(0,0,0,0.03);
  border-left: 5px solid;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 28px 32px;
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.9;
  margin: 30px 0;
  position: relative;
}
.quote-block::before {
  content: '"';
  font-size: 4rem;
  position: absolute;
  top: -10px;
  left: 12px;
  opacity: 0.15;
  font-family: Georgia, serif;
}
.quote-block cite {
  display: block;
  margin-top: 12px;
  font-size: 0.9rem;
  font-style: normal;
  font-weight: 600;
  opacity: 0.6;
}

/* --- Family Tree --- */
.family-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 40px 0;
}
.tree-level {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  position: relative;
}
.tree-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}
.tree-node-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ddd;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.tree-node-name {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
}
.tree-node-relation {
  font-size: 0.75rem;
  color: #888;
}
.tree-connector {
  width: 2px;
  height: 30px;
  background: #ccc;
  margin: 0 auto;
}
.tree-h-line {
  height: 2px;
  background: #ccc;
  margin: 0 auto;
}

/* --- Gallery Masonry --- */
.gallery-masonry {
  columns: 3;
  column-gap: 16px;
}
.gallery-masonry img {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s;
}
.gallery-masonry img:hover {
  transform: scale(1.02);
}

/* --- Stats Row --- */
.stat-box {
  text-align: center;
  padding: 24px 16px;
}
.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 0.85rem;
  opacity: 0.6;
  font-weight: 500;
}

/* --- Table Styled --- */
.table-bio {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.table-bio thead th {
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.table-bio td { vertical-align: middle; }

/* --- Footer --- */
.footer-bio {
  background: #1a1a2e;
  color: #aaa;
  padding: 50px 0 30px;
}
.footer-bio a { color: #ccc; }
.footer-bio a:hover { color: #fff; }
.footer-bio h6 { color: #fff; font-weight: 600; margin-bottom: 16px; }
.footer-source {
  font-size: 0.8rem;
  opacity: 0.5;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* --- Fade In Animation --- */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Election Table Highlight --- */
.table-bio .won { background: #e8f5e9; font-weight: 600; }

/* --- Responsive --- */
@media (max-width: 991px) {
  .hero-title { font-size: 2.5rem; }
  .section-title { font-size: 1.8rem; }
  h1 { font-size: 2.4rem; }
  .gallery-masonry { columns: 2; }
  .timeline::before { left: 20px; }
  .timeline-item,
  .timeline-item:nth-child(even) { flex-direction: column; padding-left: 50px; }
  .timeline-content { width: 100%; }
  .timeline-dot { left: 20px; }
}
@media (max-width: 575px) {
  body { font-size: 1rem; }
  .hero-title { font-size: 2rem; }
  .hero-img { width: 160px; height: 200px; }
  .section-title { font-size: 1.5rem; }
  .bio-section { padding: 50px 0; }
  .gallery-masonry { columns: 1; }
  .tree-level { gap: 20px; }
  .tree-node-img { width: 60px; height: 60px; }
  .stat-number { font-size: 2rem; }
  .content-card { padding: 20px; }
}

/* ============================================
   INDEX PAGE — Soft Waving Gradient Background
   Colors: BD flag (green #006a4e, red #ce1126)
           BNP flag (red, green, sky blue #4facfe)
   ============================================ */
.page-index-clean {
  background: #002b1e;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

.flag-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  background:
    linear-gradient(
      135deg,
      #006a4e 0%,
      #007a56 12%,
      #005a3c 22%,
      #8b1a1a 35%,
      #ce1126 45%,
      #8b1a1a 55%,
      #004d35 65%,
      #1a3a5c 78%,
      #4facfe 88%,
      #2d6a9f 100%
    );
  background-size: 300% 300%;
  animation: waveFlow 10s ease-in-out infinite;
}

@keyframes waveFlow {
  0%   { background-position: 0% 50%; }
  25%  { background-position: 50% 0%; }
  50%  { background-position: 100% 50%; }
  75%  { background-position: 50% 100%; }
  100% { background-position: 0% 50%; }
}

/* Soft overlay for depth */
.flag-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(0,0,0,0) 0%, rgba(0,0,0,0.25) 100%);
  pointer-events: none;
}

.index-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 15px 60px;
  color: #fff;
  position: relative;
  z-index: 1;
}

@media (max-width: 767px) {
  .index-hero {
    min-height: auto;
    padding: 30px 10px 30px;
  }
  .flag-bg { position: absolute; }
}
.index-label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 6px;
}

/* Dhaner Shish GIF */
.dhaner-shish-gif {
  width: 100px;
  height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 4px 20px rgba(201, 162, 39, 0.4));
  animation: gentle-float 3s ease-in-out infinite;
}
@keyframes gentle-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@media (max-width: 575px) {
  .dhaner-shish-gif { width: 70px; height: 70px; }
}
.index-title {
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.index-sub {
  font-size: 0.95rem;
  opacity: 0.55;
}

/* Family tree on index — slightly larger */
.family-tree-index .tree-node-img {
  width: 76px;
  height: 76px;
  transition: transform 0.3s, box-shadow 0.3s;
}
.family-tree-index .tree-node-name {
  color: #e0e0e0;
}
.family-tree-index .tree-node-relation {
  color: #888;
}
.family-tree-index .tree-connector {
  background: #555;
}

/* Clickable tree nodes */
.tree-node-link {
  text-decoration: none;
  cursor: pointer;
}
.tree-node-link .tree-node-img {
  border: 3px solid rgba(255,255,255,0.5);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.tree-node-link:hover .tree-node-img {
  transform: scale(1.15);
  box-shadow: 0 6px 24px rgba(255,255,255,0.25);
  border-color: #fff;
}
.tree-node-link:hover .tree-node-name {
  color: #fff;
}

/* Spacers for tree alignment */
.tree-spacer-lg { width: 50px; flex-shrink: 0; }
.tree-spacer-sm { width: 24px; flex-shrink: 0; }

/* Audio toggle button */
.audio-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: background 0.3s, transform 0.3s;
}
.audio-toggle:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.1);
}

/* Index minimal footer */
.index-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 20px 15px 24px;
  color: rgba(255,255,255,0.35);
  font-size: 0.8rem;
}
.index-footer a {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}
.index-footer a:hover { color: #fff; }
.index-footer .heart {
  display: inline-block;
  animation: heartbeat 1.4s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.2); }
  28% { transform: scale(1); }
  42% { transform: scale(1.15); }
  56% { transform: scale(1); }
}

/* ---- MOBILE FAMILY TREE FIX ---- */
@media (max-width: 767px) {
  .index-hero { padding: 30px 10px 20px; min-height: auto; }
  .index-title { font-size: 1.6rem; }
  .index-sub { font-size: 0.8rem; }

  .family-tree-index .tree-level {
    gap: 10px;
  }
  .family-tree-index .tree-node-img {
    width: 48px;
    height: 48px;
  }
  .family-tree-index .tree-node-name {
    font-size: 0.65rem;
  }
  .family-tree-index .tree-node-relation {
    font-size: 0.55rem;
  }
  .family-tree-index .tree-connector {
    height: 16px;
  }
  .tree-spacer-lg { width: 8px; }
  .tree-spacer-sm { width: 4px; }

  .family-tree-index .tree-node {
    max-width: 60px;
  }
  .tree-node-link .tree-node-img {
    border-width: 2px;
  }
}

@media (max-width: 400px) {
  .family-tree-index .tree-node-img {
    width: 38px;
    height: 38px;
  }
  .family-tree-index .tree-node-name {
    font-size: 0.55rem;
  }
  .family-tree-index .tree-node-relation {
    display: none;
  }
  .family-tree-index .tree-level {
    gap: 6px;
  }
  .tree-spacer-lg { width: 4px; }
  .tree-spacer-sm { width: 2px; }
  .family-tree-index .tree-node {
    max-width: 46px;
  }
}

/* ============================================
   BIO PAGES — No Header/Footer, Clean Layout
   ============================================ */

/* Back to Home button */
.back-home {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 9999;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transition: all 0.3s;
}
.back-home:hover {
  background: #fff;
  color: #000;
  box-shadow: 0 6px 24px rgba(0,0,0,0.15);
  transform: translateX(-3px);
}

/* Profile Intro (replaces hero) */
.profile-intro {
  padding-top: 20px;
}
.profile-photo {
  width: 140px;
  height: 175px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 4px solid;
  box-shadow: var(--shadow-soft);
}
.profile-name {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.2;
}
.profile-title {
  font-size: 1rem;
  color: #666;
  margin-bottom: 4px;
}
.profile-dates {
  font-size: 0.9rem;
  color: #999;
  margin-bottom: 0;
}

/* Source Footer */
.source-footer {
  padding: 50px 0 30px;
  background: linear-gradient(180deg, #f8f8f8, #eee);
}
.source-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #999;
  margin-bottom: 16px;
}
.source-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.source-links a {
  display: inline-block;
  padding: 12px 28px;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  color: #333;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transition: all 0.3s;
}
.source-links a:hover {
  border-color: #333;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}
.source-copy {
  font-size: 0.8rem;
  color: #aaa;
  margin: 0;
}
.source-copy a {
  color: #888;
  font-weight: 600;
}
.source-copy a:hover { color: #333; }
.source-copy .heart {
  display: inline-block;
  animation: heartbeat 1.4s ease-in-out infinite;
}

@media (max-width: 575px) {
  .profile-photo { width: 100px; height: 125px; }
  .profile-name { font-size: 1.8rem; }
  .profile-title { font-size: 0.85rem; }
  .back-home { padding: 6px 14px; font-size: 0.8rem; }
  .source-links a { padding: 10px 20px; font-size: 0.9rem; }
}
