* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, #e30613 0%, #c00510 100%);
    color: white;
    padding: 30px 40px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 2.5em;
    font-weight: 300;
}

.express {
    font-style: italic;
    font-weight: 600;
}

main {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.config-section {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #e30613;
}

.form-control:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.units-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    padding: 25px;
    background-color: #fafafa;
    border-radius: 8px;
    border: 2px solid #eee;
}

.unit-group {
    display: flex;
    flex-direction: column;
}

.unit-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #e30613;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #c00510;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(227, 6, 19, 0.3);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

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

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.info-section {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 30px;
}

.info-text {
    font-size: 14px;
    color: #856404;
    margin-bottom: 8px;
}

.info-text:last-child {
    margin-bottom: 0;
}

.results-section {
    margin-top: 40px;
}

.results-section h2 {
    color: #e30613;
    margin-bottom: 25px;
    font-size: 1.8em;
    border-bottom: 3px solid #e30613;
    padding-bottom: 10px;
}

.configuration-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
}

.configuration-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #e30613;
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.config-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
}

.config-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 6px 15px;
    font-size: 14px;
}

.btn-edit {
    background-color: #007bff;
    color: white;
}

.btn-edit:hover {
    background-color: #0056b3;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
}

.btn-delete:hover {
    background-color: #c82333;
}

.config-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.detail-section {
    padding: 20px;
    border-radius: 6px;
}

.detail-section.cooling {
    background-color: #e3f2fd;
    border: 2px solid #90caf9;
}

.detail-section.heating {
    background-color: #fff3e0;
    border: 2px solid #ffb74d;
}

.detail-section h3 {
    color: #000;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
}

.capacity-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    background: white;
    border-radius: 4px;
    overflow: hidden;
}

.capacity-table th,
.capacity-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid #ddd;
}

.capacity-table th {
    background-color: rgba(0, 0, 0, 0.05);
    font-weight: 600;
    color: #000;
}

.capacity-table td {
    color: #000;
}

.capacity-table tr:first-child th {
    background-color: rgba(0, 0, 0, 0.08);
    color: #000;
    font-weight: 700;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #555;
}

.detail-value {
    color: #333;
    font-weight: 500;
}

.totals-section {
    grid-column: 1 / -1;
    padding: 15px;
    border-radius: 6px;
    border: 2px solid #dee2e6;
}

.totals-section h3 {
    color: #000;
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 10px;
}

.totals-grid {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.total-item {
    background: white;
    padding: 10px 15px;
    border-radius: 6px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    min-width: 100px;
    flex: 0 0 auto;
}

.total-label {
    font-size: 0.85em;
    color: #000;
    margin-bottom: 5px;
    font-weight: 600;
}

.total-value {
    font-size: 1.2em;
    font-weight: 700;
    color: #000;
}

@media (max-width: 1024px) {
    .config-details {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .totals-grid {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .config-details {
        grid-template-columns: 1fr;
    }

    .units-container {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .totals-grid {
        justify-content: center;
    }
}

/* ── Comparison table ── */

.comparison-wrapper {
    overflow-x: auto;
    margin-top: 12px;
}

.comparison-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 400px;
    font-size: 0.85rem;
}

/* Label column (first column) */
.comparison-table .label-col {
    text-align: left;
    padding: 6px 12px;
    white-space: nowrap;
    font-weight: 500;
    color: #333;
    background: #f5f5f5;
    border: 1px solid #ddd;
    min-width: 160px;
}

/* Config column header */
.comparison-table .config-col-header {
    text-align: center;
    padding: 8px 12px;
    background: #2c3e50;
    color: #fff;
    border: 1px solid #1a252f;
    min-width: 140px;
    vertical-align: middle;
}

.comparison-table .col-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

/* Data cells */
.comparison-table .data-cell {
    text-align: center;
    padding: 6px 12px;
    border: 1px solid #ddd;
    color: #111;
    background: #fff;
}

/* Alternating row background */
.comparison-table tr:not(.row-section):not(.row-header):nth-child(even) .data-cell,
.comparison-table tr:not(.row-section):not(.row-header):nth-child(even) .label-col {
    background: #fafafa;
}

/* Section separator rows */
.comparison-table .row-section td.section-label {
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 6px 12px;
    border: 1px solid #ccc;
}

.comparison-table .section-cooling {
    background: #d0e8f8;
    color: #1a4a6e;
}

.comparison-table .section-heating {
    background: #fde8cc;
    color: #7a3a00;
}

/* Colored label cells for cooling/heating data rows */
.comparison-table .label-col.cell-cooling {
    background: #e8f4fc;
}

.comparison-table .label-col.cell-heating {
    background: #fef3e2;
}

/* Colored data cells */
.comparison-table .data-cell.cell-cooling {
    background: #f0f9ff;
}

.comparison-table .data-cell.cell-heating {
    background: #fffaf3;
}

/* Total rows bold */
.comparison-table .label-col.total,
.comparison-table .data-cell.total {
    font-weight: 700;
}

.comparison-table .data-cell.cell-cooling.total {
    background: #d6eefa;
}

.comparison-table .data-cell.cell-heating.total {
    background: #fde9c9;
}

/* Delete button inside header */
.comparison-table .btn-delete.btn-small {
    display: block;
    margin: 4px auto 0;
    padding: 2px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    border: none;
    border-radius: 3px;
    background: #e74c3c;
    color: #fff;
}

.comparison-table .btn-delete.btn-small:hover {
    background: #c0392b;
}

/*Language bar*/
.lang-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 8px 0 4px;
}

.lang-bar label {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
}

#langSelect {
    height: 28px;
    padding: 0 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.82rem;
    background: #fff;
    cursor: pointer;
}

.config-bar {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
    background: #f5f6f7;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 16px;
}

.config-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.config-field label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.config-field select {
    height: 36px;
    padding: 0 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.85rem;
    background: #fff;
    color: #111;
    cursor: pointer;
    min-width: 80px;
}

.config-field select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.config-field select:disabled {
    background: #eee;
    color: #aaa;
    cursor: not-allowed;
}

#numUnits {
    width: 70px;
}

#outdoorUnit {
    width: 260px;
}

.unit-inline-select {
    width: 80px;
}

.config-separator {
    width: 1px;
    height: 36px;
    background: #ccc;
    align-self: flex-end;
    margin: 0 4px;
}

.btn-add-inline {
    height: 36px;
    padding: 0 18px;
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    align-self: flex-end;
    margin-left: 6px;
}

.btn-add-inline:hover {
    background: #219150;
}

.footer-area {
    margin-top: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.info-block p {
    margin: 2px 0;
    font-size: 0.78rem;
    color: #666;
}

.btn-reset-all {
    height: 34px;
    padding: 0 16px;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-reset-all:hover {
    background: #a93226;
}

.button-group {
    display: none;
}