/* --- Main Container --- */
.concrete-calculator-container {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --light-gray: #f8f9fa;
    --medium-gray: #bdc3c7;
    --dark-gray: #7f8c8d;
    --bg-color: #ffffff;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;

    /*font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;*/
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    /*max-width: 1200px;*/
    /*margin: 20px auto;*/
    padding: 20px;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

@media (min-width: 992px) {
    .concrete-calculator-container {
        grid-template-columns: 1fr 1fr;
        padding: 20px;
    }
}

.table {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* --- Form Wrapper --- */
.calculator-form-wrapper,
.calculator-results-wrapper {
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--card-shadow);
}

.form-section {
    margin-bottom: 25px;
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 20px;
}
.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
}

/* --- Form Groups & Inputs --- */
.input-row {
    display: flex;
    gap: 5px;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.form-group.large {
    flex: 3;
}
.form-group.unit-label-group {
    flex: 0 1 40px;
    padding-bottom: 12px;
}
.unit-label {
    font-weight: bold;
    color: var(--dark-gray);
}


label {
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--dark-gray);
}

input[type="number"],
select {
    width: 100%;
    /*padding: 12px;*/
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* --- Button Group (Switchers) --- */
.btn-group {
    display: flex;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.btn-group .btn {
    flex: 1;
    padding: 12px 10px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    background-color: #ffffff;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.3s, color 0.3s;
    text-align: center;
}
.btn-group .btn:not(:last-child) {
    border-right: none;
}
.btn-group .btn.active {
    background-color: var(--secondary-color);
    color: #fff;
    border-color: var(--secondary-color);
}

/* --- Slider --- */
.slider-group {
    display: flex;
    align-items: center;
    gap: 15px;
}
#waste-percentage {
    font-weight: bold;
    color: var(--primary-color);
    min-width: 40px;
}

input[type=range].slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: var(--light-gray);
    outline: none;
    border-radius: 5px;
}

input[type=range].slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    background: var(--secondary-color);
    cursor: pointer;
    border-radius: 50%;
    margin-top: -11px; /* (30 - 8) / 2 = 11 */
}

input[type=range].slider::-moz-range-thumb {
    width: 30px;
    height: 30px;
    background: var(--secondary-color);
    cursor: pointer;
    border-radius: 50%;
    margin-top: -11px; /* (30 - 8) / 2 = 11 */
}

/* --- Results Section --- */
.results-main-title {
    text-align: center;
    color: var(--primary-color);
    margin-top: 0;
}
.results-output-container {
    min-height: 200px;
}

.no-results, .error-results {
    text-align: center;
    color: var(--dark-gray);
    font-size: 1.1rem;
    padding: 40px 20px;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
}

.error-results {
    color: #e74c3c;
    font-weight: bold;
}

.results-summary {
    text-align: center;
    margin-bottom: 25px;
    padding: 15px;
    background: var(--light-gray);
    border-radius: var(--border-radius);
}
.results-summary h4 {
    margin: 0 0 5px 0;
    color: var(--dark-gray);
}
.results-summary p {
    margin: 0;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.results-table-container h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--primary-color);
}
.results-table {
    width: 100%;
    border-collapse: collapse;
}
.results-table th, .results-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}
.results-table th {
    font-weight: 600;
    color: var(--dark-gray);
}
.results-table td {
    color: var(--primary-color);
}
.results-table tbody tr:last-child td {
    border-bottom: none;
}
.results-table .dot {
    height: 12px;
    width: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}
.dot.cement { background-color: #708090; }
.dot.sand { background-color: #f4a460; }
.dot.gravel { background-color: #a9a9a9; }
.dot.water { background-color: #3498db; }

/* --- Chart --- */
.chart-container {
    position: relative;
    height: 300px;
    margin-top: 30px;
}

@media (min-width: 992px) {
    .chart-container {
        height: 350px;
    }
}

/* --- Loader --- */
.loader {
    border: 5px solid var(--light-gray);
    border-top: 5px solid var(--secondary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 60px auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
