/**
 * Financing Calculator Styles
 */

/* ======================
   Base Calculator Styles
   ====================== */

/* Container - flex layout */
#financing-calculator {
    margin: 0 auto;
    padding: 15px;
    line-height: 1.4;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    max-width: 1200px;
}

/* Form container - 50% width */
#financing-calculator .form-container {
    flex: 1;
    width: 50%;
    min-width: 350px;
}

/* Results panel - 50% width with consistent height */
#financing-calculator .results {
    flex: 1;
    width: 50%;
    min-width: 350px;
    padding: 30px;
    border-radius: 8px;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: auto; /* Let it size naturally */
    min-height: 380px; /* Minimum height to match design */
}

/* Results sections */
#financing-calculator .results-top {
    flex: 1;
}
#financing-calculator .results-bottom {
    margin-top: auto;
}
#financing-calculator .form-section {
    margin-bottom: 20px;
}
#financing-calculator .form-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
}

/* Range containers */
#financing-calculator .range-container {
    margin-top: 10px;
}
#financing-calculator .range-value {
    display: block;
    margin-top: 6px;
    font-size: 12px;
}

/* Plan and duration buttons */
#financing-calculator #financingOptions,
#financing-calculator #durationOptions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
#financing-calculator .plan-button,
#financing-calculator .duration-button {
    padding: 10px;
    background-color: #3c3c3c;
    color: #fff;
    border: 1px solid #9f9f9f;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 13px;
}
#financing-calculator .plan-button.selected,
#financing-calculator .duration-button.selected {
    background-color: #516B5C;
    color: #fff;
    opacity: 1;
    font-weight: bold;
}

/* Plan limit note */
#financing-calculator .plan-limit-note {
    font-size: 11px;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.7);
}

/* Info section */
#financing-calculator .info-section p {
    font-size: 11px;
    margin: 4px 0;
    color: rgba(255, 255, 255, 0.7);
}

/* Warning message */
#financing-calculator .warning {
    color: #e53e3e;
    background-color: rgba(229, 62, 62, 0.1);
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 12px;
    display: none;
}

/* ======================
   Results Panel Styles
   ====================== */
#financing-calculator .results h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 1.3em;
}
#financing-calculator .result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 25px;
}
#financing-calculator .result-item:last-child {
    border-bottom: none;
}
/* Special styling for monthly cost item */
#financing-calculator .result-item.result-savings {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: none !important;
    margin-top: 10px;
    padding-top: 20px;
    padding-bottom: 15px;
}

/* Labels */
#financing-calculator .result-label {
    font-weight: normal;
    font-size: 14px;
    line-height: 1.5;
}
#financing-calculator .result-savings .result-label {
    font-size: 18px;
    font-weight: bold;
}

/* Values */
#financing-calculator .result-value {
    font-weight: bold;
    margin-left: 20px;
    text-align: right;
    line-height: 1.5;
    font-size: 16px;
}
#financing-calculator .result-savings #monthlyPayment {
    color: #516B5C;
    font-weight: bold;
    font-size: 26px;
    line-height: 1.2;
}

/* ======================
   Enhanced Slider Styling
   ====================== */

/* Base slider styling */
.custom-slider {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    margin-top: 8px;
    background: transparent;
    outline: none !important;
    border: none !important;
    height: 24px;
    accent-color: transparent;
    color: transparent;
}

/* Remove focus outlines */
.custom-slider:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* DARK THEME SLIDER */
/* Track */
.custom-slider.dark::-webkit-slider-runnable-track {
    height: 16px;
    background: #3c3c3c;
    border-radius: 8px;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}
.custom-slider.dark::-moz-range-track {
    height: 16px;
    background: #3c3c3c;
    border-radius: 8px;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}
.custom-slider.dark::-ms-track {
    height: 16px;
    background: transparent;
    border-color: transparent;
    color: transparent;
    outline: none !important;
    box-shadow: none !important;
}
.custom-slider.dark::-ms-fill-lower {
    background: #3c3c3c;
    border-radius: 8px;
    outline: none !important;
    box-shadow: none !important;
}
.custom-slider.dark::-ms-fill-upper {
    background: #3c3c3c;
    border-radius: 8px;
    outline: none !important;
    box-shadow: none !important;
}
/* Thumb */
.custom-slider.dark::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 26px;
    width: 16px;
    margin-top: -5px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
    border: none !important;
    cursor: pointer;
}
.custom-slider.dark::-moz-range-thumb {
    height: 26px;
    width: 16px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
    border: none !important;
    cursor: pointer;
}
.custom-slider.dark::-ms-thumb {
    height: 26px;
    width: 16px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
    border: none !important;
    cursor: pointer;
    margin-top: 0px;
}

