/* ==============================================================
   0. CORE VARIABLES & RESET
   ============================================================== */
:root {
  --bg:            #ffffff;           /* page background colour           */
  --text:          #000000;           /* default text colour              */
  --border:        #e5e7eb;           /* light border colour            */
  --brand-green:   #469312;           /* primary accent colour          */
  --planet-green:  #499611;           /* secondary green                */
  --chat-bg:       #f4f4f5;           /* background of chat areas       */
  --hover-bg:      #f9fafb;           /* hover background colour        */
}

/* Basic reset – makes all elements behave predictably */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ---- THE container that wraps everything ------------------- */
.container {
    max-width: 900px;          /* your existing max‑width */
    margin: 0 auto;            /* <<< THIS CENTERS THE ENTIRE BLOCK */
    padding: 40px 20px;        /* keep your original padding */
}

/* --------------------------------------------------------------
 1. NOIR TYPOGRAPHY (Roboto) – I LOVE the “noir” look!!
   ============================================================== */
.intro-section { font-family: 'Roboto', sans-serif; margin-bottom: 40px; }
.noir-title {
  font-weight: 100;
  font-size: 2.4rem;
  margin-bottom: 20px;
  letter-spacing: 1px;
}
.noir-subtitle {
  font-family: 'Roboto', sans-serif;
  font-weight: 100;
  font-size: 1.8rem;
  border-left: 4px solid var(--brand-green);
  padding-left: 15px;
  margin: 40px 0 20px;
}
.noir-body {
  font-weight: 300;
  font-size: 1.15rem;
  color: #333;
  margin-bottom: 1.5rem;
}
.accent-green {
  color: var(--brand-green);
  font-weight: 700;
  font-size: 1.1em;
}

/* ==============================================================
    2. GLOBAL UI COMPONENTS (Buttons / Inputs)
   ============================================================== */
.btn-send {
  background: black;
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s;
}
.btn-send:hover {
  background: var(--brand-green);
  transform: translateY(-2px);
}

/* Form inputs (used inside the chat widget) */
input[type="text"],
.form-input {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Roboto', sans-serif;
  font-weight: 300;
}

/* ==============================================================
    3. NAVIGATION & HEADER / FOOTER
   ============================================================== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 5%;
  border-bottom: 1px solid var(--border);
  margin-bottom: 30px;
}
.site-logo {
  height: 45px;
  width: auto;
  display: block;
}
.header-right {
  text-align: right;
  max-width: 360px;
}
.header-quote {
  font-style: italic;
  font-size: 0.85rem;
  color: #666;
  margin: 0;
}

/* Footer */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  width: 100%;
  min-height: 275px;
  padding: 20px 5%;
  background: #fff;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}
.footer-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 10px;
}
.footer-graphic {
  max-height: 180px;
  width: auto;
  display: block;
}

/* ==================== CARD LAYOUT ==================== */

.card-container {
  display: grid;
  /* Responsive Grid: 
     4 columns on large screens (approx 1200px+)
     2 columns on tablets 
     1 column on mobile 
  */
  grid-template-columns: repeat(4, 1fr); 
  gap: 24px;
}

/* Tablet Breakpoint */
@media (max-width: 1100px) {
  .card-container {
    grid-template-columns: repeat(2, 1fr); /* 2 columns */
  }
}

/* Mobile Breakpoint */
@media (max-width: 600px) {
  .card-container {
    grid-template-columns: 1fr; /* 1 column */
  }
}

.card {
  display: flex;
  flex-direction: column;
  height: 450px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  
  /* Ensure cards fill the grid column width */
  width: 100%; 

  transition: transform 0.3s, border-color 0.3s;
}

.card:hover {
  transform: translateY(-8px);
  border-color: var(--brand-green);
}

.card-image-wrapper { 
  height: 70%; 
  overflow: hidden; 
} 

.card-image { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
} 

