/* assets/css/frontend.css (Style Hoàn chỉnh) */

/* --- Cấu hình chung --- */
.evn-calc-container {
    /* CHỈNH SỬA: Tăng chiều rộng tối đa lên 850px */
    max-width: 850px; 
    margin: 20px auto;
    padding: 30px 25px; /* Tăng padding để thoáng hơn */
    border: 1px solid #d0d0d0; /* Viền sáng hơn */
    border-radius: 12px; /* Bo góc mềm mại hơn */
    background: #ffffff; /* Nền trắng tinh */
    box-shadow: 0 6px 18px rgba(0,0,0,0.08); /* Shadow rõ ràng nhưng nhẹ nhàng */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

/* --- Tab Navigation --- */
.evn-calc-tabs {
    list-style: none; /* Loại bỏ dấu chấm đen */
    padding: 0;
    margin: 0 0 25px 0; /* Tăng margin bottom */
    display: flex;
    border-bottom: 2px solid #0073aa; /* Giảm độ dày border */
    font-size: 16px; /* Tăng kích thước font */
    flex-wrap: wrap; 
}
.evn-calc-tabs li {
    padding: 12px 18px; /* Tăng padding */
    cursor: pointer;
    background: #f8f8f8; /* Nền tab mặc định sáng hơn */
    margin-right: 3px;
    border-radius: 8px 8px 0 0;
    transition: background 0.2s, color 0.2s;
    font-weight: 500;
    border: 1px solid #e0e0e0;
    border-bottom: none;
}
.evn-calc-tabs li:hover:not(.active) {
    background: #eef7ff; /* Hover nhẹ nhàng */
    color: #00517a;
}
.evn-calc-tabs li.active {
    background: #0073aa;
    color: white;
    font-weight: 600;
    border-color: #0073aa;
    /* Dùng box-shadow để làm nổi tab active */
    box-shadow: 0 -2px 5px rgba(0, 115, 170, 0.2); 
    position: relative;
    top: 1px;
}
.evn-calc-tabs li.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #0073aa; /* Che đi border-bottom của tab active */
}

/* --- Form Inputs --- */
.evn-calc-form label {
    display: block;
    margin-top: 18px; /* Tăng khoảng cách */
    font-weight: 600;
    color: #1a1a1a;
    font-size: 1.05em; /* Tăng kích thước font cho label */
}
.evn-calc-form input[type="number"], .evn-calc-form select {
    width: 100%;
    max-width: 380px; /* Tăng chiều rộng input */
    padding: 12px; /* Tăng padding */
    margin-top: 8px;
    box-sizing: border-box;
    border: 1px solid #c0c0c0;
    border-radius: 6px;
    font-size: 17px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff; /* Đảm bảo nền trắng */
}
.evn-calc-form input[type="number"]:focus, .evn-calc-form select:focus {
    border-color: #0099cc; /* Màu focus sáng hơn */
    outline: none;
    box-shadow: 0 0 6px rgba(0, 153, 204, 0.4);
}

.radio-group {
    margin-top: 12px;
}
.radio-group label {
    display: inline-block;
    font-weight: normal;
    margin-right: 25px; /* Tăng khoảng cách giữa các radio */
    color: #333;
}
.evn-calc-form button {
    margin-top: 30px; /* Tăng khoảng cách từ button */
    padding: 13px 40px;
    background: #ff5722; /* CHUYỂN SANG MÀU CAM NỔI BẬT */
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 17px;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: background 0.3s, transform 0.1s;
}
.evn-calc-form button:hover {
    background: #e64a19;
    transform: translateY(-1px);
}
.evn-calc-form button:active {
    transform: translateY(1px);
}

/* --- Popup & Overlay --- */
#evn-calc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75); /* Overlay tối hơn */
    z-index: 9999;
}
.evn-calc-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 35px; /* Tăng padding */
    border-radius: 12px;
    z-index: 10000;
    max-width: 90%; 
    width: 700px; /* Tăng chiều rộng popup */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); /* Shadow mạnh hơn */
    max-height: 90vh; 
    overflow-y: auto; 
}
.evn-calc-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 35px;
    font-weight: 300;
    cursor: pointer;
    line-height: 20px;
    color: #aaa;
    transition: color 0.2s;
}
.evn-calc-close-btn:hover {
    color: #dc3545; /* Màu đỏ khi hover */
}

/* --- Bảng Kết quả Chi tiết (result-table) --- */
.evn-calc-popup-content h3 {
    color: #0073aa;
    border-bottom: 2px solid #0073aa; /* Border màu xanh đậm */
    padding-bottom: 10px;
    margin-top: 0;
    font-size: 1.5em;
}
.evn-calc-popup-content h5 {
    color: #ff5722; /* Màu cam cho tiêu đề nhỏ */
    margin-top: 25px;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 1.2em;
}
.result-table, .price-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 15px;
}
.result-table th, .result-table td, .price-table th, .price-table td {
    border: 1px solid #e0e0e0;
    padding: 12px;
    text-align: left;
}
.result-table th, .price-table th {
    background-color: #f0f0f0; /* Nền xám nhạt */
    font-weight: bold;
    color: #333;
}

/* Căn phải cho cột số liệu */
.result-table td:last-child, 
.result-table td:nth-child(2),
.result-table td:nth-child(3),
.price-table td:last-child {
    text-align: right;
}

/* Style cho phần Tổng kết (Total) */
.total-text {
    text-align: right;
    font-size: 28px;
    font-weight: 900; /* Rất đậm */
    color: #c00000 !important; 
    padding-top: 20px;
    margin-top: 20px !important;
    border-top: 3px double #0073aa; /* Đường đôi nổi bật */
}
.evn-calc-note {
    text-align: right;
    margin-top: 15px;
    color: #6c757d;
}

/* --- Smart Budget & Utility Result Styles --- */
.budget-result, .device-result, .solar-result {
    padding: 20px;
    border: 1px solid #0073aa;
    border-radius: 10px;
    margin-top: 25px;
    background: #eaf5ff;
    box-shadow: 0 4px 10px rgba(0, 115, 170, 0.1);
}
.budget-result h3, .device-result h3, .solar-result h3 {
    color: #00517a;
    font-size: 1.4em;
    border-bottom: 2px solid #b3d9ff;
    padding-bottom: 10px;
    margin-top: 0;
}
.budget-result strong, .device-result strong, .solar-result strong {
    font-weight: 700;
    color: #0073aa;
}


/* --- Responsive/Mobile Adjustments --- */
@media (max-width: 768px) {
    .evn-calc-container {
        margin: 10px;
        padding: 15px;
    }
    .evn-calc-tabs li {
        padding: 8px 10px;
        font-size: 13px;
        flex-grow: 1; 
        text-align: center;
        margin-right: 0;
        border-radius: 6px 6px 0 0;
        margin-bottom: 1px;
    }
    .evn-calc-tabs {
        flex-direction: column; 
    }
    .evn-calc-tabs li.active::after {
        display: none;
    }
    .evn-calc-popup {
        width: 95%; 
        max-width: none;
        padding: 15px;
    }
    .result-table, .price-table {
        font-size: 12px;
    }
    .result-table th, .result-table td, .price-table th, .price-table td {
        padding: 8px 5px;
    }
    .total-text {
        font-size: 22px;
    }
    .evn-calc-form input[type="number"], .evn-calc-form select {
        max-width: 100%; 
    }
}