.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ============================================
   MOBILE-FIRST FORM STYLES
   ============================================ */

/* Base - Prevent horizontal overflow */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
}

/* Ensure app container fits screen */
.app-container {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Page Layout */
.home-page {
    padding: 1rem;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    overflow-x: hidden;
}

/* Preferences Form */
.preferences-form h2 {
    font-size: 1.75rem;
    margin: 0 0 0.5rem 0;
    text-align: center;
}

/* Language row at top - subtle */
.language-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.language-row .language-selector {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.language-row .language-selector select {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    min-width: 100px;
}

.form-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 1.5rem;
}

.form-section {
    margin-bottom: 1.5rem;
}

.form-hint {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Multi-Select Checkbox Group */
.multi-select-group {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    margin: 0;
}

.multi-select-group legend {
    font-weight: 600;
    padding: 0 0.5rem;
    font-size: 0.9rem;
}

.multi-select-hint {
    font-size: 0.8rem;
    color: #666;
    margin: 0 0 0.5rem 0;
}

.selected-items-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.selected-tag {
    background-color: var(--primary-color, #e74c3c);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
}

.checkbox-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
}

.checkbox-item:hover {
    background-color: #f5f5f5;
}

.checkbox-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox-item.disabled:hover {
    background-color: transparent;
}

.checkbox-item input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.checkbox-item.disabled input[type="checkbox"] {
    cursor: not-allowed;
}

.checkbox-item.random-option {
    background-color: #fff3cd;
    border: 1px dashed #ffc107;
    margin-bottom: 0.5rem;
}

.checkbox-item.random-option:hover:not(.disabled) {
    background-color: #ffe69c;
}

/* Enum Select */
.enum-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.enum-selector label {
    font-weight: 600;
    font-size: 0.9rem;
}

.enum-selector select {
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: white;
    cursor: pointer;
}

/* Range Slider */
.range-slider {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.range-slider label {
    font-weight: 600;
    font-size: 0.9rem;
}

.range-slider input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    cursor: pointer;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #666;
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

.toggle-label input[type="checkbox"] {
    width: 3rem;
    height: 1.5rem;
    cursor: pointer;
}

/* Number Input */
.number-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.number-input label {
    font-weight: 600;
    font-size: 0.9rem;
}

.number-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.number-controls input[type="number"] {
    width: 4rem;
    padding: 0.5rem;
    text-align: center;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.number-controls button {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
}

.number-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.people-inputs {
    display: flex;
    gap: 2rem;
}

/* Tag Input */
.tag-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tag-input > label {
    font-weight: 600;
    font-size: 0.9rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background-color: #e0e0e0;
    border-radius: 16px;
    font-size: 0.875rem;
}

.tag button {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.tag-input-row {
    display: flex;
    gap: 0.5rem;
}

.tag-input-row input {
    flex: 1;
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.tag-input-row button {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
}

.tag-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.suggestions-label {
    font-size: 0.75rem;
    color: #666;
}

.suggestion-chip {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border: 1px dashed #ccc;
    border-radius: 16px;
    background: white;
    cursor: pointer;
}

.suggestion-chip:hover {
    background-color: #f5f5f5;
}

/* Language Selector */
.language-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.language-selector label {
    font-weight: 600;
    font-size: 0.9rem;
}

.language-selector select {
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: white;
    cursor: pointer;
}

/* Form Actions */
.form-actions {
    margin-top: 2rem;
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background-color: #2563eb;
    color: white;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-primary:disabled {
    background-color: #93c5fd;
    cursor: not-allowed;
}

/* Error Message */
.error-message {
    padding: 1rem;
    margin-top: 1rem;
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #dc2626;
}

/* ============================================
   DINNER SELECTION FLOW STYLES
   ============================================ */

/* Selection Flow Container */
.dinner-selection-flow {
    padding-bottom: 2rem;
}

.selection-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.selection-header h2 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
}

.selection-subtitle {
    color: #666;
    margin-bottom: 1rem;
}

/* Progress Bar */
.selection-progress {
    margin: 1rem 0;
}

.progress-bar {
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #22c55e;
    transition: width 0.3s ease;
}

.progress-text {
    display: block;
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Day Selection Panel */
.day-selection {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.day-selection:last-child {
    border-bottom: none;
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.day-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.day-header h3 {
    font-size: 1.125rem;
    margin: 0;
}

.btn-surprise {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #6366f1;
    background-color: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-surprise:hover:not(:disabled) {
    background-color: #e0e7ff;
    border-color: #a5b4fc;
}

.btn-surprise:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-surprise .refresh-icon {
    font-size: 1rem;
    font-weight: bold;
}

.btn-surprise .refresh-icon.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Loading state for suggestions */
.suggestions-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    border: 2px dashed #f59e0b;
}

.suggestions-loading .loading-animation {
    font-size: 3rem;
    animation: cooking 1s ease-in-out infinite;
}

.suggestions-loading .loading-text {
    margin-top: 1rem;
    font-size: 1rem;
    color: #92400e;
    font-weight: 500;
}

@keyframes cooking {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-8px) rotate(5deg); }
}

.selection-status {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
}

.selection-status.pending {
    background-color: #fef3c7;
    color: #92400e;
}

.selection-status.complete {
    background-color: #d1fae5;
    color: #065f46;
}

/* Suggestions Grid */
.suggestions-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Dinner Card */
.dinner-card {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dinner-card:hover {
    border-color: #93c5fd;
    background-color: #f8fafc;
}

.dinner-card.selected {
    border-color: #2563eb;
    background-color: #eff6ff;
}

.dinner-card-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.dinner-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dinner-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.placeholder-icon {
    font-size: 2rem;
}

.dinner-card-content {
    flex: 1;
    min-width: 0;
}

.dinner-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dinner-card-description {
    font-size: 0.875rem;
    color: #666;
    margin: 0 0 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dinner-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.meta-tag {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    background-color: #f3f4f6;
    color: #374151;
}

.meta-tag.cuisine {
    background-color: #e0e7ff;
    color: #3730a3;
}

.meta-tag.time {
    background-color: #fef3c7;
    color: #92400e;
}

.dinner-card-selection {
    display: flex;
    align-items: center;
    padding-left: 0.5rem;
}

.selection-indicator {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1rem;
    border: 2px solid #d1d5db;
    color: #d1d5db;
}

.selection-indicator.selected {
    border-color: #2563eb;
    background-color: #2563eb;
    color: white;
}

/* Selection Footer */
.selection-footer {
    position: sticky;
    bottom: 0;
    background-color: white;
    padding: 1rem 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 1rem;
}

.validation-warning {
    padding: 0.75rem;
    margin-bottom: 1rem;
    background-color: #fef3c7;
    border-radius: 8px;
    text-align: center;
    font-size: 0.875rem;
    color: #92400e;
}

.selection-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-secondary {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background-color: white;
    color: #374151;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

/* Results Placeholder */
.results-placeholder {
    text-align: center;
    padding: 3rem 1rem;
}

.results-placeholder h2 {
    margin-bottom: 1rem;
}

.results-placeholder p {
    color: #666;
    margin-bottom: 2rem;
}

/* Error dismiss button */
.btn-dismiss {
    margin-top: 0.5rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #fca5a5;
    border-radius: 4px;
    background-color: white;
    color: #dc2626;
    cursor: pointer;
}

/* ============================================
   SHOPPING LIST STYLES
   ============================================ */

/* Shopping List Panel */
.shopping-list-panel {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.shopping-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f9fafb;
    cursor: pointer;
    user-select: none;
}

.shopping-list-header:hover {
    background-color: #f3f4f6;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-left h3 {
    margin: 0;
    font-size: 1.125rem;
}

.header-icon {
    font-size: 1.5rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.item-count {
    font-size: 0.875rem;
    color: #666;
    background-color: #e5e7eb;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
}

.expand-toggle {
    color: #666;
    font-size: 0.75rem;
}

.shopping-list-content {
    padding: 1rem;
}

.shopping-list-meta {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.shopping-list-actions {
    margin-bottom: 1rem;
}

.btn-text {
    background: none;
    border: none;
    color: #2563eb;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.25rem 0;
}

.btn-text:hover {
    text-decoration: underline;
}

/* Category Section */
.shopping-list-category {
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: #f9fafb;
    cursor: pointer;
    user-select: none;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.category-header:hover {
    background-color: #f3f4f6;
}

.category-icon {
    font-size: 1.25rem;
}

.category-name {
    flex: 1;
}

.category-count {
    font-size: 0.75rem;
    font-weight: 400;
    color: #666;
}

.category-toggle {
    font-size: 0.75rem;
    color: #666;
}

.category-items {
    padding: 0.5rem;
}

/* Shopping List Item */
.shopping-list-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.shopping-list-item:hover {
    background-color: #f9fafb;
}

.shopping-list-item.checked {
    opacity: 0.6;
}

.shopping-list-item.checked .item-name {
    text-decoration: line-through;
    color: #9ca3af;
}

/* Custom Checkbox */
.item-checkbox {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
    margin-top: 2px;
}

.item-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.item-checkbox .checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.item-checkbox input:checked + .checkmark {
    background-color: #22c55e;
    border-color: #22c55e;
}

.item-checkbox input:checked + .checkmark::after {
    content: "✓";
    color: white;
    font-size: 0.875rem;
    font-weight: bold;
}

/* Item Content Container */
.item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.item-name {
    display: block;
    font-weight: 500;
    line-height: 1.3;
}

.item-quantity {
    display: block;
    font-size: 0.875rem;
    color: #666;
}

.item-used-in {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.used-in-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    background-color: #e0e7ff;
    color: #4338ca;
    border-radius: 12px;
    border: 1px solid #c7d2fe;
    white-space: nowrap;
    line-height: 1;
}

/* Shopping Complete Message */
.shopping-complete {
    padding: 1rem;
    background-color: #d1fae5;
    border-radius: 8px;
    text-align: center;
    color: #065f46;
    font-weight: 500;
    margin-top: 1rem;
}

/* Results View */
.results-view {
    padding-bottom: 2rem;
}

.results-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.results-header h2 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
}

.results-header p {
    color: #666;
    margin: 0;
}

/* Servings Editor */
.servings-editor {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.servings-label {
    font-weight: 600;
    color: #374151;
}

.servings-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-servings {
    width: 36px;
    height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: white;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-servings:hover:not(:disabled) {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.btn-servings:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.servings-value {
    min-width: 40px;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.btn-update-servings {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color, #e74c3c);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
}

.btn-update-servings:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-update-servings:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.results-actions {
    margin-top: 1.5rem;
}

/* ============================================
   RECIPE DISPLAY STYLES
   ============================================ */

/* Recipes Panel */
.recipes-panel {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.recipes-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f9fafb;
    cursor: pointer;
    user-select: none;
}

.recipes-panel-header:hover {
    background-color: #f3f4f6;
}

.recipes-panel-header .header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.recipes-panel-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.recipe-count {
    font-size: 0.875rem;
    color: #666;
}

.recipes-panel-content {
    padding: 1rem;
}

.no-recipes {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* Recipe Card */
.recipe-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.recipe-card:last-child {
    margin-bottom: 0;
}

.recipe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f9fafb;
    cursor: pointer;
    user-select: none;
}

.recipe-header:hover {
    background-color: #f3f4f6;
}

.recipe-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.day-badge {
    flex-shrink: 0;
    padding: 0.25rem 0.5rem;
    background-color: #2563eb;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
}

.recipe-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recipe-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Favorite Button */
.btn-favorite {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.btn-favorite:hover {
    transform: scale(1.2);
}

.btn-favorite.active {
    animation: heartPulse 0.3s ease;
}

@keyframes heartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Recipe Content */
.recipe-content {
    padding: 1rem;
}

.recipe-description {
    color: #666;
    margin: 0 0 1rem 0;
    font-style: italic;
}

.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background-color: #f9fafb;
    border-radius: 8px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.meta-icon {
    font-size: 1rem;
}

/* Recipe Sections */
.recipe-section {
    margin-bottom: 1.5rem;
}

.recipe-section:last-child {
    margin-bottom: 0;
}

.recipe-section h5 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

/* Ingredients List */
.ingredients-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ingredients-list li {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.ingredients-list li:last-child {
    border-bottom: none;
}

.ingredient-quantity {
    flex-shrink: 0;
    min-width: 80px;
    font-weight: 500;
    color: #2563eb;
}

.ingredient-name {
    color: #374151;
}

/* Steps List */
.steps-list {
    padding-left: 1.5rem;
    margin: 0;
}

.steps-list li {
    padding: 0.5rem 0;
    padding-left: 0.5rem;
    line-height: 1.6;
}

.steps-list li::marker {
    color: #2563eb;
    font-weight: 600;
}

/* Mobile responsiveness for recipe meta */
@media (max-width: 480px) {
    .recipe-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .recipe-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .recipe-title {
        white-space: normal;
    }
}

/* ============================================
   APP MENU & NAVIGATION STYLES
   ============================================ */

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Bottom Navigation Menu */
.app-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    background-color: white;
    border-top: 1px solid #e5e7eb;
    padding: 0.5rem 0;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    z-index: 100;
}

.menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    color: #666;
    transition: color 0.2s ease;
}

.menu-btn:hover {
    color: #2563eb;
}

.menu-btn.active {
    color: #2563eb;
}

.menu-icon {
    font-size: 1.5rem;
}

.menu-label {
    font-size: 0.75rem;
    font-weight: 500;
}

.menu-badge {
    position: absolute;
    top: 0.25rem;
    right: 0.5rem;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.625rem;
    font-weight: 600;
    background-color: #ef4444;
    color: white;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Language Selector in Menu */
.menu-language {
    position: relative;
}

.language-btn {
    padding: 0.5rem 0.75rem;
}

.flag-icon {
    font-size: 1.25rem;
}

.language-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 0.5rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    min-width: 140px;
    z-index: 200;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: left;
    transition: background-color 0.2s ease;
}

.language-option:hover {
    background-color: #f3f4f6;
}

.language-option.active {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 500;
}

.language-dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99;
}

/* Adjust main content for bottom nav */
.home-page {
    padding-bottom: 5rem; /* Space for bottom nav */
}

/* ============================================
   HISTORY & FAVORITES VIEW STYLES
   ============================================ */

.view-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.view-header h2 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
}

.view-header p {
    color: #666;
    margin: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

.empty-state p {
    color: #666;
    margin: 0.5rem 0;
}

.empty-hint {
    font-size: 0.875rem;
    color: #9ca3af;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

/* History View */
.history-view {
    padding-bottom: 1rem;
}

.history-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.btn-danger {
    color: #dc2626;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-entry {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.history-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
}

.history-entry-header:hover {
    background-color: #f1f5f9;
}

.history-entry-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.history-entry-title h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.history-date {
    font-size: 0.8rem;
    color: #666;
}

.history-entry-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-recipes {
    display: flex;
    flex-direction: column;
}

.history-recipes .favorite-card {
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #e5e7eb;
}

.history-recipes .favorite-card:last-child {
    border-bottom: none;
}

.history-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-card:hover {
    border-color: #93c5fd;
    background-color: #f8fafc;
}

.history-card-content {
    flex: 1;
    min-width: 0;
}

.history-card-content h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #666;
}

.history-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.btn-icon:hover {
    background-color: #f3f4f6;
}

.card-arrow {
    color: #9ca3af;
    font-size: 1.25rem;
}

/* Favorites View */
.favorites-view {
    padding-bottom: 1rem;
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.favorite-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.favorite-card:hover {
    border-color: #fca5a5;
    background-color: #fef2f2;
}

.favorite-card-content {
    flex: 1;
    min-width: 0;
}

.favorite-card-content h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
}

.favorite-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.cuisine-tag {
    background-color: #e0e7ff;
    color: #3730a3;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.favorite-date {
    font-size: 0.75rem;
    color: #9ca3af;
}

.favorite-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-unfavorite {
    transition: transform 0.2s ease;
}

.btn-unfavorite:hover {
    transform: scale(1.2);
}

/* ============================================
   MOBILE RESPONSIVE BREAKPOINTS
   ============================================ */

/* Small screens (phones) */
@media screen and (max-width: 480px) {
    .home-page {
        padding: 0.75rem;
    }

    .preferences-form h2 {
        font-size: 1.5rem;
    }

    /* Single column checkboxes on small screens */
    .checkbox-list {
        grid-template-columns: 1fr;
    }

    /* Dinner cards */
    .dinner-card {
        padding: 0.75rem;
    }

    .dinner-title {
        font-size: 1rem;
    }

    /* Recipe display */
    .recipe-card {
        padding: 0.75rem;
    }

    /* Shopping list */
    .shopping-category h4 {
        font-size: 0.9rem;
    }

    /* Buttons */
    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 0.875rem;
    }

    .results-actions {
        flex-direction: column;
    }

    /* People inputs side by side on mobile */
    .people-inputs {
        flex-direction: row;
        gap: 0.5rem;
    }

    .people-inputs > * {
        flex: 1;
    }
}

/* Ensure images and media don't overflow */
img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

/* Ensure tables don't overflow */
table {
    width: 100%;
    overflow-x: auto;
    display: block;
}

/* Prevent text from causing overflow */
.dinner-title,
.recipe-title,
.shopping-item-name {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Fix any potential pre/code overflow */
pre, code {
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
}
