/* === Base Layout === */
:root {
  --text-color: #333;
  --border-color: #ccc;
  --soft-white: #fdf6e3;
  --hover-blue: #005f88;
  --gold-gradient: linear-gradient(to right, #f7e7ce, #d4af37);
}
body {
  background-color: #e6f0d5; /* Parchment Green */
  color: var(--text-color);
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
}
.input::placeholder {
    font-size: 1.2em; /* or try 16px, 18px, etc. */
    color: #888;      /* optional: adjust placeholder color */
}
.landing-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 40px;
  width: 90%;
  margin: auto;
  background-color: #e6f0d5; /* Parchment Green */
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.column {
  width: 48%;
  padding: 10px;
}
.english-landing {
  font-family: 'EB Garamond', serif;
  text-align: left;
  font-size: 1.2em;
  line-height: 1.8;
  color: #3b3b3b;
}
.name-block .english {
  text-align: left;
  font-size: 1.3em;
  color: #000;
  font-weight: bold;
}
.urdu-landing {
  font-family: 'Scheherazade New', serif;
  direction: rtl;
  text-align: right;
  font-size: 1.5em;
  line-height: 1.8;
  color: #3b3b3b;
  letter-spacing: 0.5px;
}
.urdu-tree {
  direction: rtl;
  font-family: 'Scheherazade New', serif;
  font-size: 1.1em;
  color: maroon !important;
  letter-spacing: 0.5px;
  margin-top: 2px;
  text-align: left; /* ensures it stays beneath, not beside */
  font-weight: bold;
}
.urdu-root {
  direction: rtl;
  font-family: 'Scheherazade New', serif;
  font-size: 1.1em;
  color: maroon !important;
  letter-spacing: 0.5px;
  margin-top: 2px;
  text-align: center; /* ensures it stays beneath, not beside */
}
.column h1 {
  font-size: 1.6em;
  color: #a67c00; /* golden-brown */
  font-family: 'Scheherazade New', serif;
  margin-bottom: 10px;
}
.column p.subtitle {
  font-style: 'Noto Nastaliq Urdu', serif;
  margin-bottom: 20px;
  font-size: 1.5em;
  color: maroon;
  letter-spacing: 0.5px;
}
.column p {
  line-height: 1.2;
}
.btn-continue {
  background-color: #005f88;
  color: white;
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
}
.btn-continue:hover {
  background-color: #005f88;
}
/* === Header === */
.golden-header {
  text-align: center;
  margin-top: 2px;
}
.responsive-calligraphy {
  max-width: 220px;
  width: 90%;
  height: auto;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.5));
  transition: transform 0.3s ease;
  margin: 0 auto;
}
.tree-heading {
  text-align: center;
  font-family: 'Scheherazade New', serif;
  font-size: 2.4em;
  color: #b8860b;
  margin-top: 1px;
  letter-spacing: 1px;
}
/* === Header Bar === */
.tree-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--soft-white);
  border-bottom: 1px solid var(--border-color);
}
.tree-actions a {
  margin-right: 1px;
  text-decoration: none;
  color: var(--hover-blue);
  font-weight: bold;
}
/* === Buttons === */
button, .button {
  background: var(--gold-gradient);
  border: none;
  padding: 6px 12px;
  font-size: 0.9em;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.3s ease;
}
button:hover, .button:hover {
  background: linear-gradient(to right, #f7e7ce, #d4af37);
}
button:focus {
  outline: 2px solid var(--hover-blue);
  outline-offset: 2px;
}
.back-button {
  background-color: #d0ddb9; /* Slightly darker parchment green */
  color: #3a3a3a;
  border: none;
  padding: 8px 16px;
  margin: 6px 0;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: background-color 0.3s ease;
}

.back-button:hover {
  background-color: #c0cdb0;
}
/* === Typography === controls urdu for child*/

/* 🌿 Root Node */
.root-node {
  font-size: 1.8em;
  color: #007a6d;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
  margin: 0 auto;
  position: relative;
  top: 0;
  transform: none; /* Removed translateY(0) as it's redundant */
  text-align: center;
  font-weight: bold;
  }
.root-node .urdu {
  color: gold-gradient;
  font-size: 1.1em;
  text-align: center;
}
.root-glyph {
  width: 58px;
  height: 58px;
  vertical-align: middle;
  margin-right: 6px;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0,0,0,0.2);
}
.generation-label {
    color: #6a4e2e;
}
/* === Layout Containers === */
.generation-scroll {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* instead of center */
}

