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

/* Container - flex layout */
#solpanel-calculator {
    margin: 0 auto;
    padding: 20px;
    line-height: 1.6;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1200px;
}

/* Form container - 60% width */
#solpanel-calculator .form-container {
    flex: 6;
    min-width: 300px;
}

/* Results panel - 40% width */
#solpanel-calculator .results {
    flex: 4;
    min-width: 250px;
    padding: 25px;
    border-radius: 8px;
    align-self: flex-start;
}

#solpanel-calculator .form-section {
    margin-bottom: 10px;
}

#solpanel-calculator .form-section h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
    font-weight: 600;
}

#solpanel-calculator .form-section span {
	font-size:14px;
	font-weight:400;
}

/* Radio groups in three columns */
#solpanel-calculator .radio-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 10px;
    row-gap: 10px;
}

#solpanel-calculator .radio-option {
    position: relative;
    padding: 0 0 1em 0;
}

#solpanel-calculator .radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

#solpanel-calculator .radio-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: normal;
    font-size: 13px;
    position: relative;
    padding-left: 35px;
}

#solpanel-calculator .radio-option label:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    box-sizing: border-box;
    background-color: transparent;
}

#solpanel-calculator .radio-option input[type="radio"]:checked + label:after {
    content: '';
    position: absolute;
    left: 6px;
    top: calc(50% - 8px);
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

/* ======================
   Results Panel Styles
   ====================== */
#solpanel-calculator .results h3 {
    margin-top: 0;
    margin-bottom: 25px;
    font-weight: normal;
}

/* Updated result item styles with vertical alignment */
#solpanel-calculator .result-item {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Vertically center all items */
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2); 
}

#solpanel-calculator .result-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

#solpanel-calculator .result-item.result-savings {
    border-bottom: none !important;
    padding-top: 10px;
}

#solpanel-calculator .result-label {
    font-weight: normal;
    font-size: 13px;
    line-height: 1.4; /* Consistent line height for better alignment */
}

#solpanel-calculator .result-savings .result-label {
	font-size: 16px;
	font-weight:bold;
}

#solpanel-calculator .result-value {
    font-weight: bold;
    margin-left: 20px;
    text-align: right;
    line-height: 1.4; /* Match line height with label */
}

#solpanel-calculator .result-savings #savings {
    color: #516B5C;
    font-weight: bold;
    font-size: 24px;
    line-height: 1; /* Adjust line height for large text */
}

/* ======================
   DARK MODE
   ====================== */
#solpanel-calculator.dark-mode {
    color: #fff;
}

/* Headings, labels, etc. in dark mode */
#solpanel-calculator.dark-mode h3,
#solpanel-calculator.dark-mode label,
#solpanel-calculator.dark-mode .result-label,
#solpanel-calculator.dark-mode .result-value {
    color: #fff;
}

/* Radio button outlines/fills (dark) */
#solpanel-calculator.dark-mode .radio-option label:before {
    border: 2px solid #fff;
}
#solpanel-calculator.dark-mode .radio-option input[type="radio"]:checked + label:after {
    background: #fff;
}

/* Results panel (dark) */
#solpanel-calculator.dark-mode .results {
    background-color: #1a1a1a;
    color: #fff;
}
#solpanel-calculator.dark-mode .result-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}


/* Range sliders */
/* DARK MODE */

/* This replaces your .dark-mode input[type="range"] rules: */
#solpanel-calculator.dark-mode input[type="range"] {
    -webkit-appearance: none; 
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    margin-top: 0px;
    background: transparent;
    cursor: pointer;
    outline: none; /* remove default focus outlines */
    border: none;  /* just in case */
}

/* The track */
#solpanel-calculator.dark-mode input[type="range"]::-webkit-slider-runnable-track {
    height: 16px;
    background: #3c3c3c;
    border-radius: 10px;
    border: none;
    outline: none;
    box-shadow: none;
}
#solpanel-calculator.dark-mode input[type="range"]::-moz-range-track {
    height: 16px;
    background: #3c3c3c;
    border-radius: 10px;
    border: none;
    outline: none;
    box-shadow: none;
}
#solpanel-calculator.dark-mode input[type="range"]::-ms-track {
    height: 16px;
    background: transparent;
    border-color: transparent;
    color: transparent;
    outline: none;
    box-shadow: none;
}
#solpanel-calculator.dark-mode input[type="range"]::-ms-fill-lower {
    background: #3c3c3c;
    border-radius: 10px;
    outline: none;
    box-shadow: none;
}
#solpanel-calculator.dark-mode input[type="range"]::-ms-fill-upper {
    background: #3c3c3c;
    border-radius: 10px;
    outline: none;
    box-shadow: none;
}

