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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.date-display {
    color: #666;
    font-size: 1.1em;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card h3 {
    color: #555;
    font-size: 0.9em;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.stat-value.consumed {
    color: #f093fb;
}

.stat-value.remaining {
    color: #4facfe;
}

.progress-bar {
    background: #e0e0e0;
    border-radius: 10px;
    height: 30px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.add-food-section {
    background: #f9f9f9;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.add-food-section h2 {
    color: #667eea;
    margin-bottom: 20px;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 600;
}

input, select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f093fb;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-secondary:hover {
    transform: translateY(-2px);
}

.btn-small {
    background: #667eea;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 5px;
    font-size: 0.85em;
    cursor: pointer;
}

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

.meals-section > h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.meal-category {
    margin-bottom: 25px;
}

.meal-category h3 {
    color: #555;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #e0e0e0;
}

.food-list {
    min-height: 50px;
}

.food-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s;
}

.food-item:hover {
    border-color: #667eea;
}

.food-info {
    flex: 1;
}

.food-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.food-calories {
    color: #667eea;
    font-weight: bold;
}

.food-time {
    color: #999;
    font-size: 0.85em;
}

.btn-delete {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.btn-delete:hover {
    background: #ee5a5a;
}

.history-section {
    text-align: center;
}

.history-section h2 {
    color: #667eea;
    margin-bottom: 15px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    max-width: 600px;
    max-height: 70vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.history-day {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.history-day h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}
/* Add these to your existing styles.css */

.date-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.btn-nav {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.btn-nav:hover {
    background: #5568d3;
}

.btn-nav:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-today {
    background: #4facfe;
    color: white;
    border: none;
    padding: 6px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.btn-today:hover {
    background: #3a9be0;
}

.history-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.stat-card {
    background: #f0f4ff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.stat-card h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1em;
}

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

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

.stat-label {
    color: #666;
}

.stat-value-inline {
    font-weight: bold;
    color: #667eea;
}

.weekly-chart {
    margin-top: 15px;
}

.chart-bar {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.chart-label {
    width: 100px;
    font-size: 0.9em;
    color: #666;
}

.chart-bar-bg {
    flex: 1;
    background: #e0e0e0;
    border-radius: 5px;
    height: 25px;
    position: relative;
    overflow: hidden;
}

.chart-bar-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    border-radius: 5px;
    display: flex;
    align-items: center;
    padding-left: 10px;
    color: white;
    font-size: 0.85em;
    font-weight: bold;
}

.chart-bar-fill.over-goal {
    background: linear-gradient(90deg, #ff6b6b 0%, #ee5a5a 100%);
}

.monthly-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.day-card {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.day-card.over-goal {
    border-color: #ff6b6b;
}

.day-card.under-goal {
    border-color: #4facfe;
}

.day-card-date {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
}

.day-card-calories {
    font-size: 1.3em;
    font-weight: bold;
    color: #667eea;
}

.day-card-items {
    font-size: 0.8em;
    color: #999;
    margin-top: 5px;
}
/* Password Protection Styles */
.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.password-modal {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.password-modal h2 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 2em;
}

.password-modal p {
    color: #666;
    margin-bottom: 25px;
}

.password-modal input[type="password"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.1em;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

.password-modal input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
}

.password-error {
    color: #ff6b6b;
    margin-top: 10px;
    font-weight: 600;
    min-height: 20px;
}

.password-overlay .btn-primary {
    margin-top: 0;
}
/* Additional styles for nutrient tracking */

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.card-fiber .stat-value {
    color: #4caf50;
}

.card-sugar .stat-value {
    color: #ff9800;
}

.card-fat .stat-value {
    color: #f44336;
}

.goal-text {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
    margin-bottom: 10px;
}

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

.progress-item {
    margin-bottom: 15px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #555;
    font-weight: 600;
}

.fiber-fill {
    background: linear-gradient(90deg, #4caf50 0%, #45a049 100%);
}

.sugar-fill {
    background: linear-gradient(90deg, #ff9800 0%, #f57c00 100%);
}

.satfat-fill {
    background: linear-gradient(90deg, #f44336 0%, #e53935 100%);
}

.fiber-fill.over-goal,
.sugar-fill.over-goal,
.satfat-fill.over-goal {
    background: linear-gradient(90deg, #ff6b6b 0%, #ee5a5a 100%);
}

.nutrient-goals-section {
    margin: 0 0 30px;
}

.nutrient-goals-section h2 {
    color: #667eea;
    margin-bottom: 15px;
}

.nutrient-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.nutrient-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    padding: 18px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.nutrient-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.nutrient-card-header h3 {
    color: #555;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.nutrient-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
    text-align: center;
}

.nutrient-stat-label {
    font-size: 0.75em;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.nutrient-stat-value {
    font-size: 1.2em;
    font-weight: bold;
}

.card-fat .nutrient-stat-value { color: #f44336; }
.card-fiber .nutrient-stat-value { color: #4caf50; }
.card-sugar .nutrient-stat-value { color: #ff9800; }

.nutrient-progress {
    height: 10px;
    margin-bottom: 0;
}

.nutrient-section {
    background: #f0f4ff;
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
}

.nutrient-section h3 {
    color: #667eea;
    font-size: 1em;
    margin-bottom: 15px;
}

.form-row-three {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.nutrient-badge {
    display: inline-block;
    background: #e8f5e9;
    color: #4caf50;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.75em;
    margin-left: 5px;
    font-weight: 600;
}

.nutrient-badge.sugar {
    background: #fff3e0;
    color: #ff9800;
}

.nutrient-badge.fat {
    background: #ffebee;
    color: #f44336;
}

.nutrient-details {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 5px;
}

@media (max-width: 600px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row-three {
        grid-template-columns: 1fr;
    }
}