.card-content {
  height: 30%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-content h3 {
  font-size: 1.125rem;
  margin-bottom: .25rem;
  color: var(--brand-green);
}

.card-content p {
  font-size: .875rem;
  opacity: .8;
}


/* ==============================================================
   5. CHAT / DECONSTRUCTION UI
   ============================================================== */
#chat-box,
.chat-mini {
  background: var(--chat-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-y: auto;
  padding: 20px;
}
#chat-box { height: 350px; margin-bottom: 10px; }
.chat-mini { height: 250px; font-size: 0.9rem; }

.split-view { display: flex; gap: 30px; margin-top: 20px; }
.view-side {
  flex: 1;
  min-height: 420px;
  border: 2px solid #333;
  padding: 24px;
  border-radius: 8px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 2px 2px 0px rgba(0,0,0,.05);
}

/* ==============================================================
   6. GEOSPATIAL (Maps)
   ============================================================== */
#map-container {
  height: 450px;
  width: 100%;
  border: 2px solid #333;
  border-radius: 8px;
  margin-bottom: 20px;
  z-index: 1;
}
.map-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: #fafafa;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
#coord-display {
  background: #222;
  color: var(--brand-green);
  padding: 8px 15px;
  border-radius: 4px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9rem;
  border: 1px solid var(--brand-green);
  min-width: 280px;
  text-align: center;
}

/* THE GREEN MARKER FIX */
.leaflet-marker-icon {
  filter: hue-rotate(45deg) brightness(0.8) saturate(1.5); /* tweak to hit brand‑green */
}

/* ==============================================================
   7. WIZARD STAGES (the “final pivot” section)
   ============================================================== */
.stage      { display: flex; flex-direction: column; gap: 20px; animation: fadeIn .5s ease-in; }
.hidden      { display: none !important; }
.welcome-form  { display: flex; gap: 10px; max-width: 500px; }
.context-box,
.parsha-box,
.summary-box {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
  background: var(--hover-bg);
}

/* --------------------------------------------------------------
   8.  KEYFRAME ANIMATIONS
   ============================================================== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --------------------------------------------------------------
   9. RESPONSIVE BREAKPOINTS
   ============================================================== */
@media (max-width: 768px) {
  .card-container,
  .split-view,
  .site-footer,
  .map-controls { flex-direction: column; }
  .footer-column,
  .header-right { text-align: center; }
  .noir-title { font-size: 1.8rem; }
  #map-container { height: 320px; }
}

/* -------------------------------------------------------------
   10. FINAL PIVOT / CALL‑TO‑ACTION BUTTON
   ============================================================== */
.final-pivot {
  margin-top: 80px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  text-align: left;
}
.cta-wrapper { margin-top: 30px; }
.no-decoration { text-decoration: none; display: inline-block; text-align: center; }
.cta-wrapper .btn-send {
  padding: 15px 40px;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(70,147,18,.2);
}

/* --------------------------------------------------------------
   11.  SINGLE PASUK TEXT (scrollable container)
   ============================================================== */
.parsha-scroll-container {
  max-height: 350px;               /* limits height so it doesn't take over the screen */
  overflow-y: auto;               /* adds scrollbar only when needed */
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 15px;
  margin-top: 10px;
}

/* The Individual Verse Block */
.verse-unit {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}
.verse-unit:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

/* Hebrew Styling */
.hebrew-line {
  text-align: right;
  direction: rtl;
  font-family: 'Times New Roman', serif;
  font-size: 1.1em;
  line-height: 1.5;
  margin-bottom: 5px;
}

/* English Styling */
.english-line {
  text-align: left;
  direction: ltr;
  font-size: 0.95em;
  color: #333;
  line-height: 1.5;
}

/* Visual separator between verses */
.accent-line {
  height: 1px;
  background-color: var(--brand-green);   /* green accent line */
  margin: 10px 0 20px;
  width: 100%;
  opacity: 0.5;
}

/* ==============================================================
   12.  RESPONSIVE READER (stacked on mobile, side‑by‑side on desktop)
   ============================================================== */
.reader-container {
  display: flex;
  flex-direction: column;      /* Mobile default: stacked */
  gap: 20px;
  height: 100%;
  width: 100%;
}
@media (min-width: 768px) {
  .reader-container { flex-direction: row-reverse; }   /* puts Hebrew on the right */
}

/* Row for a single verse */
.verse-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 15px;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 8px;
}
.en-col {
  flex: 1;
  text-align: left;
  direction: ltr;
  font-size: 0.95em;
  line-height: 1.6;
  color: #333;
}
.he-col {
  flex: 1;
  text-align: right;
  direction: rtl;
  font-family: 'Times New Roman', serif;
  font-size: 1.1em;
  line-height: 1.6;
}

/* Visual separator between verses */
.accent-line {
  height: 1px;
  background-color: var(--brand-green);   /* green accent line */
  margin: 10px 0 20px;
  width: 100%;
  opacity: 0.5;
}

