/* Main wrapper for the calculator */
#awc-calculator-wrapper {
    max-width: 800px;
    margin: 20px auto;
    padding: 15px; /* MODIFIED: Reduced padding */
    background-color: #f7f9fc;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    font-family: sans-serif;
}

#awc-calculator-wrapper h2 {
    text-align: center;
    color: #2d3748;
    margin-bottom: 15px; /* MODIFIED: Reduced margin */
}

.awc-form-panel {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 20px; /* MODIFIED: Reduced padding */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Section for adding new appliances */
.awc-add-appliance-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px; /* MODIFIED: Reduced margin */
    flex-wrap: wrap;
    padding-bottom: 15px; /* MODIFIED: Reduced padding */
    border-bottom: 1px solid #e2e8f0;
}

.awc-add-appliance-section label {
    font-weight: bold;
    color: #4a5568;
}

.awc-add-appliance-section select {
    flex-grow: 1;
    padding: 8px;
}

/* Container for the table to allow responsive horizontal scrolling */
.awc-table-container {
    width: 100%;
    overflow-x: auto;
}

/* Table for selected appliances */
#awc-selected-appliances {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px; /* MODIFIED: Reduced margin */
}

#awc-selected-appliances th,
#awc-selected-appliances td {
    border: 1px solid #ddd;
    padding: 10px 8px;
    text-align: center;
    vertical-align: middle;
}

#awc-selected-appliances th {
    background-color: #f8f9fa;
    font-weight: bold;
    white-space: nowrap;
    color: #333;
}

/* Set fixed widths for table headers to align columns */
#awc-selected-appliances th:nth-child(2), /* Quantity */
#awc-selected-appliances td:nth-child(2) {
    width: 70px;
}
#awc-selected-appliances th:nth-child(3), /* Watts */
#awc-selected-appliances td:nth-child(3) {
    width: 100px;
}
#awc-selected-appliances th:nth-child(4), /* Hours */
#awc-selected-appliances td:nth-child(4) {
    width: 80px;
}
#awc-selected-appliances th:nth-child(5), /* Wh/day */
#awc-selected-appliances td:nth-child(5) {
    width: 110px;
}
#awc-selected-appliances th:nth-child(6), /* Action */
#awc-selected-appliances td:nth-child(6) {
    width: 100px;
}


/* Input fields within the table */
.awc-input {
    padding: 5px;
    box-sizing: border-box; 
    text-align: center;
    width: 100%; 
}

.awc-input.awc-quantity {
    width: 60px !important;
}

.awc-input.awc-watts {
    width: 90px !important;
}

.awc-input.awc-hours {
    width: 70px !important;
}

.awc-input.awc-custom-name {
    max-width: 160px;
    text-align: left;
}

.awc-row-total {
    font-weight: bold;
    color: #1e5c0a;
    width: 100px;
    display: inline-block;
}

.awc-remove-row {
    background-color: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    width: 80px !important;
    font-size: 13px !important;
    padding: 6px 0 !important;
}

.awc-remove-row:hover {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
}

/* Total results section */
#awc-total-results-section {
    margin-top: 15px; /* MODIFIED: Reduced margin */
    padding-top: 15px; /* MODIFIED: Reduced padding */
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

#awc-total-results-section h3 {
    margin: 8px 0; /* MODIFIED: Reduced margin */
    color: #1e5c0a;
}

#awc-total-results-section h4 {
    margin: -5px 0 8px; /* MODIFIED: Reduced margin */
    color: #4a5568;
    font-weight: normal;
}

/* Styles for Solution Button */
.awc-solution-section {
    text-align: center;
    margin-top: 15px; /* MODIFIED: Reduced margin to bring button closer */
    padding-top: 15px; /* MODIFIED: Reduced padding */
    border-top: 1px solid #e1e4e8;
}

.awc-solution-button {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
    padding: 12px 25px !important;
    font-size: 18px !important;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    line-height: 1.5;
    text-shadow: none;
    transition: background-color 0.2s ease-in-out;
}

.awc-solution-button:hover {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
}

/* Style overrides for the jQuery UI Dialog popup */
.ui-widget.ui-widget-content {
    border: 1px solid #ddd;
}
.ui-dialog .ui-dialog-titlebar {
    background: #f2f2f2;
    border: 1px solid #ddd;
    border-bottom: none;
    color: #333;
    font-weight: bold;
}
.ui-dialog .ui-dialog-buttonpane {
    border-top: 1px solid #ddd;
}

/* Styles for our custom form in the modal */
.awc-form-field {
    margin-bottom: 15px;
}
.awc-form-field label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}
.awc-form-field input[type="text"],
.awc-form-field input[type="email"],
.awc-form-field input[type="tel"] {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.awc-required {
    color: red;
}
.awc-form-submit {
    text-align: center;
    margin-top: 20px;
}
.awc-form-submit .awc-solution-button {
    width: 100%;
}

/* Styles for the success/error notice box */
.awc-notice {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}
.awc-notice-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}
.awc-notice-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}