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

:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-surface: rgba(255, 255, 255, 0.75);
  --bg-surface-hover: rgba(255, 255, 255, 0.9);
  --border-color: rgba(15, 23, 42, 0.08);
  --border-color-hover: rgba(15, 23, 42, 0.16);
  --border-gold: rgba(180, 83, 9, 0.25);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --accent: #b45309;
  --accent-hover: #92400e;
  --accent-light: rgba(180, 83, 9, 0.08);
  --accent-glow: rgba(180, 83, 9, 0.15);
  
  --male-color: #1d4ed8;
  --male-light: rgba(29, 78, 216, 0.08);
  --female-color: #be185d;
  --female-light: rgba(190, 24, 93, 0.08);
  --late-color: #475569;
  --late-light: rgba(71, 85, 105, 0.08);
  
  --shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 30px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px -10px rgba(15, 23, 42, 0.12);
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(217, 119, 6, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-secondary);
  border: 2px solid var(--bg-primary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header & Hero */
header {
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #f59e0b);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--accent-glow);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo-text h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #0f172a, #334155);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* Quick Stats Bar */
.quick-stats {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.stat-badge {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-badge span.number {
  color: var(--accent);
  font-weight: 700;
}

/* Hero Section */
.hero {
  padding: 4rem 0 3rem 0;
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-light);
  border: 1px solid var(--border-gold);
  color: #f59e0b;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 15px rgba(217, 119, 6, 0.05);
}

.hero h2 {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(to bottom, #0f172a, #334155);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p.subtitle {
  color: var(--text-secondary);
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto 2rem auto;
}

/* Search bar on Hero */
.search-container {
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 1rem 1.5rem 1rem 3.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition);
  backdrop-filter: blur(8px);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  background: var(--bg-secondary);
}

.search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

/* Tab Navigation */
.tabs-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 1rem 1.5rem;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  border-radius: 2px;
}

/* Tab Content Areas */
.tab-content {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  transition: var(--transition-slow);
}

.tab-content.active {
  display: block;
  opacity: 1;
  transform: none;
}

/* --- Tab 1: Interactive Tree View --- */
.tree-container {
  position: relative; /* necessary for absolute positioning of controls */
  overflow: hidden; /* hide standard scrollbars so we can drag and zoom */
  padding: 2rem 1rem 4rem 1rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: inset 0 0 30px rgba(15, 23, 42, 0.02);
  min-height: 600px;
  cursor: grab;
  user-select: none;
}

.tree-container:active {
  cursor: grabbing;
}

#family-tree {
  position: absolute;
  left: 0;
  top: 0;
  width: max-content;
  transform-origin: 0 0;
  will-change: transform;
}

/* Floating controls for the Family Tree */
.tree-controls {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  padding: 0.4rem;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  transition: var(--transition);
}

.tree-scale-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  padding: 0 0.6rem;
  min-width: 52px;
  text-align: center;
  border-right: 1px solid var(--border-color);
  font-family: var(--font-heading);
}

.tree-control-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.tree-control-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.tree-container.tree-fullscreen-active .exit-fullscreen-icon {
  display: block !important;
}

.tree-container.tree-fullscreen-active .fullscreen-icon {
  display: none !important;
}

/* Fullscreen mode using fixed positioning */
.tree-container.tree-fullscreen-active {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  background: var(--bg-primary) !important;
  background-image: 
    radial-gradient(at 0% 0%, rgba(217, 119, 6, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.05) 0px, transparent 50%) !important;
  background-attachment: fixed !important;
  padding: 5rem 2rem 2rem 2rem !important;
}

/* Classic CSS tree structure styled modernly */
.tree {
  white-space: nowrap;
  text-align: center;
  margin: 0 auto;
}

.tree ul {
  padding-top: 30px; 
  position: relative;
  transition: var(--transition);
  display: flex;
  justify-content: center;
}

.tree li {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  float: none;
  text-align: center;
  list-style-type: none;
  position: relative;
  padding: 30px 15px 0 15px;
  transition: var(--transition);
  vertical-align: top;
}

