/* --- Styles for Insurance Finance Calculator (IFC) --- */
/* --- Based on user's updated ELC styles --- */


/* Wrapper class added in the PHP shortcode output */
.ifc-calculator-wrapper {
    margin-bottom: 20px;
    box-sizing: border-box;
}

/* Styles for the main calculator container - Apply styles from user update */
.ifc-calculator-wrapper .calculator-container {
    background-color: #ffffff;
    /* padding: 30px 40px; */
    /* Padding removed by user */
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    color: #333;
}



.ifc-calculator-wrapper .calculator-header h3 {
    margin: 0;
    font-weight: 700;
    color: #000;
    line-height: 1.1;
    text-transform: uppercase;
    font-size: 2rem;
    

}

.ifc-calculator-wrapper .calculator-header h3 {
    margin-bottom: 1em;
    /* From user's h3 rule */
}


.ifc-calculator-wrapper .calculator-body {
    display: flex;
    gap: 5em;
    /* User update */
    margin-top: 20px;
}

.ifc-calculator-wrapper .input-section,
.ifc-calculator-wrapper .output-section {
    flex: 1;
}

.ifc-calculator-wrapper .output-section {
    /* User update */
    display: flex;
    flex-direction: column;
}

.ifc-calculator-wrapper .input-group {
    margin-bottom: 25px;
}

.ifc-calculator-wrapper .input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 400;
    font-size: 0.9rem;
    color: #555;
}

.ifc-calculator-wrapper .input-group input[type="text"] {
    /* Applies to IFC amount and rate */
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1.2rem;
    /* User update */
    font-weight: 700;
    box-sizing: border-box;
    background-color: #f8f9fa;
    color: #333;
    line-height: normal;
}

/* Slider Styles - Apply to IFC months slider */
.ifc-calculator-wrapper .slider-group {
    position: relative;
    padding-bottom: 25px;
}

.ifc-calculator-wrapper .input-group input[type="range"] {
    /* Targets #ifc-months */
    width: 100%;
    height: 6px;
    cursor: pointer;
    appearance: none;
    /* background: #e9ecef; */
    /* Now handled by ::before */
    outline: none;
    border-radius: 3px;
    margin-top: 10px;
    margin-bottom: 10px;
    position: relative;
    /* User update for z-index */
    z-index: 1;
    background: transparent;
    /* User update */
}

.ifc-calculator-wrapper .input-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: #f3b731;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.ifc-calculator-wrapper .input-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #f3b731;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Slider Track Fill Effect - Apply to IFC months slider group */
.ifc-calculator-wrapper .slider-group::before {
    content: '';
    position: absolute;
    top: 33px;
    /* User update */
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, #f3b731 0%, #f3b731 var(--value-percent, 100%), #e9ecef var(--value-percent, 100%), #e9ecef 100%);
    border-radius: 3px;
    pointer-events: none;
    z-index: 0;
}

/* Slider Labels - Apply to IFC months labels (6-12) */
.ifc-calculator-wrapper .slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6c757d;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 5px;
}

/* Add centering for potentially more labels in IFC */
.ifc-calculator-wrapper #ifc-months+.slider-labels span {
    flex: 1;
    text-align: center;
}


.ifc-calculator-wrapper .slider-value {
    /* Applies to #ifc-monthsValue */
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: #333;
}

/* Button Group - Not present in IFC, styles below won't apply */
/* .ifc-calculator-wrapper .button-group ... */


/* Output Section Styles */
.ifc-calculator-wrapper .repayment-box {
    background-color: black;
    /* User update */
    color: #ffffff;
    padding: 2em;
    /* User update */
    border-radius: 8px;

    justify-content: space-between;
    align-items: center;
    margin-top: 5em;
    /* User update */
}

.ifc-calculator-wrapper .repayment-label {
    font-size: 1.5rem;
    /* User update */
    font-weight: 900;
    /* User update */
}

.ifc-calculator-wrapper .repayment-value {
    /* Targets #ifc-monthlyRepayment */
    font-size: 2.2rem;
    /* User update */
    font-weight: 700;
}

/* Graph Container Styles - Apply user's positioning */
.ifc-calculator-wrapper .graph-container {
    position: relative;
    width: 100%;
    margin: 0 auto 25px auto;
    /* Height needs to accommodate labels below based on user's negative positioning */
    /* Let's try the same height and rely on negative bottom for labels */
    height: 240px;
    padding-left: 35px;
    box-sizing: border-box;
    /* Removed padding-bottom based on user's other graph positioning */
}

/* Target IFC canvas */
.ifc-calculator-wrapper #ifc-loanGraph {
    display: block;
    width: 100%;
    /* Adjust height to fit within the container height */
    height: 240px;
    /* Match container height */
    position: absolute;
    top: 0;
    left: 35px;
    /* bottom: 20px; */
    /* Removed as labels are positioned absolutely below */
    right: 0;
}

.ifc-calculator-wrapper .graph-labels-y,
.ifc-calculator-wrapper .graph-labels-x {
    position: absolute;
    font-size: 0.75rem;
    color: #6c757d;
}