/* 🌿 Card Styling */

.lineage-card:hover {
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  transform: scale(1.02);
  transition: all 0.2s ease-in-out;
}
.lineage-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
  position: relative;
  flex: 1 1 auto;
  min-width: 220px;
}

/* 🌿 Toggle Button */
.descendant-toggle {
  margin-top: 10px;
  padding: 5px 10px;
  font-size: 0.8em;
  cursor: pointer;
  background-color: #f0f0f0;
  border: 1px solid #aaa;
  border-radius: 4px;
}
.root-to-first {
  text-align: center;
  margin: 30px 0;
}
/* 🌿 Generation  	 */
.generation-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: left;
  gap: 1px;
  margin-bottom: 2px;
}
.hidden {
  display: none !important;
}
/* 🌿 Vertical Stack for Children */
.vertical-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  margin-left: 0;         /* remove any inherited margin */
  padding-left: 0;        /* remove internal padding */
  border-left: none;      /* optional: remove connector */
}
/* 🌿 Vertical Connector Line */
.vertical-section-title {
  font-family: 'Scheherazade New', serif;
  font-size: 1.4em;
  color: #6a4e2e;
  margin-top: 40px;
  border-bottom: 2px dashed #a3c9a8;
}
.children-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start; /* This is the key fix */
  gap: 20px;
}
.child-branch {
  flex: 1 1 auto;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-self: flex-start; /* ← Optional but helpful */
}
.lineage-card { border: 2px solid gold; }
.child-branch { border: 2px solid red; }
/* 🌿 Connector Lines */
.connector-line {
  text-align: center;
  margin: 10px 0;
}

.vertical-connector {
  width: 2px;
  height: 30px;
  background-color: #a3c9a8; /* soft green for sacred lineage */
  margin: 0 auto;
}

.arrow-connector {
  font-size: 2.2em;
  align-self: center;
  margin: 0;
}

.arrow {
  font-size: 2.5em;
  color: #6a4e2e; /* earthy brown for symbolic flow */
}
.lineage-card, .child-branch {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
#connector-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000; /* Make sure it's above everything */
}
.child-branch-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 15px;
}
.child-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tree-node {
  margin-bottom: 8px;
  padding-left: 10px;
  border-left: 2px solid #ccc;
}

.lineage-card {
  background-color: #d0ddb9; /*Slightly dark Parchment Green*/
  padding: 10px;
  border: 1px solid #aaa;
  border-radius: 2px;
  margin-bottom: 5px;
  overflow-wrap: break-word;
}
.name-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 4px;
}
.children-container {
  margin-top: 10px;
}

.toggle-btn {
  margin-top: 6px;
  background: #eee;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
}
.card-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.notes {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  width: 100%;
  max-width: 300px; /* or whatever fits your layout */
  overflow-x: hidden;
  overflow-y: auto;
  font-weight: bold;
  font-size: 1.0em;
  color: darkblue;
  margin-top: 3px;
  }
 #expandAllBtn, #collapseAllBtn {
  margin-left: 0.3em;
  padding: 2px 5px;
  font-size: 0.7em;
  background-color: #fdf6e3;
  border: 1px solid #ccc;
  border-radius: 2px;
  cursor: pointer;
}
.welcome-splash {
  background: url('/static/parchment-bg.png') no-repeat center center;
  background-size: cover;
  padding: 3em;
  text-align: center;
  animation: fadeIn 2s ease-in;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.splash-title {
  font-family: 'Scheherazade New', serif;
  font-size: 2.5em;
  color: goldenrod;
  margin-bottom: 0.5em;
}

.splash-quote {
  font-style: italic;
  color: #444;
  font-size: 1.2em;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.flash.success {
  background-color: #e6ffe6;
  color: #2d7a2d;
  padding: 10px;
  border: 1px solid #b2d8b2;
  margin-bottom: 15px;
  border-radius: 5px;
}
.btn-calendar {
  background-color: #005f88;
  color: white;
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
}