/* Connectors using ::before and ::after */
.tree li::before, .tree li::after {
  content: '';
  position: absolute; 
  top: 0; 
  right: 50%;
  border-top: 2px solid var(--border-color);
  width: 50%; 
  height: 30px;
}

.tree li::after {
  right: auto; 
  left: 50%;
  border-left: 2px solid var(--border-color);
}

/* Remove connectors for single child nodes */
.tree li:only-child::after, .tree li:only-child::before {
  display: none;
}

.tree li:only-child { 
  padding-top: 0;
}

.tree li:first-child::before, .tree li:last-child::after {
  border: 0 none;
}

.tree li:last-child::before {
  border-right: 2px solid var(--border-color);
  border-radius: 0 8px 0 0;
}

.tree li:first-child::after {
  border-radius: 8px 0 0 0;
}

/* Parent connection downwards */
.tree ul ul::before {
  content: '';
  position: absolute; 
  top: 0; 
  left: 50%;
  border-left: 2px solid var(--border-color);
  width: 0; 
  height: 30px;
}

/* Custom interactive node cards */
.tree-node {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  border-radius: 12px;
  display: inline-block;
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition);
  position: relative;
  z-index: 10;
  box-shadow: var(--shadow-sm);
  min-width: 220px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.tree-node:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-4px);
}

.tree-node-family-unit {
  font-size: 0.65rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  display: flex;
  justify-content: space-between;
}

.tree-node-link-id {
  color: var(--text-muted);
}

.tree-node-couple {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tree-member-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.node-avatar-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.node-avatar-indicator.male { background-color: var(--male-color); }
.node-avatar-indicator.female { background-color: var(--female-color); }
.node-avatar-indicator.late { background-color: var(--late-color); }

.tree-member-details {
  text-align: left;
}

.tree-member-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
}

.tree-member-name.late {
  font-style: italic;
  color: var(--text-secondary);
}

.tree-member-name.late::after, .card-name.late::after {
  content: ' †';
  font-size: 0.85em;
  color: var(--late-color);
  margin-left: 0.25rem;
  font-style: normal;
  display: inline-block;
}

.tree-member-malayalam {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-body);
}

.tree-node-spouse-divider {
  border-top: 1px solid var(--border-color);
  margin: 0.25rem 0;
}

.tree-node-chevron {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 20;
  transition: var(--transition);
}

.tree-node-chevron:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Collapse classes */
.tree-collapsed ul {
  display: none !important;
}

.tree-collapsed .tree-node-chevron {
  transform: translateX(-50%) rotate(180deg);
}

/* --- Tab 2: Directory View --- */
.directory-controls {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  backdrop-filter: blur(8px);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-width: 200px;
}

.control-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.control-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  outline: none;
  font-family: var(--font-body);
  transition: var(--transition);
  cursor: pointer;
}

.control-select:focus {
  border-color: var(--accent);
}

.control-btn-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.control-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  transition: var(--transition);
}

.control-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent);
}

.control-btn.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.member-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  backdrop-filter: blur(8px);
}

.member-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-md);
}

.member-card.late {
  border-left: 4px solid var(--late-color);
}
.member-card.male {
  border-left: 4px solid var(--male-color);
}
.member-card.female {
  border-left: 4px solid var(--female-color);
}

.card-header {
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.card-avatar {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.member-card.male .card-avatar {
  background: var(--male-light);
  color: #93c5fd;
}
.member-card.female .card-avatar {
  background: var(--female-light);
  color: #fbcfe8;
}
.member-card.late .card-avatar {
  background: var(--late-light);
  color: #e5e7eb;
}

.card-title-area {
  overflow: hidden;
}

.card-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-name.late {
  font-style: italic;
  color: var(--text-secondary);
}

.card-name-malayalam {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: var(--font-body);
}

.card-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.card-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.card-badge.gen-badge {
  background: var(--accent-light);
  border-color: var(--border-gold);
  color: #fbbf24;
}

.card-body {
  padding: 0 1.5rem 1.5rem 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.info-icon {
  color: var(--accent);
  width: 16px;
  margin-top: 0.15rem;
  text-align: center;
  flex-shrink: 0;
}

.info-text {
  color: var(--text-secondary);
  word-break: break-word;
}

.info-text strong {
  color: var(--text-primary);
}

.card-actions {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.02);
}

.card-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 0 10px var(--accent-glow);
}

.card-btn-link {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: var(--transition);
}

.card-btn-link:hover {
  color: white;
  text-decoration: underline;
}

/* --- Tab 3: Memorial Tribute Section --- */
.memoriam-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem auto;
}

