.solar-calc-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    font-family: 'Outfit', 'Inter', sans-serif;
    color: #333;
}

.solar-calc-header {
    text-align: center;
    margin-bottom: 20px;
}

.calc-intro {
    font-size: 1.1em;
    font-style: italic;
    color: #555;
    margin-bottom: 8px;
}

.calc-subintro {
    font-size: 1em;
    font-style: italic;
    margin-bottom: 15px;
}

.calc-subintro strong {
    color: #28a745;
}

.calc-image-container {
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
}

.calc-main-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

/* Custom Range Slider */
.range-container {
    margin: 20px 0 10px !important;
}

#bill-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #007bff 0%, #ff0000 100%) !important;
    outline: none;
    cursor: pointer;
}

#bill-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    background: #007bff !important;
    border: 4px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s;
}

#bill-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.bill-display {
    text-align: center;
    margin: 10px 0 !important;
}

.bill-display .label {
    font-size: 1.1em;
    font-weight: 600;
}

.bill-display .value {
    color: #ff0000;
    font-size: 1.4em;
    font-weight: 700;
    margin-left: 10px;
}

.input-container {
    text-align: center;
    margin-bottom: 40px;
}

#bill-input {
    width: 100%;
    padding: 15px;
    font-size: 1.5em;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #666;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px !important;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    justify-content: center;
}

.input-group {
    flex: 1;
}

.input-group label {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    color: #666;
    margin-bottom: 5px;
    text-align: center;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-group input {
    width: 100% !important;
    padding: 10px !important;
    font-size: 20px !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    text-align: center !important;
    background: #fff !important;
    box-sizing: border-box !important;
    height: 50px !important;
    line-height: normal !important;
    display: block !important;
    box-shadow: none !important;
}

.input-divider {
    font-weight: 700 !important;
    color: #fff !important;
    background: #ff7a50 !important;
    /* Màu cam rực rỡ để nổi bật hẳn */
    width: 45px !important;
    height: 45px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    margin-top: 10px !important;
    /* Đẩy lên cao để khớp với tâm của input thay vì nhãn */
    flex-shrink: 0 !important;
    border: 3px solid #fff !important;
    box-shadow: 0 4px 10px rgba(255, 122, 80, 0.4) !important;
    z-index: 5 !important;
}

/* Results section */
.calc-results-section {
    border-top: 1px solid #eee;
    position: relative;
    /* Cho phép watermark căn theo container này */
    overflow: hidden;
}

.solar-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.25;
    /* Tăng thêm độ nét cho logo */
    z-index: 0;
    pointer-events: none;
    width: 48%;
    text-align: center;
}

.solar-watermark img {
    max-width: 100%;
    height: auto;
    /* Bỏ grayscale để logo có màu sắc nhẹ, dễ nhận diện hơn */
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #ddd;
    position: relative;
    z-index: 1;
    /* Nằm trên watermark */
}

.result-row.highlight {
    background: rgba(0, 0, 0, 0.03);
    /* Cực kỳ mờ để không che logo chìm */
}

.res-label {
    flex: 1;
    font-size: 1em;
    color: #555;
    padding-right: 20px;
}

.res-value {
    font-size: 1.2em;
    font-weight: 600;
    color: #28a745;
    min-width: 120px;
    text-align: right;
}

.res-unit {
    font-size: 0.8em;
    font-weight: 400;
    color: #888;
    margin-left: 2px;
}

.calc-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

.btn-primary,
.btn-secondary {
    flex: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px 15px !important;
    border-radius: 8px !important;
    border: none !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    text-transform: uppercase !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    text-decoration: none !important;
    line-height: normal !important;
    color: #fff !important;
    text-align: center !important;
    white-space: nowrap !important;
    /* Mặc định giữ 1 dòng cho Desktop */
    box-sizing: border-box !important;
    height: 50px !important;
    /* Cố định chiều cao trên Desktop */
    gap: 8px !important;
}

.btn-primary {
    background: #007bff !important;
}

