/* --- Styles for Equipment Loan Calculator --- */

/* Removed body styles to prevent theme conflicts */

/* Wrapper class added in the PHP shortcode output */
.elc-calculator-wrapper {
    /* Add any specific wrapper styles if needed, like bottom margin */
    margin-bottom: 20px;
    /* Ensure box-sizing is consistent if needed, but border-box is often standard */
    box-sizing: border-box;
}

/* Styles for the main calculator container */
.calculator-container {
    background-color: #ffffff;
    /* padding: 30px 40px; */
   
    /* Limit the calculator's max width */
    width: 100%;
    /* Make it responsive within its container */
    margin-left: auto;
    /* Center the container if the parent allows */
    margin-right: auto;
    /* Center the container if the parent allows */
    box-sizing: border-box;
    /* Include padding and border in the element's total width and height */
    font-family: 'Montserrat', sans-serif;
    /* Apply font specifically to the calculator */
    color: #333;
    /* Default text color for the calculator */
}

/* Keep all other styles for elements *within* .calculator-container */

.calculator-header h3 {
    margin: 0;
    font-weight: 700;
    color: #000;
    line-height: 1.1;
    text-transform: uppercase;
    /* Font sizes might need adjustment based on theme defaults */
    font-size: 2rem;
    /* Slightly adjusted base size */
    margin-bottom: 1.5em;
}


/* Commented out or combined above */
.calculator-header h3 {
    /* font-size: 2.5rem; */
    /* Combined above */
    margin-bottom: 1em;
}


.calculator-body {
    display: flex;
    gap: 5em;
    margin-top: 20px;
}

.input-section,
.output-section {
    flex: 1;
}
.output-section{
    display: flex;
    flex-direction: column;
}
.input-group {
    margin-bottom: 25px;
}

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

.input-group input[type="text"],
.input-group .readonly-input {
    /* Keep readonly style if you ever switch back */
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1.2rem;
    /* Adjusted size */
    font-weight: 700;
    box-sizing: border-box;
    background-color: #f8f9fa;
    /* Light background for input */
    color: #333;
    /* Ensure text color is set */
    line-height: normal;
}

/* Slider Styles */
.slider-group {
    position: relative;
    padding-bottom: 25px;
    /* Space for labels below */
}

.input-group input[type="range"] {
    width: 100%;
    height: 6px;
    cursor: pointer;
    appearance: none;
    background: #e9ecef;
    outline: none;
    border-radius: 3px;
    margin-top: 10px;
    margin-bottom: 10px;
    /* Space between slider and labels */
}

/* Slider Thumb */
.input-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: #f3b731;
    /* Yellow accent */
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.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 */
.slider-group::before {
    content: '';
    position: absolute;
    top: 33px;
    /* Adjust vertical position based on label height */
    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;
    /* Ensure it's behind the actual thumb but above the base track visually */
}

/* Make sure the actual range input is visually above the pseudo-element */
.input-group input[type="range"] {
    position: relative;
    z-index: 1;
    background: transparent;
    /* Make default track transparent */
}


.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;
}

.slider-value {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: #333;
}

/* Button Group (Commencing) */
.button-group .toggle-buttons {
    display: flex;
    border: 1px solid #ced4da;
    border-radius: 4px;
    overflow: hidden;
}

.button-group button {
    flex: 1;
    padding: 10px 15px;
    border: none;
    background-color: #f8f9fa;
    color: #555;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s, color 0.2s;
}

.button-group button.active {
    background-color: black;
    color: #ffffff;
}

.button-group button:not(.active):hover {
    background-color: #e2e6ea;
}

/* Output Section */
.repayment-box {
    background-color: black;
    color: #ffffff;
    padding: 2em;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5em;
}

.repayment-label {
    font-size: 1.5rem;
    font-weight: 900;
}

.repayment-value {
    font-size: 2.2rem;
    /* Slightly adjusted */
    font-weight: 700;
}

/* Graph Container */
.graph-container {
    position: relative;
    width: 100%;
    /* max-width: 400px; */
    /* Allow it to scale */
    margin: 0 auto 25px auto;
    height: 190px;
    /* Adjusted height */
    padding-bottom: 20px;
    padding-left: 35px;
    /* Increased padding for Y labels */
    box-sizing: border-box;
}

#loanGraph {
    display: block;
    width: 100%;
    /* Ensure canvas scales width */
    height: 100%;
    position: absolute;
    top: 0;
    
    /* Match padding */
    bottom: 20px;
    left: 0;
}

/* Graph axis styling */
.graph-labels-y,
.graph-labels-x {
    position: absolute;
    font-size: 0.75rem;
    color: #6c757d;
}

.graph-labels-y {
    left: 0;
    top: 0;
    bottom: 20px;
    /* Align with graph area bottom padding */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: right;
    width: 30px;
    /* Match container padding left */
}

.graph-labels-x {
    bottom: -30px;
    left: 35px;
    /* Match container padding left */
    right: 0;
    display: flex;
    justify-content: space-between;
    padding-right: 5px;
    /* Small padding at the end */
}

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

.graph-label-x-axis {
    position: absolute;
    bottom: -55px;
    /* Adjust position */
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #6c757d;
}


/* Summary Section */
.summary-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4em;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.summary-item {
    text-align: right;
    display: flex;
    gap: 1em;
}

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

.summary-value {
    font-size: 1.4rem;
    /* Adjusted size */
    font-weight: 700;
    color: #333;
}

.interest-value {
    color: #f3b731;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .calculator-body {
        flex-direction: column;
        gap: 2em;
        /* Reduced gap */
    }
	
	.elc-calculator-wrapper .repayment-box {
		padding: 25px;
	}

    .calculator-header h3 {
        font-size: 1.6rem;
        /* Smaller headings */
        text-align: center;
    }

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

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

    .graph-container {
        height: 200px;
        /* Smaller graph on mobile */
        padding: 20px 0px;
        /* Adjust padding */
    }

    #loanGraph {
        left: 30px;
    }

    .graph-labels-y {
        width: 25px;
    }

    .graph-labels-x {
        left: 30px;
    }

    .calculator-container {
        padding: 0px;
        /* Reduced padding */
    }
	
	.summary-section {
		display: inline-grid !important; 
		gap: 1.25em  !important; 
		justify-content: initial  !important; 
	}
}

@media (max-width: 480px) {

    .calculator-header h1,
    .calculator-header h2 {
        font-size: 1.4rem;
    }

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

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

    .repayment-value , .repayment-label{
        font-size: 1rem;
        align-self: flex-start;
    }

    .summary-section {
        flex-direction: column;
        align-items: flex-end;
        gap: 10px;
    }
	
	#loanGraph 
	{
		width: 87%; 
	}

    .summary-item {
        width: 100%;
        /* Make summary items full width */
    }
	
}



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

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