/* ----------------------------------- */
/* RESET & BASE STYLES                 */
/* ----------------------------------- */

/* (Removed the .navbar-right a { font-size: 0.5rem; } override 
   so it doesn't make your links tiny on mobile) */

/* ----------------------------------- */
/* NAVBAR                               */
/* ----------------------------------- */
body {
  background-color: #fbf9f6; /* Set the background color for the entire page */
  margin: 0; /* Remove default margin */
  font-family: 'Inter', sans-serif; /* Ensure consistent font */
}

.navbar {
    background-color: #fbf9f6;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 0;
    position: fixed; /* Stays at top */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
  }

  iframe {
    display: block; /* Make it a block element */
    margin: 20px auto; /* Center horizontally */
    max-width: 100%; /* Make iframe responsive */

}
  
  /* Large side padding for desktop so logo is far left, links far right */
  .navbar-container {
    display: flex;
    align-items: center;
    /* Use space-between so the "navbar-left" is pinned left, 
       "navbar-right" pinned right, and "navbar-center" is in the middle. */
    justify-content: space-between;
    width: 100%;
    padding: 0 12rem; /* Big gap on desktop */
    margin: 0 auto;
  }
  
  /* On mobile, reduce side padding so both links fit on screen */
  @media (max-width: 768px) {
    .navbar-container {
      padding: 0 1rem;
    }
  }
  
  .navbar-left {
    flex: 0 0 auto; /* or leave it as is if you prefer 33.333% */
    display: flex;
    align-items: center;
  }
  
  .navbar-center {
    /* If you want something in the center, keep flex: 1 and justify-content: center;
       If it's empty, you can just leave it as is. */
    flex: 0 0 auto;
    text-align: center;
    font-family: 'Inter', sans-serif;
    color: #2d3748;
    font-size: 3rem;
  }
  
  .navbar-right {
    flex: 0 0 auto; 
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 2rem; /* Space between Instagram & Resources */
  }
  
  .navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #2d3748;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 3rem;
  }
  
  .navbar-logo {
    height: 42px;
    margin-right: 10px;
  }
  
  .navbar-right a {
    color: #4a5568;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 1rem; /* Ensures readable link size */
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .navbar-right i {
    font-size: 1.1rem;
  }
  
  .navbar-right a:hover {
    color: #2d3748;
  }
  
  /* ----------------------------------- */
  /* HEADING STYLES                       */
  /* ----------------------------------- */
  
  h1 {
    font-size: 4.5rem;
    font-weight: 500;
    margin-bottom: 6rem;
    margin-top: 6rem;
    line-height: 1;
    letter-spacing: -0.03em;
  }
  
  .subtitle {
    font-size: 1.25rem;
    color: #666;
    margin-top: -5rem;
    margin-bottom: 6rem;
    max-width: 600px;
    line-height: 1.6;
  }
  
  /* ----------------------------------- */
  /* STICKY NAVBAR SCROLL STYLES         */
  /* ----------------------------------- */
  
  .sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fbf9f6; /* Match your body background color */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow when scrolling */
    z-index: 1000;
    transition: background-color 0.3s ease;
  }
  
  .navbar {
    padding: 1rem 0;
    margin-bottom: 2rem;
    width: 100%;
  }
  
  /* ----------------------------------- */
  /* CALCULATOR WRAPPER                  */
  /* ----------------------------------- */
  
  .calculator-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
  }
  
  .calculator-title {
    font-size: 2.5rem;
    font-weight: 500;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
  }
  
  /* ----------------------------------- */
  /* INTRO SECTION                        */
  /* ----------------------------------- */
  
  #intro {
    margin-bottom: 4rem;
  }
  
  #intro p {
    font-size: 1.125rem;
    line-height: 1.6;
    color: #444;
    margin-bottom: 1.5rem;
  }
  
  #intro ul {
    margin-left: 1.5rem;
    margin-bottom: 2rem;
  }
  
  #intro li {
    font-size: 1.125rem;
    line-height: 1.6;
    color: #444;
    margin-bottom: 0.5rem;
  }
  
  /* ----------------------------------- */
  /* CALCULATOR GRID                      */
  /* ----------------------------------- */
  
  .calculator-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem 6rem;
    margin-bottom: 4rem;
  }
  
  /* ----------------------------------- */
  /* INPUT GROUPS                         */
  /* ----------------------------------- */
  
  .input-group {
    border-bottom: 1px solid #111;
    padding-bottom: 1rem;
    position: relative;
  }
  
  .input-group label {
    display: block;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
  }
  
  .input-group input {
    width: 100%;
    border: none;
    font-size: 1.25rem;
    font-weight: 400;
    color: #111;
    background: transparent;
    padding: 0;
  }
  
  .input-group input:focus {
    outline: none;
  }
  
  .info-label {
    position: absolute;
    bottom: -1.75rem;
    left: 0;
    font-size: 0.75rem;
    color: #666;
  }
  
  .info-tooltip {
    position: absolute;
    bottom: -1.75rem;
    right: 0;
    font-size: 0.75rem;
    color: #666;
    cursor: pointer;
    border-bottom: 1px solid #666;
  }
  
  .tooltip-content {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    width: 280px;
    padding: 1rem;
    background: #111;
    color: white;
    font-size: 0.875rem;
    line-height: 1.5;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 100;
  }
  
  .info-tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
  }
  
  /* ----------------------------------- */
  /* BUTTON STYLES                        */
  /* ----------------------------------- */
  
  .button-wrapper {
    text-align: center;
    margin: 3rem 0;
  }
  
  button {
    background: #29895f;
    color: white;
    border: none;
    padding: 1.5rem 3rem;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease;
  }
  
  button:hover {
    background: #236d4c;
  }
  
  /* ----------------------------------- */
  /* RESULTS SECTION                      */
  /* ----------------------------------- */
  
  #results,
  #explanation {
    font-family: 'Neue Haas Grotesk', 'Helvetica Now', -apple-system, BlinkMacSystemFont, sans-serif;
    display: none;
    margin-top: 8rem;
    border-top: 1px solid #111;
    padding-top: 4rem;
  }
  
  #results.show,
  #explanation.show,
  .timeline-container.show {
    display: block;
  }
  
  #results p {
    font-family: 'Neue Haas Grotesk', 'Helvetica Now', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.25rem;
    color: #666;
    margin-bottom: 2rem;
  }
  
  #results div {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
  
  /* ----------------------------------- */
  /* TIMELINE CONTAINER                   */
  /* ----------------------------------- */
  
  .timeline-container {
    margin-top: 4rem;
    position: relative;
    overflow-x: auto; /* Add horizontal scroll for small screens */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  }
  
  .timeline-svg {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    height: auto;
    min-width: 800px;
    min-height: 400px;
    overflow: visible; /* So lines/dots aren't clipped */
  }
  
  .timeline-tooltip {
    display: none;
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    pointer-events: none;
  }
  
  .timeline-legend {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
  }
  
  .legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
  }
  
  /* ----------------------------------- */
  /* FOOTER                               */
  /* ----------------------------------- */
  
  .footer {
    margin-top: 6rem;
    padding: 2rem 0;
    border-top: 1px solid #ddd;
  }
  
  .footer-content {
    max-width: 900px;
    margin: 0 auto;
  }
  
  .fine-print {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
  }
  
  .disclaimer {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.6;
  }
  
  .footer-links {
    margin-top: 1rem;
  }
  
  .footer-links a {
    color: #111;
    text-decoration: none;
  }
  
  /* ----------------------------------- */
  /* FORMULA BOX STYLING                  */
  /* ----------------------------------- */
  
  .formula-box {
    background-color: #f7f9fc; /* Light background for contrast */
    border: 1px solid #dce3eb; /* Subtle border for definition */
    border-radius: 8px;        /* Rounded corners */
    padding: 1rem;             /* Space inside the box */
    margin: 1.5rem 0;          /* Space around the box */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    font-family: 'Courier New', Courier, monospace; /* Distinct font for formulas */
    color: #1a202c; /* Darker text for readability */
    overflow-x: auto; /* Scroll for long formulas */
  }
  
  .formula-box p {
    margin: 0; /* Remove default paragraph spacing */
    font-size: 1.125rem; /* Larger text for clarity */
    line-height: 1.6; /* Comfortable line height */
    color: #2d3748; /* Slightly darker than box color */
  }
  
  .formula-box .highlight {
    color: #e53e3e; /* Emphasize with a distinct color */
    font-weight: bold; /* Bold for extra emphasis */
  }
  
  /* ----------------------------------- */
  /* RESPONSIVE DESIGN                    */
  /* ----------------------------------- */
  
  @media (max-width: 768px) {
    body {
      padding: 40px 20px;
    }
  
    .calculator-grid {
      grid-template-columns: 1fr;
      gap: 2rem;
    }
  
    .calculator-title {
      font-size: 2rem;
    }
  
    button {
      width: 100%;
      padding: 1.25rem;
    }
  
    .timeline-container {
      margin: 2rem -20px; /* Negative margin to allow full-width scrolling */
      padding: 0 20px;
    }
  
    .timeline-legend {
      padding: 0 20px;
      justify-content: center;
      flex-wrap: wrap;
    }
  
    /* Adjust tooltip for touch devices */
    .timeline-tooltip {
      padding: 0.75rem 1rem;
      font-size: 1rem; /* Larger font for touch devices */
    }

  
  }

