body {
    position: relative;
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: #333;
    background-image: linear-gradient(to bottom,
            rgba(240, 244, 248, 0) 0%,
            rgba(240, 244, 248, 0.5) 70%,
            rgba(240, 244, 248, 0.8) 85%,
            rgba(240, 244, 248, 1) 95%,
            rgba(240, 244, 248, 1) 100%),
        url('../static/hero.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.background-logo {
    position: fixed;
    top: 60px; /* Increased from 20px to move it below the menu */
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 1; /* Ensure it's above the main content but below the menu */
}

.background-logo img {
    max-width: 100%; 
    max-height: 100%;
    opacity: 1;
}

.main-content {
    position: relative;
    z-index: 2; /* Ensure main content is above the logo */
    margin-top: 200px; /* Increased to account for logo and menu */
    padding-top: 20px;
}

.container, .results-container, .disclaimer-container {
    background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent white background */
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.header-container {
    background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent white background */
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.header-container,
.container,
.results-container {
    width: 90%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.header-container {
    margin-top: 0; /* Remove top margin */
    margin-bottom: 30px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 150px;
    padding: 30px 20px;
    width: 90%;
    max-width: 1200px;
}

.logo {
    max-width: 400px;
    height: auto;
    margin-bottom: 20px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    font-size: 3.5em;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.header-container>p {
    text-align: center;
    font-size: 1.5em;
    max-width: 600px;
    margin: 0;
}

form {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.3);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 40px;
    animation: fadeInUp 0.5s ease-out;
    box-sizing: border-box;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    animation: fadeInRight 0.5s ease-out backwards;
}

.input-group i {
    position: absolute;
    left: 12px;
    top: calc(50% + 16px);
    transform: translateY(-50%);
    color: #909497;
    font-size: 18px;
    z-index: 2;
}

input[type="number"] {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    transform: translateY(0);
}

.input-group:nth-child(1) {
    animation-delay: 0.1s;
}

.input-group:nth-child(2) {
    animation-delay: 0.2s;
}

.input-group:nth-child(3) {
    animation-delay: 0.3s;
}

.input-group:nth-child(4) {
    animation-delay: 0.4s;
}

.input-group:nth-child(5) {
    animation-delay: 0.5s;
}

.input-group:nth-child(6) {
    animation-delay: 0.6s;
}

.input-group:nth-child(7) {
    animation-delay: 0.7s;
}

.input-group:nth-child(8) {
    animation-delay: 0.8s;
}

.input-group:nth-child(9) {
    animation-delay: 0.9s;
}

.input-group:nth-child(10) {
    animation-delay: 1s;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #909497;
}

input[type="number"] {
    width: calc(100% - 48px);
    padding: 12px 12px 12px 36px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    transform: translateY(0);
    padding-left: 40px;
}

input[type="number"]:focus {
    transform: translateY(-2px);
    outline: none;
    box-shadow: 0 10px 15px rgba(52, 152, 219, 0.2);
}

button {
    display: inline-block;
    width: auto;
    min-width: 100px;
    padding: 10px 20px;
    background-color: #ff914d;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-color 0.3s ease;
    grid-column: 1 / -1;
    justify-self: center;
    margin-top: 20px;
}

button:hover {
    background-color: rgba(255, 145, 77, 0.7);
}

#results {
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.3);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 100%;
}

#results h2 {
    color: #2c3e50;
    font-size: 2em;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    max-width: none;
}

th,
td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 1px;
}

tr:last-child td {
    border-bottom: none;
}

.hidden {
    display: none !important;
}

#feasibility,
#final-balance {
    font-weight: 600;
    font-size: 20px;
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 6px;
    color: #2980b9;
    text-align: center;
}

#feasibility {
    font-weight: 700;
    font-size: 2em;
    margin: 30px auto;
    text-align: center;
    padding: 20px;
    border-radius: 15px;
    max-width: 800px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    animation: pulsate 0.5s ease-in-out 3;
}

