/**
 * Solar Estimator Frontend Styles
 *
 * @package Wolfiz_Solar_Estimator
 */

/* ==========================================================================
   Google Maps
   ========================================================================== */

#wf_est_googleMap,
#wf_est_googleMap_last {
    width: 100%;
    height: 450px;
    min-height: 350px;
    max-height: 600px;
    position: relative;
}

@media only screen and (max-width: 768px) {
    #wf_est_googleMap,
    #wf_est_googleMap_last {
        width: 100%;
        height: 350px;
        min-height: 280px;
    }
}

/* ==========================================================================
   Utility Provider Selection
   ========================================================================== */

.display_items {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.display_items_next {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.alig_items {
    text-align: center;
    padding: 1%;
}

/* Radio button image selection */
.save_radio_val [type=radio] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.save_radio_val [type=radio] + img {
    cursor: pointer;
    transition: outline 0.2s ease;
}

.save_radio_val [type=radio]:checked + img,
.save_radio_val [type=radio] + img:hover {
    outline: 2px solid #568bc8;
}

/* ==========================================================================
   Calculator Results
   ========================================================================== */

.wf_font_size_up {
    font-size: 1.5em;
    font-weight: bold;
    color: #568bc8;
    margin: 0;
}

/* Label shown above single-value result shortcodes */
.wf-result-label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Cost Breakdown */
.cost-breakdown {
    margin: 20px 0;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.cost-row.total {
    font-weight: bold;
    border-top: 2px solid #333;
    border-bottom: none;
    margin-top: 10px;
    padding-top: 15px;
}

/* Solar Prices Breakdown */
.solar-prices-breakdown {
    margin: 20px 0;
}

.solar-prices-breakdown .price-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.solar-prices-breakdown .price-label {
    font-weight: 500;
}

.solar-prices-breakdown .price-value {
    font-weight: bold;
    color: #568bc8;
}

.solar-prices-breakdown .price-row.total {
    border-top: 2px solid #333;
    border-bottom: none;
    margin-top: 10px;
    padding-top: 15px;
}

/* Savings Summary */
.savings-summary {
    margin: 20px 0;
}

.summary-row {
    display: flex;
    margin-bottom: 15px;
    align-items: center;
}

.summary-label {
    width: 250px;
    font-weight: bold;
}

.summary-value {
    flex: 1;
    background: #568bc8;
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
}

.summary-value.plain {
    background: transparent;
    color: inherit;
}

/* Savings and Return Grid */
.savings-return-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.savings-return-grid .metric {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.savings-return-grid .metric-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #568bc8;
}

.savings-return-grid .metric-label {
    display: block;
    margin-top: 10px;
    color: #666;
    font-size: 0.9em;
}

@media only screen and (max-width: 768px) {
    .savings-return-grid {
        grid-template-columns: 1fr;
    }

    .summary-row {
        flex-direction: column;
    }

    .summary-label {
        width: 100%;
        margin-bottom: 5px;
    }
}

/* Monthly Savings */
.monthly-savings {
    text-align: center;
}

.monthly-savings .savings-note {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

/* ==========================================================================
   Real Time Stats
   ========================================================================== */

.real_time_label {
    text-align: center;
    padding: 20px;
}

.real_time_value {
    margin-bottom: 10px;
}

.real_p_value {
    font-size: 2em;
    font-weight: bold;
    color: #568bc8;
    margin: 0;
}

.real_p_text {
    color: #666;
    margin: 5px 0 0 0;
}

.real_time_title {
    font-weight: bold;
    color: #333;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.range,
.range_shade,
.range_offset {
    width: 100%;
}

.index,
.index_2 {
    font-size: 0.9em;
    color: #666;
}

.bill_price,
.roof_shade_val,
.offset_val {
    text-align: center;
}

/* ==========================================================================
   Charts
   ========================================================================== */

#chart_div,
#top_x_div {
    width: 100%;
    min-height: 400px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

.added_print_div1 {
    display: none;
}

@media print {
    .added_print_div1 {
        display: block !important;
        text-align: center;
        margin-bottom: 20px;
    }

    .print_call,
    .print_email {
        margin: 5px 0;
    }
}

/* ==========================================================================
   Error Messages
   ========================================================================== */

.main_error {
    color: #dc3545;
    padding: 10px;
    margin: 10px 0;
    text-align: center;
}

/* Map error messages */
#wf_est_googleMap .map-error,
#wf_est_googleMap_last .map-error {
    padding: 20px;
    background-color: #f8d7da;
    color: #721c24;
    border-radius: 5px;
    text-align: center;
}

#wf_est_googleMap .map-error a,
#wf_est_googleMap_last .map-error a {
    color: #721c24;
    text-decoration: underline;
}

/* ==========================================================================
   Custom Form System
   ========================================================================== */

.ecg-solar-form {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Form Layout with Sidebar */
.ecg-form-layout {
    display: flex;
    gap: 40px;
}

.ecg-form-content {
    flex: 1;
    max-width: 700px;
}

/* Sidebar Styles */
.ecg-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.ecg-sidebar-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.ecg-sidebar-header h3 {
    margin: 0 0 5px 0;
    font-size: 1.2em;
    color: #333;
}

.ecg-sidebar-header p {
    margin: 0;
    font-size: 0.85em;
    color: #666;
}

.ecg-sidebar-steps {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ecg-sidebar-step {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}

.ecg-sidebar-step:hover {
    background: #e9ecef;
}

.ecg-sidebar-step.active {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ecg-sidebar-step.completed {
    background: #e8f5e9;
}

.ecg-sidebar-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.ecg-sidebar-step.active .ecg-sidebar-step-number {
    background: linear-gradient(135deg, #568bc8, #cf993e);
    color: #fff;
}

.ecg-sidebar-step.completed .ecg-sidebar-step-number {
    background: #4caf50;
    color: #fff;
}

.ecg-sidebar-step-title {
    flex: 1;
    font-size: 0.9em;
    color: #666;
    transition: color 0.2s ease;
}

.ecg-sidebar-step.active .ecg-sidebar-step-title {
    color: #333;
    font-weight: 500;
}

.ecg-sidebar-step.completed .ecg-sidebar-step-title {
    color: #2e7d32;
}

.ecg-sidebar-step-check {
    display: none;
    color: #4caf50;
}

.ecg-sidebar-step.completed .ecg-sidebar-step-check {
    display: flex;
}

.ecg-sidebar-step.completed .ecg-sidebar-step-number {
    display: none;
}

/* Hide sidebar on mobile */
@media (max-width: 900px) {
    .ecg-sidebar {
        display: none;
    }

    .ecg-form-layout {
        display: block;
    }

    .ecg-form-content {
        max-width: 100%;
    }
}

/* Progress Bar */
.ecg-progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 30px;
    position: relative;
}

.ecg-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #568bc8, #cf993e);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.ecg-progress-text {
    display: block;
    text-align: center;
    margin-top: 8px;
    font-size: 0.85em;
    color: #666;
}

/* Form Steps */
.ecg-form-step {
    display: none;
    animation: ecgFadeIn 0.3s ease;
}

.ecg-form-step.active {
    display: block;
}

@keyframes ecgFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Step Header */
.ecg-step-header {
    text-align: center;
    margin-bottom: 30px;
}

.ecg-step-header h2 {
    font-size: 1.5em;
    margin: 0 0 10px 0;
    color: #333;
}

.ecg-step-header p {
    color: #666;
    margin: 0;
}

/* Step Footer */
.ecg-step-footer {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

/* Buttons */
.ecg-btn {
    padding: 14px 35px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.2s ease;
}

.ecg-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ecg-btn-primary,
.ecg-btn-next {
    background: linear-gradient(135deg, #cf993e, #e0a94d);
    color: white;
}

.ecg-btn-secondary,
.ecg-btn-prev {
    background: #f5f5f5;
    color: #333;
}

.ecg-btn-success,
.ecg-btn-submit {
    background: linear-gradient(135deg, #28a745, #34c759);
    color: white;
    padding: 16px 40px;
    font-size: 1.1em;
}

/* Input Groups */
.ecg-input-group {
    position: relative;
    margin-bottom: 20px;
}

.ecg-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.ecg-input:focus {
    outline: none;
    border-color: #568bc8;
}

.ecg-input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.ecg-input-prefix,
.ecg-input-suffix {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-weight: 500;
}

.ecg-input-prefix {
    left: 15px;
}

.ecg-input-suffix {
    right: 15px;
}

.ecg-input-group .ecg-input-prefix + .ecg-input {
    padding-left: 50px;
}

/* Radio Groups */
.ecg-radio-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ecg-radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.ecg-radio-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.ecg-radio-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.ecg-radio-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media only screen and (max-width: 768px) {
    .ecg-radio-grid-2,
    .ecg-radio-grid-3,
    .ecg-radio-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media only screen and (max-width: 480px) {
    .ecg-radio-grid-2,
    .ecg-radio-grid-3,
    .ecg-radio-grid-4 {
        grid-template-columns: 1fr;
    }
}

.ecg-radio-option {
    cursor: pointer;
}

.ecg-radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ecg-radio-label {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.2s ease;
    background: white;
}

.ecg-radio-option:hover .ecg-radio-label,
.ecg-radio-option.selected .ecg-radio-label,
.ecg-radio-option input:checked + .ecg-radio-label {
    border-color: #cf993e;
    background: rgba(207, 153, 62, 0.05);
}

.ecg-radio-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #568bc8;
}

.ecg-radio-text {
    font-weight: 500;
    color: #333;
}

/* Provider Grid */
.ecg-provider-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.ecg-provider-option {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.ecg-provider-option:hover {
    transform: scale(1.05);
}

.ecg-provider-option img {
    border: 3px solid transparent;
    border-radius: 10px;
    max-width: 120px;
    height: auto;
}

.ecg-provider-option.selected img,
.ecg-provider-option input:checked + img {
    border-color: #cf993e;
    box-shadow: 0 4px 12px rgba(207, 153, 62, 0.3);
}

.ecg-loading {
    text-align: center;
    color: #666;
    padding: 20px;
}

/* Slider Groups */
.ecg-slider-group {
    text-align: center;
}

.ecg-slider-display {
    margin-bottom: 20px;
}

.ecg-slider-display p {
    margin: 0;
    font-weight: bold;
}

.ecg-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ecg-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    outline: none;
}

.ecg-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #cf993e, #e0a94d);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(207, 153, 62, 0.4);
}

.ecg-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #cf993e, #e0a94d);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(207, 153, 62, 0.4);
}

/* Map Container */
.ecg-map-container {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.ecg-map-container #wf_est_googleMap {
    height: 350px;
    min-height: 300px;
}

/* Contact Preference Styles */
.ecg-contact-yes {
    border-color: #28a745 !important;
}

.ecg-radio-option input:checked + .ecg-contact-yes {
    background: rgba(40, 167, 69, 0.1) !important;
    border-color: #28a745 !important;
}

.ecg-contact-no {
    border-color: #6c757d !important;
}

.ecg-radio-option input:checked + .ecg-contact-no {
    background: rgba(108, 117, 125, 0.1) !important;
    border-color: #6c757d !important;
}

/* Field Errors */
.ecg-field-error {
    color: #dc3545;
    font-size: 0.85em;
    margin-top: 5px;
}

.ecg-input.error {
    border-color: #dc3545;
}

/* Mobile Responsive */
@media only screen and (max-width: 768px) {
    .ecg-solar-form {
        padding: 15px;
    }

    .ecg-step-header h2 {
        font-size: 1.3em;
    }

    .ecg-radio-group {
        gap: 10px;
    }

    .ecg-radio-label {
        padding: 15px;
    }

    .ecg-radio-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ecg-btn {
        padding: 12px 25px;
    }

    .ecg-step-footer {
        flex-direction: column;
    }

    .ecg-step-footer .ecg-btn {
        width: 100%;
    }

    .ecg-map-container #wf_est_googleMap {
        height: 300px;
    }
}
