

/* --- Main Container & Layout --- */


.form-grid, .results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.form-column, .results-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- Form Styling --- */
#nutrition-form fieldset {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 15px;
    background-color: #fff;
    margin: 0;
}

#nutrition-form legend {
    font-weight: 600;
    font-size: 1.1em;
    padding: 0 8px;
    color: #005a3c;
}

.form-group {
    margin-bottom: 15px;
}
.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 0.9em;
}

#nutrition-form select, #nutrition-form input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    font-size: 1em;
    box-sizing: border-box;
}

.radio-group label, .checkbox-options label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.95em;
    font-weight: normal;
}

.radio-group input[type="radio"], .checkbox-options input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #005a3c;
}

.checkbox-group.wide .checkbox-options {
    display: flex;
    gap: 20px;
}

.form-actions {
    text-align: center;
    margin-top: 20px;
}

#reset-btn {
    background-color: #e84118;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.2s;
}
#reset-btn:hover {
    background-color: #c23616;
}

/* --- Results Section --- */
#results-container {
    margin-top: 25px;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #005a3c;
    border-radius: 8px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.results-header h3 {
    margin: 0;
    color: #005a3c;
    font-size: 1.5em;
}
#serving-size-display {
    font-size: 0.9em;
    color: #555;
    font-weight: 500;
}

.results-calories {
    text-align: center;
    background: #ffc20e;
    padding: 15px;
    border-radius: 8px;
}

#total-calories {
    display: block;
    font-size: 3.5em;
    font-weight: 700;
    color: #333;
    line-height: 1;
}

.results-calories label {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

/* Chart & Bars */
.results-chart, .results-bars, .results-details {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #eee;
}

h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

#macro-pie-chart {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 15px;
    background: conic-gradient(#e74c3c 0% 33.3%, #f1c40f 33.3% 66.6%, #3498db 66.6% 100%);
}

#macro-legend .legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 3px;
    margin-right: 8px;
}
.legend-item.protein .legend-color { background-color: #e74c3c; }
.legend-item.carbs .legend-color { background-color: #3498db; }
.legend-item.fat .legend-color { background-color: #f1c40f; }

.tooltip-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: #aaa;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 12px;
    line-height: 16px;
    cursor: help;
    font-weight: bold;
}

.dv-bar-item {
    display: grid;
    grid-template-columns: 1fr 2fr 50px;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9em;
}
.dv-bar {
    width: 100%;
    height: 12px;
    background-color: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}
.dv-bar .bar {
    height: 100%;
    width: 0;
    background-color: #e74c3c;
    border-radius: 6px;
    transition: width 0.5s ease-out;
}
.dv-pct { font-weight: 600; }

/* Detailed Table */
.results-details table {
    width: 100%;
    border-collapse: collapse;
}
.results-details td {
    padding: 8px 5px;
    border-bottom: 1px solid #eee;
    font-size: 0.95em;
}
.results-details td:last-child {
    text-align: right;
    font-weight: 600;
}
.results-details tr:last-child td {
    border-bottom: none;
}
.results-details tr.sub-detail td {
    padding-left: 20px;
    font-size: 0.85em;
    color: #555;
}

/* Warning */
#results-warning {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    background-color: #fffbe6;
    border: 1px solid #ffe58f;
    color: #d46b08;
}
#results-warning.hidden {
    display: none;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .form-grid, .results-grid {
        grid-template-columns: 1fr;
    }
    #subway-calc-container {
        padding: 15px;
    }
}