#feasibility.feasible {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.15) 0%, rgba(46, 213, 115, 0.4) 100%);
    color: #006633;
    border: 2px solid rgba(46, 213, 115, 0.5);
}

#feasibility.infeasible {
    background: linear-gradient(135deg, rgba(235, 77, 75, 0.15) 0%, rgba(235, 77, 75, 0.4) 100%);
    color: #cc0000;
    border: 2px solid rgba(235, 77, 75, 0.5);
}

#feasibility::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }
    20% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}

#feasibility.feasible::after {
    content: '✨';
    margin-left: 10px;
    animation: bounce 1s infinite;
}

#feasibility.infeasible::after {
    content: '⚠️';
    margin-left: 10px;
    animation: shake 1s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(2px);
    }
}

@keyframes pulsate {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#table-container {
    width: 98%;
    margin: 0 auto;
    max-height: 800px;
    overflow-y: auto;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    background: #ffffff;
}

#retirement-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    table-layout: fixed;
    margin: 0;
    border: none;
    border-bottom: 1px solid #ddd;
}

#retirement-table tr {
    border: none;
    border-bottom: 1px solid #ddd;
}

#retirement-table td {
    padding: 6px;
    text-align: right;
    border: none;
    font-size: 1.1em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgb(125, 125, 125)
}

#retirement-table th {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 8px 4px;
    height: 45px;
    vertical-align: middle;
    font-size: 1em;
    line-height: 1.2;
    border: none;
}


#retirement-table::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

#retirement-table::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

#retirement-table::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
}

#retirement-table::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.disclaimer-container {
    width: 80%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.disclaimer-container h3 {
    color: #2c3e50;
    font-size: 1.5em;
    margin-bottom: 10px;
    text-align: center;
}

.disclaimer-container p {
    font-size: 0.9em;
    line-height: 1.6;
    color: #333;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 20px;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 20px 10px;
    }

    form,
    #results {
        padding: 20px;
    }

    h1 {
        font-size: 2em;
    }

    #feasibility,
    #final-balance {
        font-size: 18px;
    }

    form {
        grid-template-columns: 1fr;
    }

    .header-container {
        padding: 15px;
    }

    h1 {
        font-size: 2.5em;
    }

    .header-container>p {
        font-size: 1.2em;
    }

    .logo {
        max-width: 400px;
    }
}

#balanceChart {
    width: 100%;
    height: 50vw;
    max-height: 500px;
    margin: 0 auto 40px auto;
}

#results {
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.3);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

#results h2 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-align: center;
}

#feasibility-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    padding: 20px;
    border-radius: 10px;
    transition: all 0.3s ease;
    max-width: 100%;
    text-align: center;
}

#feasibility {
    font-weight: 700;
    font-size: 24px;
    margin: 0 0 10px 0;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}

#feasibility-icon {
    font-size: 48px;
    margin-top: 10px;
}

.feasible {
    background-color: rgba(212, 237, 218, 0.7);
    color: #155724;
    border: 2px solid rgba(121, 172, 132, 0.7);
}

.not-feasible {
    background-color: rgba(248, 215, 218, 0.7);
    color: #721c24;
    border: 2px solid rgba(165, 110, 116, 0.7);
}

#final-balance {
    font-weight: 600;
    font-size: 20px;
    margin-bottom: 15px;
    padding: 15px;
    color: #2980b9;
    text-align: center;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes buttonPulse {
    0% {
        transform: scale(1);
    }
}

button {
    transition: all 0.3s ease;
}

button:hover {
    animation: buttonPulse 1s infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.wow-effect {
    animation: pulse 1s infinite;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5em;
    }

    .main-content>p {
        font-size: 1.2em;
    }

    #feasibility-container {
        padding: 15px;
    }

    #feasibility {
        font-size: 20px;
    }

    #feasibility-icon {
        font-size: 36px;
    }
}

.form-group {
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(204, 204, 204, 0.5);
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.form-group h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
}

