/* SBI CONTRA FUND CALCULATOR STYLESHEET v4.8 - Refined Result Item Layout */

/* --- Core Variables & Base Styles --- */
:root {
    --primary-color: #005A9C; /* LIC Deep Blue */
    --secondary-color: #00AEEF; /* LIC Light Blue */
    --accent-color: #FFD700; /* LIC Gold */
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-gray: #f8f9fa;
    --border-color: #e0e6ed;
    --card-bg-color: #ffffff;
    --text-color: #333;
    --label-color: #555;
    --body-bg-color: #f4f7fc;
    --shadow: 0 10px 25px rgba(0, 90, 156, 0.08);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--body-bg-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    font-size: 16px;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    box-sizing: border-box;
}

.card {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--light-gray);
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-body { padding: 1.5rem; }

/* --- Page Header --- */
.page-header { text-align: center; margin-bottom: 2.5rem; }
.page-header h1 { font-size: 2.8rem; font-weight: 700; color: var(--primary-color); margin-bottom: 0.5rem; word-wrap: break-word; }
.page-header p {
    font-size: 1.2rem;
    color: var(--label-color);
    max-width: 750px;
    margin: 0 auto;
}
.last-updated { font-size: 0.9rem; color: #999; margin-top: 1rem; }

/* --- Main Layout --- */
.main-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: flex-start;
}
.calculator-column {
    position: sticky;
    top: 2rem;
}
.content-column { min-width: 0; overflow: hidden; }
.calculator { padding: 1.5rem; }

/* --- Form Styles --- */
.form-group { margin-bottom: 1.5rem; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--label-color);
    font-size: 0.95rem;
}
.form-group small {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.25rem;
    display: block;
}

.slider-label { display: flex; justify-content: space-between; align-items: center; }
.slider-label span { font-weight: 700; color: var(--primary-color); }