.memoriam-header h3 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.memoriam-header p {
  color: var(--text-secondary);
}

.tributes-row {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  margin-bottom: 5rem;
}

.tribute-profile {
  background: radial-gradient(circle at 100% 0%, rgba(217, 119, 6, 0.08) 0%, transparent 60%), var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: 24px;
  padding: 3rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  backdrop-filter: blur(12px);
  position: relative;
}

.tribute-profile::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  width: 60%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
}

.tribute-portrait-area {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.tribute-avatar-container {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  padding: 6px;
  box-shadow: 0 0 30px var(--accent-glow);
}

.tribute-avatar-container img {
  cursor: zoom-in;
  transition: var(--transition);
}

.tribute-avatar-container img:hover {
  transform: scale(1.04);
}

.tribute-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 3.5rem;
  color: #f59e0b;
}

/* Candle Micro-animation */
.candle-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.candle-flame {
  width: 12px;
  height: 24px;
  background: linear-gradient(to bottom, #ffffff, #f59e0b, #d97706, transparent);
  border-radius: 50% 50% 20% 20%;
  animation: flicker 2s infinite ease-in-out;
  box-shadow: 0 0 20px #f59e0b, 0 0 40px #d97706;
}

.candle-wick {
  width: 2px;
  height: 6px;
  background: #374151;
}

.candle-body-svg {
  width: 16px;
  height: 35px;
  background: linear-gradient(to right, #e5e7eb, #9ca3af);
  border-radius: 2px;
}

@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(-1deg); opacity: 0.9; }
  20% { transform: scale(1.1) rotate(1deg); opacity: 1; }
  40% { transform: scale(0.95) rotate(-2deg); opacity: 0.8; }
  60% { transform: scale(1.05) rotate(0deg); opacity: 0.95; }
  80% { transform: scale(1) rotate(2deg); opacity: 0.9; }
}

.tribute-bio {
  flex-grow: 1;
}

.tribute-meta {
  margin-bottom: 1.5rem;
}

.tribute-relation {
  font-size: 0.85rem;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.tribute-name {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.tribute-dates {
  font-size: 1.1rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tribute-dates i {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tribute-text {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 2rem;
  line-height: 1.7;
}

/* Timeline vertical styling for Sr. Daisy */
.timeline-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.timeline-v {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid var(--border-color);
  margin-left: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.timeline-v-item {
  position: relative;
}

.timeline-v-marker {
  position: absolute;
  left: calc(-2rem - 6px);
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.timeline-v-year {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
}

.timeline-v-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* --- Tab 4: Demographics & Dashboard --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.dashboard-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2rem;
  backdrop-filter: blur(8px);
}

.dashboard-card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  border-left: 4px solid var(--accent);
  padding-left: 0.75rem;
}

.dashboard-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dashboard-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-list-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dashboard-list-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

/* Simple visual bar chart inside list item */
.progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 0.4rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--accent), #f59e0b);
  border-radius: 99px;
}

/* Modal Details Profile */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--bg-secondary);
  border: 1px solid var(--border-gold);
  border-radius: 24px;
  width: 90%;
  max-width: 750px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  z-index: 100010;
  opacity: 0;
  pointer-events: none;
}

.modal-box.active {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 1100;
  pointer-events: auto;
}

.modal-close-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.modal-hero {
  padding: 3rem 3rem 1.5rem 3rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 2rem;
  align-items: center;
}