.input-group {
    margin-bottom: 10px;
}

.results-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

#results {
    width: 9%;
    margin: 0 auto;
    padding: 20px;
}

#chart-container {
    position: relative;
    width: 100%;
    height: 400px;
    margin: 20px 0;
    padding: 0;
}

#retirement-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
    /* Remove any top margin */
}

.difference-row {
    font-size: 0.85em;
    line-height: 0.8;
    font-weight: normal;
}

.difference-row td {
    padding: 4px 8px;
    background-color: #f5f5f5;
    font-weight: normal !important;
    /* Ensure normal font weight */
}

.difference-row td:first-child {
    font-weight: normal;
    /* Ensure the "Difference:" text is not bold */
    color: #666;
    font-style: italic;
}

.data-row td {
    padding: 10px 8px;
    /* Slightly larger than difference rows */
}

.data-row td:nth-child(-n+3) {
    border-top: 2px solid #c0c0c0;
    /* Darker top border for first three columns */
    font-weight: bold;
    color: #333;
    /* Darker color for better contrast */
}

.expense-sources-row {
    background-color: #f0f8ff;
    font-size: 0.9em;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    line-height: 0.8;
    font-weight: normal !important;
}

.expense-sources-row td {
    padding: 4px 8px;
    text-align: center !important;
}

.expense-sources-row strong {
    font-weight: 600;
    color: #2c3e50;
}

.content-container {
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.inner-content {
    background-color: rgba(255, 255, 255, 0.7);
    padding: 20px 40px; /* Increased horizontal padding */
    border-radius: 8px;
}

.content-container h2 {
    color: #2c3e50;
    font-size: 2em;
    margin-bottom: 20px;
    text-align: center;
}

.content-container h3 {
    color: #34495e;
    font-size: 1.3em;
    margin-top: 20px;
    margin-bottom: 10px;
}

.content-container h2,
.content-container h3,
.content-container p,
.content-container ul {
    margin-left: 20px;
    margin-right: 20px;
}

.content-container p, .content-container ul {
    font-size: 1em;
    line-height: 1.6;
    color: #333;
    margin-bottom: 15px;
}

.content-container ul {
    padding-left: 20px;
}

@media (max-width: 768px) {
    .content-container {
        width: 95%;
        padding: 15px;
    }

    .inner-content {
        padding: 15px 25px; /* Adjusted for mobile */
    }

    .content-container h2 {
        font-size: 1.8em;
    }

    .content-container h3 {
        font-size: 1.2em;
    }

    .content-container p, .content-container ul {
        font-size: 0.9em;
    }

    .content-container h2,
    .content-container h3,
    .content-container p,
    .content-container ul {
        margin-left: 10px;
        margin-right: 10px;
    }
}

/* Adjust for mobile devices */
@media (max-width: 768px) {
    .background-logo {
        height: 100px; /* Adjusted for mobile */
    }

    .background-logo img {
        max-width: 200px; /* Adjusted for mobile */
    }

    .main-content {
        margin-top: 170px; /* Adjusted for mobile */
    }
}

.main-nav {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 10px 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.main-nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
}

.main-nav li {
    margin: 0 15px;
}

.main-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 16px;
    transition: color 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: #ff914d;
}

.hamburger {
    display: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    background: none;
    border: none;
    margin-left: 15px;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* Active state for hamburger */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile menu styles */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .main-nav {
        padding: 10px 0;
    }

    .main-nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.95);
        padding: 20px 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }

    .main-nav ul li {
        margin: 10px 0;
        text-align: center;
    }

    .main-nav ul li a {
        display: block;
        padding: 10px 20px;
        font-size: 18px;
    }

    .main-nav ul li a:hover {
        background-color: rgba(255, 145, 77, 0.1);
    }
}

/* Adjust the main content to account for the fixed nav */
.main-content {
    margin-top: 200px; /* Increased to account for nav bar */
}

