/* --- Basic Setup & Variables --- */
:root {
    --yfn-soft-bg: #E0E5EC;
    --yfn-soft-text-dark: #3E4A59;
    --yfn-soft-text-light: #6D7B8C;
    --yfn-soft-shadow-light: #FFFFFF;
    --yfn-soft-shadow-dark: #A3B1C6;
    --yfn-soft-accent: #2E73E8;
    --yfn-soft-font: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}



/* --- Main Container & Header --- */
.yfn-soft-container {
	width: 100%;
	max-width: 100%; /* Constrain width for better readability */
    margin: 0 auto;
	background: #F0F2F5;
	padding: 40px 20px;
}

.yfn-soft-header {
    text-align: center;
    margin-bottom: 40px;
}
.yfn-soft-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.yfn-soft-subtitle {
    font-size: 1.1rem;
    color: var(--yfn-soft-text-light);
}

/* --- Main Calculator: Neumorphic Style --- */
.yfn-soft-calculator {
    background-color: var(--yfn-soft-bg);
    border-radius: 30px;
    padding: 30px;
    box-shadow: 12px 12px 24px var(--yfn-soft-shadow-dark), 
                -12px -12px 24px var(--yfn-soft-shadow-light);
}

.yfn-soft-input-section {
    text-align: center;
    margin-bottom: 30px;
}
.yfn-soft-input-section label {
    display: block;
    margin-bottom: 15px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--yfn-soft-text-light);
}

#yfn-soft-years-input {
    font-family: var(--yfn-soft-font);
    background: var(--yfn-soft-bg);
    border: none;
    width: 100%;
    max-width: 200px;
    padding: 15px;
    border-radius: 15px;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    color: var(--yfn-soft-text-dark);
    box-shadow: inset 5px 5px 10px var(--yfn-soft-shadow-dark), 
                inset -5px -5px 10px var(--yfn-soft-shadow-light);
    transition: all 0.3s ease;
}
#yfn-soft-years-input:focus {
    outline: none;
    box-shadow: inset 3px 3px 6px var(--yfn-soft-shadow-dark), 
                inset -3px -3px 6px var(--yfn-soft-shadow-light),
                0 0 0 2px var(--yfn-soft-accent);
}

/* --- Results Grid --- */
.yfn-soft-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.yfn-soft-card {
    background-color: var(--yfn-soft-bg);
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 7px 7px 15px var(--yfn-soft-shadow-dark), 
                -7px -7px 15px var(--yfn-soft-shadow-light);
    transition: box-shadow 0.3s ease;
}

.yfn-soft-card:hover {
    box-shadow: 4px 4px 10px var(--yfn-soft-shadow-dark), 
                -4px -4px 10px var(--yfn-soft-shadow-light);
}

.yfn-soft-card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--yfn-soft-text-light);
    font-weight: 500;
}
.yfn-soft-card-header svg {
    color: var(--yfn-soft-accent);
}

.yfn-soft-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--yfn-soft-accent);
    word-wrap: break-word;
}
#yfn-soft-future-date { font-size: 1.75rem; }

/* --- Summary & Content --- */
.yfn-soft-summary {
    text-align: center;
    margin-top: 30px;
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--yfn-soft-text-light);
}
.yfn-soft-summary strong {
    color: var(--yfn-soft-text-dark);
    font-weight: 600;
}

