* {
    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: 1400px;
    margin: 0 auto;
}

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

header h1 {
    font-size: 2.5em;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    flex-wrap: wrap;
    gap: 15px;
    cursor: pointer;
}

.section-header h2 {
    font-size: 1.8em;
    color: #667eea;
    font-weight: 600;
    flex: 1;
}

.collapse-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    flex-shrink: 0;
}

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

.section-content {
    margin-top: 20px;
    transition: max-height 0.4s ease-out, opacity 0.3s ease-out, margin 0.3s ease-out;
    max-height: 5000px;
    opacity: 1;
    overflow: hidden;
}

.section-content.collapsed {
    max-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}


/* Meal Planning Section */
.meal-planning {
    background: white;
}

.week-navigation {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
    padding: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.week-display-container {
    width: 100%;
    text-align: center;
}

.week-display {
    font-weight: 600;
    color: #555;
    text-align: center;
    font-size: 1.1em;
    white-space: nowrap;
    display: inline-block;
}

.week-nav-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.nav-btn {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-btn-icon {
    padding: 8px 12px;
    font-size: 18px;
    font-weight: bold;
    min-width: 40px;
}

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

.lunch-input-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.lunch-input-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 0.95em;
}

.lunch-input-section input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 10px;
}

.lunch-input-section .save-indicator {
    margin-top: 8px;
}

.meal-calendar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.meal-day {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: #f9f9f9;
    transition: border-color 0.3s;
}

.meal-day:hover {
    border-color: #667eea;
}

.day-header {
    margin-bottom: 12px;
}

.day-name {
    font-size: 1.2em;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 5px;
}

.day-date {
    font-size: 0.9em;
    color: #777;
}

.meal-input-group {
    margin-bottom: 12px;
}

.meal-input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
    font-size: 0.9em;
}

.meal-input-group input,
.meal-input-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.meal-input-group textarea {
    resize: vertical;
    min-height: 60px;
}

.save-indicator {
    font-size: 0.75em;
    color: #28a745;
    margin-top: 8px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.save-indicator.show {
    opacity: 1;
}

.recipe-links {
    margin-top: 8px;
    font-size: 0.85em;
}

.recipe-links a {
    display: block;
    color: #667eea;
    text-decoration: none;
    margin-top: 4px;
    word-break: break-all;
}

.recipe-links a:hover {
    text-decoration: underline;
}

/* Shopping Lists */
.checklist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.checklist-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
    transition: background 0.2s;
}

.checklist-item:hover {
    background: #f0f0f0;
}

.checklist-item input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checklist-item label {
    flex: 1;
    cursor: pointer;
    font-size: 0.95em;
    user-select: none;
}

.checklist-item.checked label {
    text-decoration: line-through;
    color: #999;
}

.delete-item-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 8px;
    transition: background 0.2s;
    opacity: 0.8;
}

.delete-item-btn:hover {
    background: #c82333;
    opacity: 1;
}

/* Buttons */
.btn-primary {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}

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

.btn-secondary {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}

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

/* Add Item Controls */
.add-item-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.item-input {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.item-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .section-header {
        flex-direction: row;
        align-items: center;
    }

    .meal-calendar {
        grid-template-columns: 1fr;
    }

    .checklist {
        grid-template-columns: 1fr;
    }

    .week-navigation {
        width: 100%;
        gap: 10px;
        padding: 15px 12px;
    }

    .week-display {
        font-size: 0.95em;
    }

    .week-nav-buttons {
        gap: 8px;
    }

    .nav-btn {
        flex: 1;
        min-width: 0;
        padding: 8px 12px;
        font-size: 13px;
    }

    .nav-btn-icon {
        padding: 8px 10px;
        font-size: 16px;
        min-width: 36px;
        flex: 0 0 auto;
    }

    .add-item-controls {
        width: 100%;
        flex-direction: column;
    }

    .add-item-controls button {
        width: 100%;
    }

    .item-input {
        width: 100%;
    }
}