.btn-primary:hover {
    background: #0056b3 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

.btn-secondary {
    background: #6c757d !important;
}

.btn-secondary:hover {
    background: #5a6268 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(108, 117, 125, 0.3);
}

/* Căn chỉnh lại icon trong nút */
.btn-primary .dashicons,
.btn-secondary .dashicons {
    font-size: 20px !important;
    width: 20px !important;
    height: 20px !important;
    line-height: 20px !important;
}

.btn-secondary:hover {
    background: #5a6268;
}

@media (max-width: 600px) {
    .solar-calc-container {
        padding: 15px;
        margin: 10px;
    }

    .input-row {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 15px;
    }

    .input-group {
        width: 100%;
    }

    .bill-display {
        margin: 10px 0;
    }

    .bill-display .label {
        font-size: 1em;
        display: block;
        margin-bottom: 5px;
    }

    .bill-display .value {
        font-size: 1.2em;
        margin-left: 0;
        display: block;
    }

    .input-divider {
        margin: 5px auto !important;
        padding: 0 !important;
        /* Loại bỏ khoảng trống thừa để cân đối với input xếp dọc */
    }

    .result-row {
        flex-direction: row;
        /* Giữ row nhưng cho phép quấn nếu cần, hoặc stack */
        justify-content: space-between;
        align-items: flex-start;
        padding: 10px 0;
    }

    .res-label {
        font-size: 0.9em;
        line-height: 1.3;
    }

    .res-value {
        font-size: 1.1em;
        min-width: 80px;
    }

    .calc-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}

/* --- Floating Button --- */
#solar-floating-button {
    position: fixed;
    bottom: 30px;
    z-index: 99999;
    background: #007bff;
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
}

#solar-floating-button.bottom-right {
    right: 30px;
}

#solar-floating-button.bottom-left {
    left: 30px;
}

#solar-floating-button:hover {
    transform: scale(1.05) translateY(-5px);
    background: #0056b3;
}

#solar-floating-button .sf-icon {
    background: white;
    color: #007bff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Modal --- */
#solar-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: none;
    /* Ẩn mặc định */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

#solar-modal-overlay.active {
    display: flex;
    opacity: 1;
}

#solar-modal-container {
    background: white;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#solar-modal-overlay.active #solar-modal-container {
    transform: scale(1);
}

#solar-modal-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#solar-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

#solar-modal-close {
    cursor: pointer;
    font-size: 24px;
    color: #999;
    transition: color 0.3s;
}

#solar-modal-close:hover {
    color: #333;
}

#solar-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 60px);
}

/* Bù đắp để calculator hiển thị đẹp trong modal */
#solar-modal-body .dutoan-solar-container {
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
}

#solar-modal-body .solar-calc-body {
    margin-top: 5px !important;
}

#solar-modal-body .range-container {
    margin-top: 0 !important;
    margin-bottom: 5px !important;
}

#solar-modal-body .calc-input-section {
    padding: 10px 12px !important;
    margin-bottom: 10px !important;
}

#solar-modal-body .bill-display {
    margin: 0 0 5px 0 !important;
}

#solar-modal-body .input-row {
    padding: 10px !important;
    gap: 10px !important;
    margin-bottom: 0 !important;
}

#solar-modal-body .solar-calc-header {
    margin-bottom: 10px !important;
}

#solar-modal-body .solar-watermark {
    opacity: 0.1 !important;
    /* Mờ hơn trong modal cho đỡ rối */
}

/* Responsive cho modal & nút bấm */
@media (max-width: 600px) {
    #solar-floating-button .sf-text {
        display: block !important;
        font-size: 13px !important;
        margin-left: 5px !important;
    }

    #solar-floating-button {
        padding: 8px 12px !important;
        border-radius: 30px !important;
    }

    #solar-modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .calc-actions {
        flex-direction: column !important;
        gap: 12px !important;
        padding: 0 !important;
    }

    .btn-primary,
    .btn-secondary {
        width: 100% !important;
        flex: none !important;
        font-size: 13px !important;
        /* Giảm nhẹ font để fit chữ dài */
        padding: 10px 12px !important;
        white-space: normal !important;
        text-align: center !important;
        display: flex !important;
        justify-content: center !important;
        min-height: 48px !important;
    }
}