/* Adjust for mobile devices */
@media (max-width: 768px) {
    .main-nav {
        padding: 5px 0;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
    }

    .main-nav li {
        margin: 5px 0;
    }

    .main-content {
        margin-top: 180px; /* Adjusted for mobile */
    }
}

/* Chart Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    background-color: #fefefe;
    padding: 20px;
    border: 1px solid #ddd;
    width: 90%;
    max-width: 1200px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    height: 75vh;
}

.modal.visible {
    display: flex;
}

.close-modal {
    position: absolute;
    right: 10px;
    top: 5px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.close-modal:hover {
    color: #555;
}

#chart-container {
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    margin-bottom: 20px;
}

#chart-container:hover {
    transform: scale(1.02);
}

.chart-hint {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    color: #666;
    font-size: 0.9em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

/* Added CSS styles for the chart modal and hover effects */

/* Styles for the birth month dropdown */
#birth-month {
    width: 100%; /* Changed from calc(100% - 48px) to 100% */
    padding: 12px 12px 12px 36px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: white;
    color: #333;
    appearance: none; /* Remove default arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23333" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
}

#birth-month:focus {
    outline: none;
    box-shadow: 0 10px 15px rgba(52, 152, 219, 0.2);
    transform: translateY(-2px);
}

/* Style for the calendar icon */
.input-group i.fa-calendar {
    position: absolute;
    left: 12px;
    top: 50%; /* Changed from calc(50% + 16px) to 50% */
    transform: translateY(-50%);
    color: #909497;
    font-size: 18px;
    z-index: 2;
    pointer-events: none; /* Ensures the icon doesn't interfere with dropdown interaction */
}

/* Hover effect */
#birth-month:hover {
    border-color: #3498db;
}

/* For Firefox */
#birth-month {
    text-indent: 0.01px;
    text-overflow: '';
}

/* For IE and Edge */
#birth-month::-ms-expand {
    display: none;
}

/* Adjust for mobile devices */
@media (max-width: 768px) {
    #birth-month {
        font-size: 14px;
        padding: 10px 10px 10px 30px;
    }

    .input-group i.fa-calendar {
        font-size: 16px;
        left: 10px;
    }
}

.age-marker-row {
    background-color: #fff2e6 !important;
    color: #ff914d !important;
    font-weight: bold;
}

.age-marker {
    background-color: #fff3e0;
    text-align: left;
    font-weight: bold;
    color: #ff9800;
}

.age-marker td {
    padding: 8px !important;
    border-top: 1px solid #ff9800 !important;
    border-bottom: 1px solid #ff9800 !important;
}

/* Add this new style to ensure consistent width across all inputs */
.input-group input[type="number"],
.input-group select {
    width: 100%;
    box-sizing: border-box;
}

.results-container {
    margin-top: 2rem;
    padding: 20px;
    background: rgba(255,255,255,0.8);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.results-container.hidden {
    display: none;
}

#results {
    width: 96%;
}

#results.hidden {
    display: none;
}

#retirement-table {
    width: 100%;
    border-collapse: collapse;
    border: none;
}

#retirement-table tr {
    border: none;
    border-bottom: 1px solid #ddd;
}

#retirement-table td {
    padding: 10px;
    text-align: right;
    border: none;
    font-size: 1em;
}

#retirement-table th {
    background-color: #f5f5f5;
    font-weight: bold;
    border: none;
}

#retirement-table tr:hover {
    background-color: #f0f0f0;
}

#feasibility-container {
    margin: 20px 0;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
}

.feasible {
    background-color: #dff0d8;
    color: #3c763d;
}

.not-feasible {
    background-color: #f2dede;
    color: #a94442;
}

#final-balance {
    font-size: 2em;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
}

#chart-container {
    margin-top: 30px;
    margin-bottom: 30px;
    height: 400px;
}

#largeBalanceChart {
    height: 70vh !important;
    width: 100% !important;
}

/* Column width adjustments */
#retirement-table th:nth-child(1), /* Age */
#retirement-table td:nth-child(1) {
    min-width: 60px;
    width: 60px;
}