/* Force consistent dark slider track on focus/active */
.custom-slider.dark:focus::-webkit-slider-runnable-track,
.custom-slider.dark:active::-webkit-slider-runnable-track {
    background: #3c3c3c !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}
.custom-slider.dark:focus::-moz-range-track,
.custom-slider.dark:active::-moz-range-track {
    background: #3c3c3c !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}
.custom-slider.dark:focus::-ms-track,
.custom-slider.dark:active::-ms-track {
    background: #3c3c3c !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* LIGHT THEME SLIDER */
/* Track */
.custom-slider.light::-webkit-slider-runnable-track {
    height: 16px;
    background: #ccc;
    border-radius: 8px;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}
.custom-slider.light::-moz-range-track {
    height: 16px;
    background: #ccc;
    border-radius: 8px;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}
.custom-slider.light::-ms-track {
    height: 16px;
    background: transparent;
    border-color: transparent;
    color: transparent;
    outline: none !important;
    box-shadow: none !important;
}
.custom-slider.light::-ms-fill-lower {
    background: #ccc;
    border-radius: 8px;
    outline: none !important;
    box-shadow: none !important;
}
.custom-slider.light::-ms-fill-upper {
    background: #ccc;
    border-radius: 8px;
    outline: none !important;
    box-shadow: none !important;
}
/* Thumb */
.custom-slider.light::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 26px;
    width: 16px;
    margin-top: -5px;
    background: #516B5C;
    border-radius: 4px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
    border: none !important;
    cursor: pointer;
}
.custom-slider.light::-moz-range-thumb {
    height: 26px;
    width: 16px;
    background: #516B5C;
    border-radius: 4px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
    border: none !important;
    cursor: pointer;
}
.custom-slider.light::-ms-thumb {
    height: 26px;
    width: 16px;
    background: #516B5C;
    border-radius: 4px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
    border: none !important;
    cursor: pointer;
    margin-top: 0px;
}

/* Force consistent light slider track on focus/active */
.custom-slider.light:focus::-webkit-slider-runnable-track,
.custom-slider.light:active::-webkit-slider-runnable-track {
    background: #ccc !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}
.custom-slider.light:focus::-moz-range-track,
.custom-slider.light:active::-moz-range-track {
    background: #ccc !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}
.custom-slider.light:focus::-ms-track,
.custom-slider.light:active::-ms-track {
    background: #ccc !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* ======================
   DARK MODE
   ====================== */
#financing-calculator.dark-mode {
    color: #fff;
}
#financing-calculator.dark-mode h3,
#financing-calculator.dark-mode label,
#financing-calculator.dark-mode .result-label,
#financing-calculator.dark-mode .result-value,
#financing-calculator.dark-mode .range-value,
#financing-calculator.dark-mode .plan-limit-note {
    color: #fff;
}
#financing-calculator.dark-mode .plan-button,
#financing-calculator.dark-mode .duration-button {
    background-color: #3c3c3c;
    color: #fff;
}
#financing-calculator.dark-mode .plan-button.selected,
#financing-calculator.dark-mode .duration-button.selected {
    background-color: #516B5C;
    color: #fff;
}
#financing-calculator.dark-mode .results {
    background-color: #1a1a1a;
}
#financing-calculator.dark-mode .result-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
#financing-calculator.dark-mode .result-item.result-savings {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}
#financing-calculator.dark-mode .info-section p,
#financing-calculator.dark-mode .plan-limit-note {
    color: rgba(255, 255, 255, 0.7);
}

/* ======================
   LIGHT MODE
   ====================== */
#financing-calculator.light-mode {
    color: #000;
}
#financing-calculator.light-mode h3,
#financing-calculator.light-mode label,
#financing-calculator.light-mode .result-label,
#financing-calculator.light-mode .result-value,
#financing-calculator.light-mode .range-value,
#financing-calculator.light-mode .plan-limit-note {
    color: #000;
}
#financing-calculator.light-mode .plan-button,
#financing-calculator.light-mode .duration-button {
    background-color: #f0f0f0;
    color: #000;
}
#financing-calculator.light-mode .plan-button.selected,
#financing-calculator.light-mode .duration-button.selected {
    background-color: #516B5C;
    color: #fff;
}
#financing-calculator.light-mode .results {
    background-color: #fafafa;
}
#financing-calculator.light-mode .result-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
#financing-calculator.light-mode .info-section p,
#financing-calculator.light-mode .plan-limit-note {
    color: rgba(0, 0, 0, 0.7);
}

/* ======================
   Responsive
   ====================== */
@media (max-width: 850px) {
    #financing-calculator {
        flex-direction: column;
    }
    #financing-calculator .form-container,
    #financing-calculator .results {
        max-width: 100%;
        width: 100%;
        min-width: 100%;
        height: auto;
    }
}
@media (max-width: 600px) {
    #financing-calculator #financingOptions,
    #financing-calculator #durationOptions {
        grid-template-columns: repeat(2, 1fr);
    }
    #financing-calculator .result-item {
        flex-direction: column;
        align-items: flex-start;
    }
    #financing-calculator .result-value {
        margin-left: 0;
        margin-top: 4px;
        text-align: left;
    }
}
@media (max-width: 400px) {
    #financing-calculator #financingOptions,
    #financing-calculator #durationOptions {
        grid-template-columns: 1fr;
    }
}
