* {
    box-sizing: border-box;
}

html, body {
    font-size: 16px;
    margin: 0;
    padding: 0;
}

/* Fix for loading indicator positioning */
/*
.p-4.text-center, div[class*="loading"] {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1rem;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 100;
}
*/

h1, .h1 { font-size: 2.5rem !important; }
h2, .h2 { font-size: 1.75rem !important; }
h3, .h3 { font-size: 1.25rem !important; }
button, .btn { font-size: 1rem !important; }

/*
.icon-bar {
    background-color: #888 !important;
}
*/

/*
:root {
    --base-font-size: 16px;
    --h1-size: 2.5rem;
    --h2-size: 1.75rem;
    --h3-size: 1.25rem;
}
/*

/* Ensure consistent font sizing */
/*
html, body {
    font-size: var(--base-font-size) !important;
}

.btn, button, input, select, textarea {
    font-size: var(--button-size) !important;
}
*/

/* Fix Portfolio Analysis title */
.portfolio-container h1,
.portfolio-title,
h1.portfolio-title {
    text-align: left !important;
    padding: 1rem !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    font-size: 2rem !important;
    width: auto !important;
    max-width: 100% !important;
}

/* Fix spacing in analysis page */
.metrics-section {
    margin-top: 0 !important;
}

.key-metrics,
.key-metrics-container {
    margin-top: 0 !important;
}

/* Fix home page container width */
.container.body-content {
    max-width: 1140px !important; 
    margin: 0 auto !important;
    padding: 2rem !important;
}

/* Fix for "I'm Good" section */
.body-content > div:first-of-type {
    padding: 2rem !important;
    background-color: #f8f9ff !important;
    border-radius: 8px !important;
    margin-bottom: 2rem !important;
}

/* Fix for feature cards layout */
.body-content > div:nth-of-type(2) {
    display: flex !important;
    justify-content: space-between !important;
    gap: 1.5rem !important;
    flex-wrap: wrap !important;
}

    .body-content > div:nth-of-type(2) > div {
        flex: 1 1 300px !important;
        min-width: 250px !important;
        max-width: 350px !important;
    }

/* ======= FIX FOR BUTTONS APPEARING ON TWO LINES ======= */

.plan-button,
button.plan-button,
button[class*="Plan"],
button.base-plan,
button.conservative-plan,
button.balanced-plan,
button.aggressive-plan,
.btn-group button,
[id*="portfolio"] button {
    display: inline-block !important;
    white-space: nowrap !important;
    padding: 5px 10px !important;
    font-size: 13px !important;
    margin: 0 3px !important;
    min-width: auto !important;
    max-width: none !important;
    border-radius: 20px !important;
}

/* Container for buttons */
.plan-selector,
div.plan-selector,
div[class*="plan-selector"],
[id*="portfolio"] div[role="tablist"],
.btn-group-container {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    margin: 1rem auto !important;
    gap: 5px !important;
    width: auto !important;
    max-width: 100% !important;
}

/* ======= FIX FOR THREE CARDS IN ONE ROW ======= */
/* Add this to your fixes.css file */

/* Fix for feature cards display */
.features-section {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important; /* Force exactly 3 equal columns */
    gap: 1.5rem !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 2rem 0 !important;
}

/* Ensure each card fits properly */
.feature-card {
    min-width: 0 !important; /* Allow cards to shrink below content width */
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Ensure text wraps properly inside cards */
.feature-title,
.feature-text {
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    hyphens: auto !important;
}

/* Reduce overall font size if desired */
body {
    font-size: 14px !important;
}

h1 {
    font-size: 2.2rem !important;
}

h2, .card-title {
    font-size: 1.5rem !important;
}

h3 {
    font-size: 1.1rem !important;
}

p {
    font-size: 0.9rem !important;
}

/* Reduce footer text sizes */
.footer-links-column h4 {
    font-size: 0.9rem !important;
}

.footer-links-list a {
    font-size: 0.8rem !important;
}

.footer-legal {
    font-size: 0.75rem !important;
}

/* Adjust other footer spacing for smaller text */
.footer-links-list li {
    margin-bottom: 0.05rem !important;
    line-height: 1.2 !important;
}

.footer-links-column {
    margin-bottom: 1rem !important;
}

.footer-links-section {
    margin-top: 3rem !important;
    padding-top: 1.5rem !important;
    min-height: 200px;
}

/* Global anti-CLS measures */
* {
    /* Prevent layout shifts from text reflow */
    text-rendering: optimizeSpeed;
    /* Fixed size calculations */
    box-sizing: border-box;
}

/* Stabilize text rendering */
body {
    /* Prevent font rendering shifts */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Lock scrollbar to prevent width changes */
    overflow-y: scroll;
}

/* Prevent any animation during page load */
@media screen and (prefers-reduced-motion: no-preference) {
    .preload * {
        transition: none !important;
        animation: none !important;
    }
}

/* Add this class to body on load */
.preload {
    transition: none !important;
}

.tooltip-content {
    max-width: 300px !important;
    white-space: normal !important;
    word-wrap: break-word;
    line-height: 1.4;
    text-align: left;
    padding: 12px 16px;
}