/* ----------------------------------- */
/* MYFINANCE WIDGET                    */
/* ----------------------------------- */

.finance-widget-container {
  max-width: 900px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

/* Add spacing between consecutive widgets */
.finance-widget-container + .finance-widget-container {
  margin-top: 1rem;
}

.myFinance-widget {
  width: 100%;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .finance-widget-container {
    margin: 2rem auto;
    padding: 0 1rem;
  }
}

.iframe-container {
  display: flex;
  justify-content: center;
  max-width: 900px;
  margin: 3rem auto;
}

/* ----------------------------------- */
/* TOOLS PAGE STYLES                   */
/* ----------------------------------- */

.tools-section-title {
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  margin-top: 4rem;
  text-align: center;
}

.calculator-widget-link {
  max-width: 900px;
  margin: 4rem auto 2rem;
  text-align: center;
}

.calculator-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background-color: #29895f;
  color: white;
  text-decoration: none;
  padding: 1rem 2rem;
  border-radius: 4px;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.calculator-link:hover {
  background-color: #236d4c;
  color: white;
}

/* Active nav link styles */
.navbar-right a.active {
  color: #29895f;
  font-weight: 500;
}

@media (max-width: 768px) {
  .tools-section-title {
    font-size: 1.5rem;
    margin-top: 3rem;
  }
  
  .calculator-link {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
}