#retirement-table th:nth-child(2), /* Month */
#retirement-table td:nth-child(2) {
    min-width: 60px;
    width: 60px;
}

#retirement-table th:nth-child(3), /* Year */
#retirement-table td:nth-child(3) {
    min-width: 60px;
    width: 60px;
}

#retirement-table th:nth-child(4), /* Monthly Expenses */
#retirement-table td:nth-child(4) {
    min-width: 120px;
    width: 120px;
}

#retirement-table th:nth-child(5), /* 401k Withdrawal */
#retirement-table td:nth-child(5) {
    min-width: 120px;
    width: 120px;
}

#retirement-table th:nth-child(6), /* 401k Balance */
#retirement-table td:nth-child(6) {
    min-width: 120px;
    width: 120px;
}

#retirement-table th:nth-child(7), /* Savings Balance */
#retirement-table td:nth-child(7) {
    min-width: 120px;
    width: 120px;
}

#retirement-table th:nth-child(8), /* Investment Balance */
#retirement-table td:nth-child(8) {
    min-width: 120px;
    width: 120px;
}

#retirement-table th:nth-child(9), /* Total Balance */
#retirement-table td:nth-child(9) {
    min-width: 120px;
    width: 120px;
}

/* Update table styles to prevent text wrapping and truncation */
#retirement-table th,
#retirement-table td {
    padding: 12px 8px;
    text-align: right;
    border: 1px solid #ddd;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

/* Ensure the table container allows horizontal scrolling */
.table-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1em;
    max-height: 1200px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#retirement-table {
    width: auto; /* Changed from 100% to auto to prevent squishing */
    min-width: 890px; /* Sum of all column widths */
    border-collapse: collapse;
    margin: 20px 0;
    background-color: rgba(255, 255, 255, 0.9);
}

.scenario-buttons {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.scenario-buttons button {
    flex: 1;
    margin: 0 10px;
    padding: 12px 20px;
    background-color: rgba(255, 255, 255, 0.2);
    color: #333;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.scenario-buttons button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.scenario-buttons button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.scenario-buttons button:first-child {
    margin-left: 0;
}

.scenario-buttons button:last-child {
    margin-right: 0;
}

@media (max-width: 768px) {
    .scenario-buttons {
        flex-direction: column;
    }

    .scenario-buttons button {
        margin: 5px 0;
    }
}

.difference-switch {
    display: flex;
    align-items: center;
    margin: 10px 0;
    gap: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.difference-switch span {
    font-size: 14px;
    color: #333;
    line-height: 20px;
}

#balanceChart {
    width: 100% !important;
    height: 100% !important;
}

/* Responsive table styles */
.table-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1em;
    max-height: 1200px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#retirement-table {
    width: 100%;
    min-width: 800px; /* Ensures table doesn't get too squished */
    border-collapse: collapse;
    margin: 20px 0;
    background-color: rgba(255, 255, 255, 0.9);
}

#retirement-table th,
#retirement-table td {
    padding: 12px 8px;
    text-align: right;
    border: 1px solid #ddd;
    white-space: nowrap;
}

#retirement-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

#retirement-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Mobile-specific styles */
@media screen and (max-width: 768px) {
    .table-container {
        margin: 0;
        padding: 0;
        width: 100%;
        max-height: 800px;
        background-color: rgba(255, 255, 255, 0.9);
        border-radius: 8px;
    }
    
    #retirement-table {
        margin: 0;
        font-size: 12px; /* Slightly smaller font for mobile */
    }
    
    #retirement-table th,
    #retirement-table td {
        padding: 6px 4px;
    }

    /* Adjust container padding for mobile */
    .container, .results-container {
        padding: 15px 10px;
        width: 95%;
    }
}

/* Ensure table container fits within results container */
.results-container {
    overflow: hidden; /* Prevent any overflow from table container */
}

.table-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1em;
    max-height: 1200px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}