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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

.header {
    background: #0072bc;
    color: white;
    padding: 16px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin: 0;
}

.date-display {
    color: white;
    font-size: 14px;
}

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

.calorie-summary {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

.summary-item {
    flex: 1;
    text-align: center;
}

.summary-label {
    font-size: 12px;
    color: #73879c;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
}

.summary-value-editable input {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    border: none;
    text-align: center;
    width: 100%;
    background: transparent;
    padding: 0;
}

.summary-value-editable input:focus {
    outline: 2px solid #0072bc;
    border-radius: 4px;
    background: #f8f9fa;
}

.summary-divider {
    font-size: 24px;
    color: #73879c;
    font-weight: 300;
}

.summary-item.food .summary-value {
    color: #0072bc;
}

.summary-item.remaining .summary-value {
    color: #4caf50;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #0072bc;
    transition: width 0.3s ease, background 0.3s ease;
    width: 0%;
    border-radius: 6px;
}

.diary-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-header {
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    color: #2c3e50;
    font-weight: 600;
}

.add-food-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.food-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 15px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.food-input:focus {
    outline: none;
    border-color: #0072bc;
    box-shadow: 0 0 0 3px rgba(0, 114, 188, 0.1);
}

.add-food-bottom {
    display: flex;
    gap: 12px;
}

.calories-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.calories-input:focus {
    outline: none;
    border-color: #0072bc;
    box-shadow: 0 0 0 3px rgba(0, 114, 188, 0.1);
}

.add-food-btn {
    padding: 12px 24px;
    background: #0072bc;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.add-food-btn:hover {
    background: #005a94;
}

.add-food-btn:active {
    transform: translateY(1px);
}

.meals-list {
    margin-top: 20px;
}

#meals-container {
    list-style: none;
}

.meal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: box-shadow 0.2s;
}

.meal-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.meal-info {
    flex: 1;
}

.meal-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
    margin-bottom: 4px;
}

.meal-calories {
    color: #0072bc;
    font-size: 18px;
    font-weight: 700;
    margin-right: 16px;
}

.delete-btn {
    background: transparent;
    color: #dc3545;
    border: 1px solid #dc3545;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

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

.reset-btn {
    width: 100%;
    padding: 14px;
    background: white;
    color: #dc3545;
    border: 2px solid #dc3545;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

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

.over-goal {
    color: #dc3545 !important;
}

@media (max-width: 600px) {
    .summary-row {
        flex-wrap: wrap;
    }

    .summary-value {
        font-size: 24px;
    }

    .summary-value-editable input {
        font-size: 24px;
    }

    .add-food-bottom {
        flex-direction: column;
    }

    .meal-item {
        flex-wrap: wrap;
        gap: 10px;
    }
}