.input-with-stepper { display: flex; align-items: center; height: 52px; }
.input-with-stepper .input-with-icon { flex-grow: 1; border-radius: 8px; height: 100%; }
.input-with-stepper .stepper-btn {
    background-color: #eef2f7; border: 1px solid var(--border-color); color: var(--primary-color);
    font-size: 1.4rem; font-weight: 600; cursor: pointer;
    padding: 0; width: 52px; height: 100%;
    transition: background-color 0.2s; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.input-with-stepper .stepper-btn:first-of-type { margin-right: 0.5rem; }
.input-with-stepper .stepper-btn:last-of-type { margin-left: 0.5rem; }
.input-with-stepper .stepper-btn:hover { background-color: #d1d9e3; }

.input-with-icon { display: flex; align-items: center; border: 1px solid var(--border-color); border-radius: 8px; transition: all 0.3s; background-color: #fff; height: 100%; overflow: hidden; }
.input-with-icon:focus-within { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(0, 90, 156, 0.1); }
.input-with-icon i {
     padding: 0 15px; min-width: 50px;
     text-align: center; color: white; border-top-left-radius: 7px; border-bottom-left-radius: 7px;
     display: flex; align-items: center; justify-content: center; height: 100%;
     font-size: 1.1rem; flex-shrink: 0;
}
.input-with-icon .icon-blue { background-color: #3B82F6; }
.input-with-icon .icon-green { background-color: #10B981; }
.input-with-icon .icon-gold { background-color: #F59E0B; }
.input-with-icon input, .input-with-icon select.input-select {
    flex: 1; border: none; outline: none; padding: 14px 16px;
    font-size: 1.1rem; background: transparent; width: 100%; height: 100%;
    -moz-appearance: none; appearance: none; min-width: 50px;
}
.input-with-icon input::-webkit-outer-spin-button, .input-with-icon input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.slider { -webkit-appearance: none; width: 100%; height: 8px; background: #e2e8f0; border-radius: 5px; outline: none; margin-top: 1rem; transition: opacity .2s; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; background: var(--primary-color); cursor: pointer; border-radius: 50%; }
.slider::-moz-range-thumb { width: 20px; height: 20px; background: var(--primary-color); cursor: pointer; border-radius: 50%; }

.radio-group { display: flex; gap: 1rem; flex-wrap: wrap; }
.radio-label { display: inline-block; position: relative; cursor: pointer; }
.radio-label input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-custom { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1.75rem; border: 1px solid var(--border-color); border-radius: 8px; background-color: var(--light-gray); transition: all 0.3s ease; font-weight: 600; font-size: 1rem; }
.radio-label input[type="radio"]:checked + .radio-custom { background-color: var(--primary-color); color: #fff; border-color: var(--primary-color); box-shadow: 0 4px 8px rgba(0, 90, 156, 0.2); }

.form-actions { display: flex; gap: 1rem; margin-top: 1.5rem; }
.btn { padding: 0.9rem 1.75rem; border-radius: 8px; border: none; font-weight: 600; cursor: pointer; transition: all 0.3s; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; font-size: 1rem; }
.btn-primary { background-color: var(--primary-color); color: #fff; }
.btn-primary:hover { background-color: #004a80; transform: translateY(-2px); }
.btn-secondary { background-color: #e2e8f0; color: var(--label-color); }
.btn-secondary:hover { background-color: #d1d9e3; }
.btn-edit { background: none; border: 1px solid var(--border-color); color: var(--primary-color); padding: 0.3rem 0.8rem; border-radius: 6px; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.btn-edit:hover { background-color: #eef2f7; }
.error-box {
    background-color: #fff5f5; color: #c53030; margin-top: 1.5rem; padding: 1rem; font-weight: 600; border-radius: 8px; border: 1px solid #f56565; font-size: 1rem;
}

/* --- Results & Tabs --- */
.results-tabs { padding: 0 1.5rem; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.tab-btn-group { display: flex; gap: 0.5rem; }
.tab-btn { background: none; border: none; padding: 0.75rem 1.25rem; cursor: pointer; font-size: 1rem; font-weight: 600; color: var(--label-color); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab-btn.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.tab-panel { display: none; padding: 1.5rem; }
.tab-panel.active { display: block; animation: fadeIn 0.5s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Result Grid & Items */
.results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.result-item {
    background-color: var(--light-gray);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    display: flex; /* Use flexbox for alignment */
    flex-direction: column; /* Stack elements vertically */
    justify-content: center; /* Center content vertically */
}
.result-item p { /* Label */
    margin: 0 0 0.75rem 0; /* Increased bottom margin */
    font-weight: 600;
    color: var(--label-color);
    font-size: 1rem;
}
.result-item .value-block {
    line-height: 1.2;
    margin-bottom: 0.5rem; /* Space before note */
    display: flex; /* Allow side-by-side */
    align-items: baseline; /* Align baselines */
    justify-content: center; /* Center horizontally */
    gap: 0.75rem; /* Space between text and exact */
    flex-wrap: wrap; /* Allow wrapping on small screens if needed */
}
.result-item .value { /* Text Format (Lakh/Cr) */
    font-size: 2.2rem; /* Larger Text Format */
    font-weight: 700;
    color: var(--primary-color);
    display: inline-block; /* Keep inline */
    margin: 0; /* Reset margin */
}
.result-item .exact-value { /* Exact Format */
    display: inline-block; /* Keep inline */
    font-size: 1rem; /* Smaller */
    color: var(--label-color);
    margin: 0; /* Reset margin */
    font-weight: normal;
    white-space: nowrap; /* Prevent exact value wrapping */
}

/* Success Box Specific Styles */
.result-item.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); /* Use gradient from old CSS */
    grid-column: 1 / -1;
    color: white; /* Default text white */
}
.result-item.success p,
.result-item.success .value,
.result-item.success .exact-value,
.result-item.success small {
    color: white; /* Ensure all text is white */
}
.result-item.success .value {
    /* color: var(--success-color); */ /* Removed, uses white now */
    font-size: 2.8rem; /* Even larger */
}
.result-item.success .exact-value {
     /* color: var(--success-color); */ /* Removed, uses white */
     opacity: 0.9;
     font-size: 1.1rem; /* Slightly larger exact value */
}

/* Highlight Box Specific Styles */
.results-grid.summary-grid {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 1.5rem;
}
.results-grid .result-item.highlight,
.results-grid .result-item.success {
    grid-column: span 2;
    padding: 2rem; /* More padding for summary boxes */
    margin-top: 0;
}
.results-grid .result-item.highlight {
    /* background-color: var(--light-gray); */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Use gradient from old CSS */
    /* border: 2px dashed var(--secondary-color); */ /* Remove border */
    color: white; /* Default text white */
    border-radius: 16px; /* Match card radius */
}
.results-grid .result-item.highlight p,
.results-grid .result-item.highlight .value,
.results-grid .result-item.highlight .exact-value,
.results-grid .result-item.highlight small {
     color: white; /* Ensure all text is white */
}
.results-grid .result-item.highlight .value {
     /* color: var(--primary-color); */ /* Removed, uses white */
     font-size: 2.5rem; /* Slightly smaller than net */
}
.results-grid .result-item.highlight .exact-value {
    /* color: var(--label-color); */ /* Removed, uses white */
    font-size: 1rem;
    opacity: 0.9;
}

.results-grid .result-item.success {
    margin-top: 1rem;
    border-radius: 16px; /* Match card radius */
}
.results-grid .result-item small { /* Style for the Gross/Net notes */
    display: block;
    margin-top: 0.75rem; /* Increased space */
    font-size: 0.9rem;
    /* color: var(--label-color); */ /* Color set individually */
    opacity: 0.9;
}


.chart-container { max-width: 450px; min-height: 400px; margin: 2rem auto 1rem auto; position: relative; }

.info-box-result { background: #eef2ff; border-left: 4px solid var(--secondary-color); padding: 1.5rem; border-radius: 10px; margin-top: 2rem; font-size: 1rem; }
.info-box-result strong { display: block; margin-bottom: 0.75rem; color: var(--primary-color); font-size: 1.1rem; }
.info-box-result p { line-height: 1.6; margin: 0; }

/* --- Info & FAQ Sections --- */
.info-section h3 { color: var(--primary-color); margin-top: 1.5rem; margin-bottom: 0.5rem; border-bottom: 2px solid var(--secondary-color); padding-bottom: 0.25rem; font-size: 1.1rem; }
.info-section h3:first-child { margin-top: 0; }
.info-section p, .info-section ul { margin-bottom: 1rem; font-size: 1rem; }
.info-section ul { padding-left: 20px;}

.feature-list { list-style: none; padding-left: 0; }
.feature-list li { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; font-size: 1rem; }
.feature-list .feature-icon { color: var(--success-color); font-size: 1.2rem; margin-top: 0.25rem; flex-shrink: 0; }

.faq-content { padding: 0 1.5rem 1.5rem; }
.faq-sub-title { font-size: 1.2rem; font-weight: 600; color: var(--primary-color); margin-top: 2rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-color); }
.faq-item { border-bottom: 1px solid var(--border-color); padding: 1rem 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; font-size: 1rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; transition: transform 0.3s ease-in-out; color: var(--secondary-color); flex-shrink: 0; margin-left: 0.5rem; }
.faq-item[open] > summary::after { transform: rotate(180deg); }
.faq-item div { padding-top: 1rem; font-size: 1rem; line-height: 1.7; }

/* --- Language Switcher --- */
.section-lang-switcher { display: flex; flex-shrink: 0; }
.section-lang-switcher .lang-btn { background-color: #eef2f7; border: 1px solid var(--border-color); color: var(--label-color); padding: 0.2rem 0.6rem; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.3s; }
.section-lang-switcher .lang-btn:first-child { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.section-lang-switcher .lang-btn:last-child { border-top-right-radius: 6px; border-bottom-right-radius: 6px; border-left: none; }
.section-lang-switcher .lang-btn.active { background-color: var(--primary-color); color: #fff; border-color: var(--primary-color); }

/* --- Full Width Content Section Styles --- */
.full-width-container { grid-column: 1 / -1; }
.card.info-card-full { width: 100%; box-sizing: border-box; }

/* Table Styles */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 1rem;
    width: 100%;
    box-sizing: border-box;
}
table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 0.95rem;
}
th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
    white-space: nowrap;
}
th {
    background-color: var(--light-gray);
    position: sticky; top: 0; z-index: 1;
    font-weight: 600;
    color: var(--primary-color);
}
tr:last-child td { border-bottom: none; }
tr:nth-child(even) { background-color: #fdfdfd; }

/* --- Responsive Design --- */
@media (max-width: 1200px) {
    .main-container { grid-template-columns: 1fr; }
    .calculator-column { position: static; }
}

@media (max-width: 768px) {
    body { font-size: 16px; overflow-x: hidden; }
    .container { padding: 1.5rem 1rem; width: 100%; }
    .page-header h1 { font-size: 2rem; }
    .page-header p { font-size: 1rem; }

    .content-column { grid-column: 1 / -1; }

    /* Mobile Form Element Sizes */
    .input-with-stepper { height: 56px; }
    .input-with-stepper .stepper-btn { width: 50px; font-size: 1.4rem; }
    .input-with-icon i { font-size: 1.1rem; min-width: 48px; padding: 0 14px; }
    .input-with-icon input, .input-with-icon select.input-select { font-size: 1rem; padding: 14px 16px; }
    .radio-custom { padding: 0.9rem 1.5rem; font-size: 1rem; }
    .btn { padding: 0.9rem 1.5rem; font-size: 1rem; }

    /* Mobile Result Grid Adjustments */
    .results-grid.summary-grid { grid-template-columns: 1fr; }
    .result-item { padding: 1.25rem; }
    .results-grid .result-item.highlight,
    .results-grid .result-item.success {
        grid-column: 1 / -1;
        padding: 1.5rem;
    }
    /* Adjust value sizes for better fit */
    .result-item .value { font-size: 2rem; } /* Base value size */
    .result-item .exact-value { font-size: 0.9rem; }
    .results-grid .result-item.highlight .value { font-size: 2.2rem; } /* Gross value */
    .results-grid .result-item.success .value { font-size: 2.2rem; } /* Net value */
    .result-item.success .exact-value { font-size: 1rem; }
    .results-grid .result-item.highlight .exact-value { font-size: 0.95rem; }

    /* Ensure value block items align center */
     .result-item .value-block { justify-content: center; }

    .results-tabs { flex-direction: column; align-items: stretch; gap: 0; padding: 0; border-bottom: none; }
    .tab-btn-group { width: 100%; display: flex; }
    .tab-btn { flex: 1; text-align: center; border-bottom: 1px solid var(--border-color); margin-bottom: 0; border-radius: 0; }
    .tab-btn.active { border-bottom-color: var(--primary-color); background-color: var(--light-gray); }

    .result-item p { font-size: 0.95rem; }

    .card { border-radius: 0; border-left: none; border-right: none; margin-bottom: 1.5rem; }
    .tab-panel { padding: 1.5rem 1rem; }
    .info-box-result { font-size: 1rem; padding: 1.25rem; }
    .info-section p, .info-section ul { font-size: 1rem; }
    .feature-list li { font-size: 1rem; }
    .faq-item summary { font-size: 1rem; }
    .faq-item div { font-size: 1rem; }
    .card-header { padding: 1rem; }
    .card-body { padding: 1rem; }
    .calculator { padding: 1rem; }
    .faq-content { padding: 0 1rem 1rem; }

    /* Mobile Table Adjustments */
    table { font-size: 0.85rem; min-width: 500px; }
    th, td { padding: 8px 10px; white-space: normal; word-break: break-word; }
     th { white-space: nowrap; }
    .table-container {
       border-color: var(--secondary-color);
       -webkit-overflow-scrolling: touch;
    }

}

@media (max-width: 480px) {
    .page-header h1 { font-size: 1.8rem; }
    .page-header p { font-size: 1rem; }
    .card-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }

    /* Adjust result item values for smallest screens */
    .result-item .value { font-size: 1.8rem; }
    .result-item.success .value { font-size: 2.2rem; }
    .result-item .exact-value { font-size: 0.85rem; }
    .result-item.success .exact-value { font-size: 0.95rem; }
     .results-grid .result-item.highlight .value { font-size: 2rem; }
     .results-grid .result-item.highlight .exact-value { font-size: 0.9rem; }

    .input-with-stepper { height: 52px; }
    .input-with-stepper .stepper-btn { width: 48px; font-size: 1.3rem; }
    .radio-custom { padding: 0.8rem 1.4rem; }
    .btn { padding: 0.8rem 1.4rem; }
    table { min-width: 400px; }
    th, td { padding: 6px 8px; }
}

/* --- Sticky Actions --- */
.form-actions {
    position: relative;
    z-index: 10;
    transition: all 0.3s ease;
}
.form-actions.sticky-actions { position: fixed; bottom: 0; left: 0; right: 0; background: white; padding: 1.25rem; box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15); border-top: 3px solid var(--primary-color); z-index: 1000; animation: slideUp 0.3s ease; }
@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (min-width: 1200px) {
    .form-actions.sticky-actions {
        left: auto; right: auto; width: 100%;
        max-width: calc((100% - 2rem * 2 - 2rem) / 3);
        margin-left: 1.5rem;
        border-radius: 12px 12px 0 0;
    }
}
@media (max-width: 1199px) {
    .form-actions.sticky-actions { left: 0; right: 0; width: 100%; }
}

/* --- Mobile Menu Show More Button Style --- */
.mobile-show-more-btn {
    display: block; width: calc(100% - 1rem); margin: 0.5rem 0 0.5rem 1rem; padding: 0.75rem 1rem; font-size: 0.9rem; font-weight: 600; color: var(--primary-color, #005A9C); background-color: var(--light-gray, #f8f9fa); border: 1px solid var(--border-color, #e0e6ed); border-radius: 6px; cursor: pointer; text-align: center;
}
.mobile-show-more-btn:hover { background-color: #e2e6ea; }

/* Checkbox Styles */
.form-section.optional-feature {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}
.form-section.optional-feature:hover {
    border-color: #dee2e6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.checkbox-wrapper {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}
.checkbox-wrapper:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 12px rgba(0, 90, 156, 0.1);
}
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 600;
}
.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-top: 0.2rem;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}
.checkbox-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.checkbox-desc {
    font-size: 0.9rem;
    color: var(--label-color);
    margin-top: 0.5rem;
    margin-left: calc(20px + 0.75rem);
    line-height: 1.5;
}
.conditional-inputs {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px dashed #dee2e6;
    animation: slideDown 0.3s ease;
    display: none;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}