/* Mobile stacking adjustments */
@media (max-width: 768px) {
  .verse-row {
    flex-direction: column;
    gap: 10px;
    border-bottom: 1px solid #eee;   /* fallback border */
}
  .he-col { order: 1; }
  .en-col { order: 2; }
}

/* Shared column styles (used inside the reader) */
.text-column { flex: 1; overflow-y: auto; padding: 0 10px; }
.hebrew-col { text-align: right; direction: rtl; font-family: 'Times New Roman', serif; font-size: 1.1em; line-height: 1.6; }
.english-col { text-align: left; direction: ltr; font-size: 0.95em; line-height: 1.6; color: #333; }

/* -------- BUTTON / LINK HELPERS (shared across the site) -------- */
a.no-decoration { text-decoration: none; display: inline-block; text-align: center; }
.cta-wrapper .btn-send {
  padding: 15px 40px;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(70,147,18,.2);
}

/* Default (Desktop / Large Screens) */
#wallet-graph-container {
  width: 100%;
  height: 600px;   /* Fixed height for desktop */
  border: 1px solid #ccc;
  background-color: #fafafa; 
}

/* Tablet */
@media (max-width: 992px) {
  #wallet-graph-container {
    height: 500px; /* Slightly smaller on tablets */
  }
}

/* Mobile Phones */
@media (max-width: 768px) {
  #wallet-graph-container {
    height: 350px; /* Compact height for phones */
  }
}

/* ==================== TERMINOLOGY SECTION ==================== */

.terminology-section {
  margin-top: 3rem;
  padding: 2rem 0;
}

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

.term-card {
  background-color: #1a1a1a;
  border: 1px solid #444;
  border-left: 4px solid #4caf50; /* accent-green visual cue */
  border-radius: 6px;
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.term-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
  border-color: #555;
}

.term-title {
  font-family: 'Roboto Mono', monospace;
  font-size: 1.1rem;
  color: #4caf50; /* accent-green */
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.term-def {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #ccc;
  margin: 0;
}

.term-def strong {
  color: #fff;
  font-weight: 700;
}

.future-terms {
  margin-top: 2rem;
  padding: 1rem;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  font-size: 0.9rem;
  color: #888;
  font-family: 'Roboto Mono', monospace;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .term-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== ALGORITHM SECTION ==================== */

.algorithm-section {
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid #333;
}

.noir-subtitle {
  font-family: 'Roboto Mono', monospace;
  font-size: 1.2rem;
  color: #fff;
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-left: 4px solid #4caf50; /* accent-green */
  padding-left: 10px;
}

.code-block-container {
  background-color: #0a0a0a;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto; /* for scrolling on mobile */
  -webkit-overflow-scrolling: touch; /* IMPROVEMENT: Makes scrolling smooth on Mom's iphone */
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}


.code-block-container pre {
  margin: 0;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #e0e0e0;
}

.code-block-container code {
  color: #4caf50; /* accent-green for syntax highlight feel */
}

/* Optional: Style for comments inside the code block */
.code-block-container code .comment {
  color: #666;
  font-style: italic;
}

/* ==================== HEURISTICS SECTION ==================== */

.heuristics-section {
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid #333;
}

.heuristic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.heuristic-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #333;
  border-radius: 6px;
  padding: 1.5rem;
  transition: border-color 0.3s ease;
}

.heuristic-card:hover {
  border-color: #4caf50; /* accent-green */
}

.heuristic-title {
  font-family: 'Roboto Mono', monospace;
  font-size: 1.1rem;
  color: #fff;
  margin-top: 0;
  margin-bottom: 1rem;
}

.heuristic-card p {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0.5rem 0;
}

.heuristic-card code {
  background: #000;
  color: #4caf50;
  padding: 2px 5px;
  border-radius: 3px;
  font-family: 'Roboto Mono', monospace;
}

/* Call to Action Button */
.cta-container {
  text-align: center;
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.noir-button {
  display: inline-block;
  background-color: transparent;
  color: #4caf50;
  border: 2px solid #4caf50;
  padding: 12px 30px;
  font-family: 'Roboto Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.noir-button:hover {
  background-color: #4caf50;
  color: #000;
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
}

.cta-subtext {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .heuristic-grid {
    grid-template-columns: 1fr;
  }
  
  .noir-button {
    width: 100%; /* Full width button on mobile */
  }
}