/* The thumb */
#solpanel-calculator.dark-mode input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 22px;
    width: 16px;
    margin-top: -3px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
    border: none;
    outline: none;
    cursor: pointer;
}
#solpanel-calculator.dark-mode input[type="range"]::-moz-range-thumb {
    height: 22px;
    width: 16px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
    border: none;
    outline: none;
    cursor: pointer;
}
#solpanel-calculator.dark-mode input[type="range"]::-ms-thumb {
    height: 22px;
    width: 16px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
    border: none;
    outline: none;
    cursor: pointer;
    margin-top: 0px;
}

/* Prevent focus from altering the track */
#solpanel-calculator.dark-mode input[type="range"]:focus::-webkit-slider-runnable-track {
    background: #3c3c3c;
    outline: none;
    box-shadow: none;
    border: none;
}


/* ======================
   LIGHT MODE
   ====================== */
#solpanel-calculator.light-mode {
    color: #000;
}

/* Headings, labels, etc. in light mode */
#solpanel-calculator.light-mode h3,
#solpanel-calculator.light-mode label,
#solpanel-calculator.light-mode .result-label,
#solpanel-calculator.light-mode .result-value {
    color: #000;
}

#solpanel-calculator.heading-desc {
	font-size:14px;
	font-weight:400;
}

/* Radio button outlines/fills (light) */
#solpanel-calculator.light-mode .radio-option label:before {
    border: 2px solid #000;
}
#solpanel-calculator.light-mode .radio-option input[type="radio"]:checked + label:after {
    background: #000;
}

/* Results panel (light) */
#solpanel-calculator.light-mode .results {
    background-color: #fafafa;
    color: #000;
}
#solpanel-calculator.light-mode .result-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

/* 
   LIGHT MODE SLIDER
*/

#solpanel-calculator.light-mode input[type="range"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    margin-top: 0px;
    background: transparent;
    cursor: pointer;
    outline: none;
    border: none;
}

/* The track */
#solpanel-calculator.light-mode input[type="range"]::-webkit-slider-runnable-track {
    height: 16px;
    background: #ccc;
    border-radius: 10px;
    border: none;
    outline: none;
    box-shadow: none;
}
#solpanel-calculator.light-mode input[type="range"]::-moz-range-track {
    height: 16px;
    background: #ccc;
    border-radius: 10px;
    border: none;
    outline: none;
    box-shadow: none;
}
#solpanel-calculator.light-mode input[type="range"]::-ms-track {
    height: 16px;
    background: transparent;
    border-color: transparent;
    color: transparent;
    outline: none;
    box-shadow: none;
}
#solpanel-calculator.light-mode input[type="range"]::-ms-fill-lower {
    background: #ccc;
    border-radius: 10px;
    outline: none;
    box-shadow: none;
}
#solpanel-calculator.light-mode input[type="range"]::-ms-fill-upper {
    background: #ccc;
    border-radius: 10px;
    outline: none;
    box-shadow: none;
}

/* The thumb */
#solpanel-calculator.light-mode input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 22px;
    width: 16px;
    margin-top: -3px; /* centers the thumb on the track */
    background: #000;
    border-radius: 4px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
    border: none;
    outline: none;
    cursor: pointer;
}
#solpanel-calculator.light-mode input[type="range"]::-moz-range-thumb {
    height: 22px;
    width: 16px;
    background: #000;
    border-radius: 4px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
    border: none;
    outline: none;
    cursor: pointer;
}
#solpanel-calculator.light-mode input[type="range"]::-ms-thumb {
    height: 22px;
    width: 16px;
    background: #000;
    border-radius: 4px;
    /* Same comment about shadow: */
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
    border: none;
    outline: none;
    cursor: pointer;
    margin-top: 0px;
}

/* Prevent focus from altering the track */
#solpanel-calculator.light-mode input[type="range"]:focus::-webkit-slider-runnable-track {
    background: #ccc;
    outline: none;
    box-shadow: none;
    border: none;
}


/* ======================
   Responsive
   ====================== */
@media (max-width: 768px) {
    #solpanel-calculator {
        flex-direction: column;
    }
    
    #solpanel-calculator .form-container,
    #solpanel-calculator .results {
        max-width: 100%;
        width: 100%;
    }
    
    #solpanel-calculator .radio-group {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #solpanel-calculator .result-item {
        flex-direction: column;
    }
    
    #solpanel-calculator .result-value {
        margin-left: 0;
        margin-top: 5px;
        text-align: left;
    }
}

@media (max-width: 480px) {
    #solpanel-calculator .radio-group {
        grid-template-columns: 1fr;
    }
}