.ifc-calculator-wrapper .graph-labels-y {
    left: 0;
    top: 0;
    /* Adjust bottom relative to canvas height */
    bottom: 0;
    /* Align with bottom of canvas area within container */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: right;
    width: 30px;
    box-sizing: border-box;
    padding-bottom: 5px;
    /* Offset '0' slightly */
}

/* Apply user's negative bottom positioning for X labels */
.ifc-calculator-wrapper .graph-labels-x {
    bottom: -30px;
    /* User update */
    left: 35px;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding-right: 5px;
    box-sizing: border-box;
    /* Add box-sizing */
}

/* Add centering rule again for IFC month labels */
.ifc-calculator-wrapper #ifc-loanGraph+.graph-labels-y+.graph-labels-x span {
    flex: 1;
    text-align: center;
}


.ifc-calculator-wrapper .graph-label-y-axis {
    position: absolute;
    left: 0px;
    top: 50%;
    transform: rotate(-90deg) translateY(-50%);
    transform-origin: left center;
    font-size: 0.7rem;
    color: #6c757d;
    white-space: nowrap;
}

/* Apply user's negative bottom positioning for X axis title */
.ifc-calculator-wrapper .graph-label-x-axis {
    position: absolute;
    bottom: -55px;
    /* User update */
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #6c757d;
}


/* Summary Section Styles - Apply user's updates */
.ifc-calculator-wrapper .summary-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4em;
    /* User update */
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.ifc-calculator-wrapper .summary-item {
    text-align: right;
    display: flex;
    /* User update */
    gap: 1em;
    /* User update */
}

.ifc-calculator-wrapper .summary-label {
    display: block;
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 5px;
}

.ifc-calculator-wrapper .summary-value {
    /* Targets #ifc-totalRepaid, #ifc-interestPaid */
    font-size: 1.4rem;
    /* User update */
    font-weight: 700;
    color: #333;
}

.ifc-calculator-wrapper .interest-value {
    /* Targets #ifc-interestPaid specifically */
    color: #f3b731;
}

/* --- Responsive Adjustments - Apply user's updates, scoped --- */
@media (max-width: 768px) {
    .ifc-calculator-wrapper .calculator-body {
        flex-direction: column;
        gap: 2em;
        /* User update */
    }
	
	.ifc-calculator-wrapper .repayment-box {
		padding: 25px;
	}

    /* Target IFC header elements */
    .ifc-calculator-wrapper .calculator-header h1,
    .ifc-calculator-wrapper .calculator-header h2 {
        font-size: 1.6rem;
        /* User update */
        text-align: center;
    }

    .ifc-calculator-wrapper .repayment-value {
        font-size: 1.5rem;
    }

    .ifc-calculator-wrapper .summary-value {
        font-size: 1.2rem;
    }

    /* Adjust graph container */
    .ifc-calculator-wrapper .graph-container {
        height: 200px;
        /* User update */
        padding-left: 30px;
    }

    .ifc-calculator-wrapper #ifc-loanGraph {
        height: 200px;
        /* Match container */
        left: 30px;
    }

    .ifc-calculator-wrapper .graph-labels-y {
        width: 25px;
        bottom: 0;
        /* Adjust if needed relative to canvas */
    }

    .ifc-calculator-wrapper .graph-labels-x {
        left: 30px;
        bottom: -30px;
        /* Maintain negative offset */
    }

    .ifc-calculator-wrapper .graph-label-x-axis {
        bottom: -55px;
        /* Maintain negative offset */
    }


    .ifc-calculator-wrapper .calculator-container {
        padding: 20px;
        /* User update */
    }
	
	.summary-section {
		display: inline-grid !important; 
		gap: 1.25em  !important; 
		justify-content: initial  !important; 
	}
	
}

@media (max-width: 480px) {

    /* User did not provide h1/h2 rules here, but had them for ELC */
    .ifc-calculator-wrapper .calculator-header h1,
    .ifc-calculator-wrapper .calculator-header h2 {
        font-size: 1.4rem;
    }

    .ifc-calculator-wrapper .input-group input[type="text"] {
        font-size: 1.1rem;
    }

    .ifc-calculator-wrapper .repayment-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .ifc-calculator-wrapper .repayment-value {
        font-size: 1rem;
        align-self: flex-start;
    }

    .ifc-calculator-wrapper .summary-section {
        flex-direction: column;
        align-items: flex-end;
        gap: 10px;
    }

    .ifc-calculator-wrapper .summary-item {
        width: 100%;
    }
	
	.ifc-calculator-wrapper .repayment-label {
    font-size: 1rem;
    /* User update */
    font-weight: 900;
    /* User update */
}
	
	}

@media (max-width: 767px) {
.ifc-calculator-wrapper .summary-section
	{
		display: block ; 
	}
	.hide-mobile
	{
		display: none !important; 
	}
	.hide-desktop
	{
		display: block !important; 
	}
	
	.repayment-box
	{
		margin-top: 0em !important; 
		width: 100%; 
		float: left; 
	}
	
}
	


.hide-desktop
	{
		display: none; 
	}
.hide-mobile
{
	display: block; 
}