.modal-avatar {
  width: 90px;
  height: 90px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.modal-box.male .modal-avatar {
  background: var(--male-light);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.3);
}
.modal-box.female .modal-avatar {
  background: var(--female-light);
  color: #fbcfe8;
  border-color: rgba(236, 72, 153, 0.3);
}
.modal-box.late .modal-avatar {
  background: var(--late-light);
  color: #e5e7eb;
  border-color: rgba(156, 163, 175, 0.3);
}

.modal-title-area {
  flex-grow: 1;
}

.modal-relation {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.15em;
  margin-bottom: 0.25rem;
}

.modal-name {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.modal-name-malayalam {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.modal-badge-row {
  display: flex;
  gap: 0.5rem;
}

.modal-body {
  padding: 2rem 3rem 3rem 3rem;
}

.modal-section-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.modal-info-card {
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
}

.modal-info-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.modal-info-card-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}

.interactive-link, .modal-info-card-value.interactive-link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  transition: var(--transition);
}

.interactive-link:hover, .modal-info-card-value.interactive-link:hover {
  color: var(--text-primary);
}

/* Toast Copy Indicator */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-secondary);
  border: 1px solid var(--accent);
  box-shadow: 0 10px 30px var(--accent-glow);
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  z-index: 100020;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transition: var(--transition);
}

.toast.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Footer styling */
footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-top: 4rem;
  background: var(--bg-secondary);
  text-align: center;
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-text a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}

.footer-text a:hover {
  color: var(--accent);
}

/* Gallery Styles */
.modal-gallery {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  margin-top: 2rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1rem;
}

.gallery-item {
  position: relative;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f1f5f9;
  max-height: 250px;
  transition: var(--transition);
  cursor: zoom-in;
}

.gallery-item img:hover, .gallery-item-sub img:hover {
  transform: scale(1.02);
}

.gallery-item label, .gallery-item-sub label {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--border-gold);
  z-index: 5;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gallery-item-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-item-sub {
  position: relative;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item-sub img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  transition: var(--transition);
  cursor: zoom-in;
}

/* Responsive styling */
@media (max-width: 992px) {
  .hero h2 {
    font-size: 2.8rem;
  }
  .tribute-profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
  }
  .timeline-v {
    border-left: none;
    padding-left: 0;
    margin-left: 0;
    align-items: center;
  }
  .timeline-v-marker {
    display: none;
  }
  .modal-hero {
    flex-direction: column;
    text-align: center;
    padding: 2rem 2rem 1rem 2rem;
  }
  .modal-body {
    padding: 1.5rem 2rem 2rem 2rem;
  }
  .modal-info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1.25rem;
  }
  .hero h2 {
    font-size: 2.2rem;
  }
  .quick-stats {
    display: none;
  }
  .tabs-nav {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .tab-btn {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }
  
  /* Gallery stacking */
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery-item-side {
    flex-direction: row;
    gap: 10px;
  }
  
  .gallery-item-sub {
    flex: 1;
  }
  
  .gallery-item-sub img {
    height: 120px;
  }
}

/* --- Image Zoom Lightbox Modal --- */
.zoom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100030;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.zoom-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.zoom-modal-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: #090d16;
  background-image: 
    radial-gradient(at 50% 50%, rgba(180, 83, 9, 0.06) 0px, transparent 60%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  width: 90%;
  max-width: 1000px;
  height: 80vh;
  max-height: 800px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8);
  transition: var(--transition);
  z-index: 100060;
  opacity: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.zoom-modal-box.active {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

.zoom-modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.zoom-modal-title-area h4 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 2px;
}

.zoom-modal-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.zoom-modal-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: var(--transition);
}

.zoom-modal-close-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.zoom-viewport {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  overflow: hidden;
  background: #05070c;
}

#zoom-image {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.zoom-controls-container {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.zoom-badge {
  background: rgba(9, 13, 22, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
  pointer-events: auto;
}

.zoom-toolbar {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.zoom-tool-btn {
  background: transparent;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #f8fafc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.zoom-tool-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.zoom-tool-btn:active {
  transform: scale(0.92);
}

.zoom-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 0.25rem;
}

/* Responsive adjustment for zoom popup */
@media (max-width: 768px) {
  .zoom-modal-box {
    width: 95%;
    height: 70vh;
  }
}