/* --- NEW: Action Buttons --- */
.yfn-soft-actions {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.yfn-soft-btn {
    font-family: var(--yfn-soft-font);
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 25px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background-color: var(--yfn-soft-bg);
    color: var(--yfn-soft-accent);
    box-shadow: 5px 5px 10px var(--yfn-soft-shadow-dark), 
                -5px -5px 10px var(--yfn-soft-shadow-light);
    transition: all 0.2s ease-in-out;
}

.yfn-soft-btn:hover {
    box-shadow: 2px 2px 5px var(--yfn-soft-shadow-dark), 
                -2px -2px 5px var(--yfn-soft-shadow-light);
    color: #1c5fc4; /* Darker accent */
}

.yfn-soft-btn:active {
    box-shadow: inset 2px 2px 5px var(--yfn-soft-shadow-dark), 
                inset -2px -2px 5px var(--yfn-soft-shadow-light);
    color: var(--yfn-soft-accent);
}

.yfn-soft-btn-secondary {
    color: var(--yfn-soft-text-light);
}
.yfn-soft-btn-secondary:hover {
    color: var(--yfn-soft-text-dark);
}

.yfn-soft-copy-status {
    width: 100%;
    text-align: center;
    margin-top: 15px;
    color: var(--yfn-soft-text-dark);
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.yfn-soft-copy-status.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}


/* --- Content Sections --- */
.yfn-soft-content-wrapper { padding-top: 50px; }
.yfn-soft-content-section { margin-bottom: 40px; }
.yfn-soft-content-section h2 {
    font-size: 1.75rem;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #d1d9e6;
}
.yfn-soft-content-section p, .yfn-soft-content-section li {
    line-height: 1.8;
    color: var(--yfn-soft-text-light);
}
.yfn-soft-content-section ol, .yfn-soft-content-section ul { padding-left: 25px; display: flex; flex-direction: column; gap: 10px; }
.yfn-soft-faq-item { margin-bottom: 20px; }
.yfn-soft-faq-item h3 { font-size: 1.2rem; color: var(--yfn-soft-text-dark); margin-bottom: 8px; }

/* Table Styling */
.yfn-soft-table-container { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 20px; }
.yfn-soft-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.yfn-soft-table th, .yfn-soft-table td { padding: 12px 15px; text-align: left; }
.yfn-soft-table thead { background-color: var(--yfn-soft-accent); color: white; font-weight: 600; }
.yfn-soft-table th:first-child { border-radius: 8px 0 0 0; }
.yfn-soft-table th:last-child { border-radius: 0 8px 0 0; }
.yfn-soft-table tbody tr { border-bottom: 1px solid var(--yfn-soft-shadow-dark); }
.yfn-soft-table tbody tr:last-child { border-bottom: none; }
.yfn-soft-table tbody tr:nth-child(even) { background-color: #d1d9e6; }

/* Related Links */
.yfn-soft-related-links { display: flex; flex-direction: column; gap: 12px; }
.yfn-soft-related-links a { color: var(--yfn-soft-accent); text-decoration: none; font-weight: 600; transition: color 0.3s ease; }
.yfn-soft-related-links a:hover { color: var(--yfn-soft-text-dark); }

/* --- Responsive Design Media Queries --- */

/* For Tablets and Smaller Desktops (e.g., <= 1024px) */
@media (max-width: 1024px) {
    .yfn-soft-container {
        padding: 30px 20px;
    }

    .yfn-soft-header h1 {
        font-size: 2.25rem; /* Slightly smaller title */
    }

    .yfn-soft-value {
        font-size: 1.8rem; /* Scale down result values */
    }
    
    #yfn-soft-future-date {
        font-size: 1.6rem;
    }
}


/* For Portrait Tablets (e.g., <= 768px) */
@media (max-width: 768px) {
    .yfn-soft-container {
        padding: 30px 15px;
    }

    .yfn-soft-header {
        margin-bottom: 30px;
    }
    
    .yfn-soft-header h1 {
        font-size: 2rem;
    }
    
    .yfn-soft-subtitle {
        font-size: 1rem;
    }

    .yfn-soft-calculator {
        padding: 25px;
        border-radius: 25px;
    }

    /* --- Stack Grids to a Single Column --- */
    .yfn-soft-results-grid {
        grid-template-columns: 1fr; /* Single column for result cards */
        gap: 20px;
    }

    .yfn-soft-table-container {
        grid-template-columns: 1fr; /* Single column for tables */
        gap: 40px; /* Increase space between stacked tables */
    }
    
    .yfn-soft-actions {
        gap: 15px;
    }

    .yfn-soft-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .yfn-soft-content-section h2 {
        font-size: 1.5rem;
    }

    .yfn-soft-content-section p, .yfn-soft-content-section li {
        font-size: 0.95rem;
    }
	.yfn-soft-table th, .yfn-soft-table td {
	padding: 10px 12px;
	font-size: 12px;
}
}


/* For Mobile Devices (e.g., <= 600px) */
@media (max-width: 600px) {
    .yfn-soft-container {
        padding: 20px 15px;
    }
    
    .yfn-soft-header h1 {
        font-size: 1.8rem; /* Further reduce font size for small screens */
    }

    .yfn-soft-calculator {
        padding: 20px;
        border-radius: 20px;
        /* Soften shadows for smaller elements */
        box-shadow: 8px 8px 16px var(--yfn-soft-shadow-dark), 
                    -8px -8px 16px var(--yfn-soft-shadow-light);
    }
    
    .yfn-soft-input-section label {
        margin-bottom: 12px;
    }

    #yfn-soft-years-input {
        max-width: 100%; /* Allow input to use available width */
        font-size: 1.3rem;
        padding: 12px;
    }
    
    .yfn-soft-card {
        padding: 20px;
        /* Soften card shadows */
        box-shadow: 5px 5px 12px var(--yfn-soft-shadow-dark), 
                    -5px -5px 12px var(--yfn-soft-shadow-light);
    }

    .yfn-soft-value {
        font-size: 1.7rem; /* Ensure value fits in the card */
    }

    #yfn-soft-future-date {
        font-size: 1.5rem;
    }

    .yfn-soft-summary {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* --- Responsive Action Buttons --- */
    .yfn-soft-actions {
        flex-direction: column; /* Stack buttons vertically */
        align-items: stretch; /* Make buttons same width */
        gap: 15px;
    }

    .yfn-soft-btn {
        width: 100%; /* Full-width buttons are easier to tap */
    }

    /* --- Responsive Table Styling --- */
    .yfn-soft-table {
        display: block; /* This is key for enabling horizontal scroll */
        width: 100%;
        overflow-x: auto; /* Allow table to scroll horizontally */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        white-space: nowrap; /* Prevent content from wrapping inside cells */
        border-radius: 8px; /* Add radius to the scrollable container */
    }

    .yfn-soft-table thead {
        /* Ensure header stays visible when scrolling */
        white-space: nowrap;
    }
    
    .yfn-soft-table tbody {
        /* Ensure body rows scroll with the header */
        white-space: nowrap;
    }

    .yfn-soft-table th, .yfn-soft-table td {
        padding: 10px 12px;
        font-size: 0.9rem; /* Slightly smaller text for table cells */
    }
	.yfn-soft-table th, .yfn-soft-table td {
	padding: 10px 12px;
	font-size: 12px;
}
}

/* For Very Small Mobile Devices (e.g., <= 400px) */
@media (max-width: 400px) {
    .yfn-soft-header h1 {
        font-size: 1.6rem;
    }
    
    .yfn-soft-subtitle {
        font-size: 0.9rem;
    }

    .yfn-soft-value {
        font-size: 1.5rem; /* Final size adjustment for smallest screens */
    }
    
    #yfn-soft-future-date {
        font-size: 1.3rem;
    }

    .yfn-soft-card-header {
        font-size: 0.9rem;
        gap: 8px;
    }

    .yfn-soft-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .yfn-soft-content-section h2 {
        font-size: 1.3rem;
    }
    
    .yfn-soft-faq-item h3 {
        font-size: 1.1rem;
    }
.yfn-soft-table th, .yfn-soft-table td {
	padding: 10px 12px;
	font-size: 11px;
}
}