/* Meal Planning Dashboard Styles */

.meal-plan-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.meal-plan-grid {
    display: grid;
    grid-template-columns: 120px repeat(5, 1fr);
    gap: 0;
    min-height: 500px;
}

.meal-plan-header {
    display: contents;
}

.meal-plan-row {
    display: contents;
}

.meal-plan-cell {
    padding: 16px 12px;
    border-right: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    min-height: 80px;
}

.meal-plan-cell:last-child {
    border-right: none;
}

.meal-plan-header-cell {
    background: linear-gradient(135deg, #4A7048 0%, #A9CBA4 100%);
    font-weight: 600;
    color: #ffffff;
    border-bottom: 2px solid #D2691E;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.meal-plan-day-cell {
    background: linear-gradient(135deg, #4A7048 0%, #A9CBA4 100%);
    font-weight: 600;
    color: #ffffff;
    border-right: 2px solid #D2691E;
    justify-content: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.meal-plan-meal-cell {
    background: rgba(255, 255, 255, 0.9);
    transition: background-color 0.2s ease;
}

.meal-plan-meal-cell:hover {
    background: rgba(169, 203, 164, 0.2);
}

.meal-slot {
    width: 100%;
    height: 100%;
    position: relative;
}

.meal-image {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.meal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.meal-slot-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    height: 100%;
    justify-content: center;
}

.meal-slot-recipe {
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    word-break: break-word;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.edit-meal-btn {
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 4px 8px;
    font-size: 0.8rem;
}

.meal-slot:hover .edit-meal-btn {
    opacity: 1;
}

.lockout-timer {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.3);
}

.lockout-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lockout-countdown {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 1.1em;
}

.empty-state {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 60px 40px;
    margin: 40px 0;
}

.empty-state-content {
    max-width: 400px;
    margin: 0 auto;
}

.empty-state i {
    color: #6c757d;
}

.recipe-preview {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recipe-preview-content h6 {
    color: #495057;
    margin-bottom: 8px;
}

.recipe-preview-content p {
    color: #6c757d;
    margin-bottom: 12px;
}

.recipe-meta .badge {
    font-size: 0.75rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .meal-plan-grid {
        grid-template-columns: 100px repeat(5, 1fr);
    }

    .meal-plan-cell {
        padding: 12px 8px;
        min-height: 70px;
    }

    .meal-slot-recipe {
        font-size: 0.8rem;
    }
}

@media (max-width: 992px) {
    .meal-plan-grid {
        grid-template-columns: 1fr;
        gap: 1px;
    }

    .meal-plan-header {
        display: none;
    }

    .meal-plan-row {
        display: block;
        margin-bottom: 20px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        overflow: hidden;
    }

    .meal-plan-cell {
        border: none;
        border-bottom: 1px solid #e9ecef;
        padding: 16px;
        min-height: auto;
    }

    .meal-plan-cell:last-child {
        border-bottom: none;
    }

    .meal-plan-day-cell {
        background: #007bff;
        color: white;
        font-size: 1.1rem;
        border-bottom: none;
    }

    .meal-plan-meal-cell {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 12px;
    }

    .meal-slot-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .meal-slot-recipe {
        font-size: 1rem;
        max-height: none;
        -webkit-line-clamp: unset;
        text-align: left;
    }

    .edit-meal-btn {
        opacity: 1;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding: 0 10px;
    }

    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 20px;
        align-items: stretch !important;
    }

    .lockout-timer {
        text-align: center;
        margin: 10px 0;
    }

    .btn-lg {
        width: 100%;
    }

    .empty-state {
        padding: 40px 20px;
    }

    .meal-plan-cell {
        padding: 12px;
    }
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Button States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
}

/* Alert Animations */
.alert {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Customizations */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 12px 12px 0 0;
}

.modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 12px 12px;
}

/* Recipe Selector */
#recipe-selector {
    border-radius: 8px;
    border: 1px solid #ced4da;
}

#recipe-selector:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Enhanced Recipe Selection Styles */
.recipe-search-container {
    position: relative;
}

.recipe-search-container .input-group-text {
    background: #f8f9fa;
    border-color: #ced4da;
}

#recipe-search-input {
    border-radius: 0;
    border-left: none;
    border-right: none;
}

#recipe-search-input:focus {
    border-color: #4A7048;
    box-shadow: 0 0 0 0.2rem rgba(74, 112, 72, 0.25);
}

#clear-search-btn {
    border-radius: 0 8px 8px 0;
    border-left: none;
}

.search-results-count {
    font-size: 0.85rem;
}

.recipe-selection-container {
    min-height: 400px;
}

.recipe-options-container {
    height: 400px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
}

.recipe-options-list {
    padding: 10px;
}

.recipe-option {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.recipe-option:hover {
    border-color: #4A7048;
    box-shadow: 0 2px 8px rgba(74, 112, 72, 0.15);
    transform: translateY(-1px);
}

.recipe-option.selected {
    border-color: #4A7048;
    background: linear-gradient(135deg, #f8fff8 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(74, 112, 72, 0.2);
}

.recipe-option.special-option {
    border-color: #6c757d;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.recipe-option.special-option:hover {
    border-color: #495057;
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
}

.recipe-option-image {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.recipe-option-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-option-image .no-image {
    color: #6c757d;
    font-size: 1.5rem;
}

.recipe-option.special-option .recipe-option-image {
    background: #e9ecef;
    border-color: #adb5bd;
}

.recipe-option.special-option .recipe-option-image .no-image {
    color: #495057;
}

.recipe-option-details {
    flex: 1;
    min-width: 0;
}

.recipe-option-details h6 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    word-break: break-word;
}

.recipe-option.special-option .recipe-option-details h6 {
    color: #6c757d;
}

.recipe-option-details p {
    margin: 0;
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.3;
}

.recipe-option.special-option .recipe-option-details p {
    color: #868e96;
}

.recipe-option-meta {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.recipe-option-meta .badge {
    font-size: 0.7rem;
    padding: 2px 6px;
}

/* Recipe Preview Panel */
.recipe-preview-panel {
    height: 400px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: white;
    display: flex;
    flex-direction: column;
}

.preview-header {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.preview-title {
    margin: 0;
    color: #495057;
    font-weight: 600;
}

.recipe-quick-preview-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.recipe-preview-item {
    display: none;
}

.recipe-preview-item.active {
    display: block;
}

.recipe-preview-image {
    width: 100%;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recipe-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-preview-image .no-image {
    color: #6c757d;
    font-size: 3rem;
}

.recipe-preview-details h5 {
    color: #495057;
    margin-bottom: 10px;
    font-weight: 600;
}

.recipe-preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.recipe-preview-meta .badge {
    font-size: 0.75rem;
    padding: 4px 8px;
}

.recipe-preview-ingredients {
    margin-bottom: 15px;
}

.recipe-preview-ingredients h6 {
    color: #495057;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.recipe-preview-ingredients ul {
    margin: 0;
    padding-left: 20px;
    color: #6c757d;
    font-size: 0.85rem;
}

.recipe-preview-ingredients li {
    margin-bottom: 2px;
}

/* Loading and Error States */
.recipe-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
}

.recipe-error {
    padding: 20px;
}

/* Keyboard Navigation */
.recipe-option.keyboard-focused {
    outline: 2px solid #4A7048;
    outline-offset: 2px;
}

/* Responsive Design for Recipe Selection */
@media (max-width: 768px) {
    .recipe-selection-container .row {
        flex-direction: column;
    }

    .recipe-selection-container .col-md-7,
    .recipe-selection-container .col-md-5 {
        max-width: 100%;
        flex: 0 0 100%;
    }

    .recipe-preview-panel {
        height: 300px;
        margin-top: 20px;
    }

    .recipe-options-container {
        height: 300px;
    }

    .recipe-option {
        padding: 10px;
    }

    .recipe-option-image {
        width: 50px;
        height: 50px;
        margin-right: 12px;
    }

    .recipe-option-details h6 {
        font-size: 0.9rem;
    }

    .recipe-option-details p {
        font-size: 0.8rem;
    }
}

/* Meal Card and Image Styling */
.meal-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s ease;
}

.meal-card:hover {
    background: #e9ecef;
    border-color: #4A7048;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.meal-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #4A7048;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.meal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.no-image {
    width: 50px;
    height: 50px;
    background: #e9ecef;
    border-radius: 8px;
    border: 2px solid #4A7048;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.meal-details {
    flex: 1;
    min-width: 0;
}

.meal-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.meal-meta {
    font-size: 0.75rem;
    color: #6c757d;
    margin: 0 0 4px 0;
}

.meal-ingredients {
    font-size: 0.75rem;
    color: #6c757d;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Utility Classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.rounded-lg {
    border-radius: 0.5rem !important;
}

/* Highlighted Meal Styles */
.meal-section.highlighted-meal {
    background: linear-gradient(135deg, #FFE4B5 0%, #FFA07A 100%) !important;
    border: 3px solid #D2691E !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 25px rgba(210, 105, 30, 0.4) !important;
    transform: scale(1.02) !important;
    transition: all 0.5s ease !important;
    animation: highlightPulse 2s ease-in-out infinite !important;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 8px 25px rgba(210, 105, 30, 0.4);
    }
    50% {
        box-shadow: 0 12px 35px rgba(210, 105, 30, 0.6);
    }
    100% {
        box-shadow: 0 8px 25px rgba(210, 105, 30, 0.4);
    }
}

.meal-section.highlighted-meal .meal-type-label {
    color: #8B4513 !important;
    font-weight: 700 !important;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5) !important;
}

.meal-section.highlighted-meal .meal-name {
    color: #8B4513 !important;
    font-weight: 700 !important;
}

.meal-section.highlighted-meal .change-meal-btn {
    background: #D2691E !important;
    border-color: #B8860B !important;
    color: white !important;
    font-weight: 600 !important;
}

/* Generation History Styles */
.generation-history-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.generation-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.generation-history-header h3 {
    color: #4A7048;
    margin: 0;
    font-weight: 600;
}

.generation-frequency-info {
    text-align: right;
}

.generation-history-list {
    max-height: 300px;
    overflow-y: auto;
}

.generation-history-item {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.generation-history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-color: #4A7048;
}

.generation-history-info {
    flex: 1;
}

.generation-history-timestamp {
    font-weight: 600;
    color: #4A7048;
    margin-bottom: 5px;
}

.generation-history-details {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0;
}

.generation-history-actions {
    display: flex;
    gap: 8px;
}

.generation-history-actions .btn {
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.generation-history-actions .btn-view {
    background: linear-gradient(135deg, #4A7048 0%, #6B8E6B 100%);
    border: none;
    color: white;
}

.generation-history-actions .btn-view:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 112, 72, 0.3);
}

.generation-history-actions .btn-restore {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    color: white;
}

.generation-history-actions .btn-restore:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.generation-history-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.generation-history-empty i {
    opacity: 0.5;
}

/* Historical Plan Modal Styles */
.historical-week-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.historical-day-card {
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.historical-day-header {
    background: linear-gradient(135deg, #4A7048 0%, #6B8E6B 100%);
    color: white;
    padding: 10px 15px;
    font-weight: 600;
}

.historical-day-content {
    padding: 15px;
}

.historical-meal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.historical-meal:last-child {
    border-bottom: none;
}

.historical-meal-type {
    font-weight: 600;
    color: #4A7048;
    min-width: 80px;
}

.historical-meal-recipe {
    color: #495057;
    flex: 1;
    margin-left: 15px;
}

/* Responsive Design for Generation History */
@media (max-width: 768px) {
    .generation-history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .generation-frequency-info {
        text-align: left;
    }

    .generation-history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .generation-history-actions {
        width: 100%;
        justify-content: space-between;
    }

    .historical-meal {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .historical-meal-recipe {
        margin-left: 0;
    }
}

/* ============================================================================
   CACHE-RELATED UI COMPONENTS (Work Order #18)
   ============================================================================ */

/* Conflict Resolution Modal Styles */
#conflictResolutionModal .modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

#conflictResolutionModal .modal-header {
    background: linear-gradient(135deg, #ffc107 0%, #ff8c00 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    border-bottom: none;
    padding: 20px 25px;
}

#conflictResolutionModal .modal-title {
    font-weight: 600;
    font-size: 1.25rem;
}

#conflictResolutionModal .modal-body {
    padding: 25px;
}

#conflictResolutionModal .alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    border-radius: 10px;
    color: #856404;
    font-weight: 500;
}

#conflictResolutionModal .card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
}

#conflictResolutionModal .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

#conflictResolutionModal .card-header {
    border-radius: 12px 12px 0 0;
    border-bottom: none;
    padding: 15px 20px;
    font-weight: 600;
}

#conflictResolutionModal .card-header.bg-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
}

#conflictResolutionModal .card-header.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%) !important;
}

#conflictResolutionModal .card-body {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

#conflictResolutionModal .modal-footer {
    border-top: none;
    padding: 20px 25px;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
}

#conflictResolutionModal .btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

#conflictResolutionModal .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#conflictResolutionModal .btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
}

#conflictResolutionModal .btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    border: none;
}

#conflictResolutionModal .btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border: none;
}

/* Data Preview Styles */
#localDataPreview,
#serverDataPreview {
    font-size: 0.95rem;
    line-height: 1.6;
}

#localDataPreview p,
#serverDataPreview p {
    margin-bottom: 8px;
}

#localDataPreview strong,
#serverDataPreview strong {
    color: #495057;
    font-weight: 600;
}

#localDataPreview ul,
#serverDataPreview ul {
    margin: 10px 0;
    padding-left: 20px;
}

#localDataPreview li,
#serverDataPreview li {
    margin-bottom: 5px;
    color: #6c757d;
}

/* Cache Status Indicators */
.cache-status-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 10px 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-size: 0.85rem;
    z-index: 1000;
    transition: all 0.3s ease;
}

.cache-status-indicator.cache-hit {
    border-left: 4px solid #28a745;
    color: #155724;
}

.cache-status-indicator.cache-miss {
    border-left: 4px solid #ffc107;
    color: #856404;
}

.cache-status-indicator.cache-conflict {
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.cache-status-indicator i {
    margin-right: 8px;
}

/* Offline Mode Indicator */
.offline-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-radius: 25px;
    padding: 10px 20px;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1000;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
    100% { transform: translateX(-50%) scale(1); }
}

/* Cache Loading States */
.cache-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.cache-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4A7048;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Design for Cache Components */
@media (max-width: 768px) {
    #conflictResolutionModal .modal-dialog {
        margin: 10px;
    }

    #conflictResolutionModal .modal-body {
        padding: 20px 15px;
    }

    #conflictResolutionModal .row {
        flex-direction: column;
    }

    #conflictResolutionModal .col-md-6 {
        margin-bottom: 15px;
    }

    .cache-status-indicator {
        top: 10px;
        right: 10px;
        font-size: 0.8rem;
        padding: 8px 12px;
    }

    .offline-indicator {
        top: 10px;
        font-size: 0.85rem;
        padding: 8px 16px;
    }
}

/* ============================================================================
   ACCESSIBILITY FEATURES (Work Order #24)
   ============================================================================ */

/* High Contrast Mode Support */
.high-contrast {
    /* Ensure minimum 4.5:1 contrast ratio for all text elements */
    --primary-color: #000000;
    --secondary-color: #ffffff;
    --accent-color: #0000ff;
    --text-color: #000000;
    --background-color: #ffffff;
    --border-color: #000000;
    --success-color: #008000;
    --warning-color: #ff8c00;
    --error-color: #ff0000;
    --info-color: #0000ff;
}

.high-contrast * {
    color: var(--text-color) !important;
    background-color: var(--background-color) !important;
    border-color: var(--border-color) !important;
}

.high-contrast .btn-primary,
.high-contrast .btn-generate {
    background-color: var(--primary-color) !important;
    color: var(--secondary-color) !important;
    border: 2px solid var(--border-color) !important;
}

.high-contrast .btn-primary:hover,
.high-contrast .btn-generate:hover {
    background-color: var(--secondary-color) !important;
    color: var(--primary-color) !important;
    border: 2px solid var(--primary-color) !important;
}

.high-contrast .btn-secondary {
    background-color: var(--secondary-color) !important;
    color: var(--primary-color) !important;
    border: 2px solid var(--border-color) !important;
}

.high-contrast .btn-secondary:hover {
    background-color: var(--primary-color) !important;
    color: var(--secondary-color) !important;
}

.high-contrast .alert-success {
    background-color: var(--success-color) !important;
    color: var(--secondary-color) !important;
    border: 2px solid var(--border-color) !important;
}

.high-contrast .alert-warning {
    background-color: var(--warning-color) !important;
    color: var(--primary-color) !important;
    border: 2px solid var(--border-color) !important;
}

.high-contrast .alert-danger {
    background-color: var(--error-color) !important;
    color: var(--secondary-color) !important;
    border: 2px solid var(--border-color) !important;
}

.high-contrast .alert-info {
    background-color: var(--info-color) !important;
    color: var(--secondary-color) !important;
    border: 2px solid var(--border-color) !important;
}

.high-contrast .day-header {
    background-color: var(--primary-color) !important;
    color: var(--secondary-color) !important;
    border: 2px solid var(--border-color) !important;
}

.high-contrast .meal-section {
    background-color: var(--background-color) !important;
    border: 2px solid var(--border-color) !important;
    color: var(--text-color) !important;
}

.high-contrast .meal-section:hover {
    background-color: var(--accent-color) !important;
    color: var(--secondary-color) !important;
}

.high-contrast .recipe-name {
    color: var(--text-color) !important;
    background-color: var(--background-color) !important;
    border: 1px solid var(--border-color) !important;
}

.high-contrast .recipe-category {
    background-color: var(--accent-color) !important;
    color: var(--secondary-color) !important;
    border: 1px solid var(--border-color) !important;
}

.high-contrast .modal-content {
    background-color: var(--background-color) !important;
    border: 3px solid var(--border-color) !important;
}

.high-contrast .modal-header {
    background-color: var(--primary-color) !important;
    color: var(--secondary-color) !important;
    border-bottom: 2px solid var(--border-color) !important;
}

.high-contrast .form-control {
    background-color: var(--background-color) !important;
    color: var(--text-color) !important;
    border: 2px solid var(--border-color) !important;
}

.high-contrast .form-control:focus {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 255, 0.5) !important;
}

/* Enhanced Focus Indicators */
.keyboard-navigation *:focus,
.keyboard-navigation *:focus-visible {
    outline: 3px solid var(--accent-color, #0000ff) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(0, 0, 255, 0.3) !important;
}

.high-contrast.keyboard-navigation *:focus,
.high-contrast.keyboard-navigation *:focus-visible {
    outline: 4px solid var(--accent-color) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 4px rgba(0, 0, 255, 0.5) !important;
}

/* Screen Reader Only Content */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Scalable Text Support - Ensure functionality at 200% zoom */
@media (min-resolution: 2dppx) {
    .meal-plan-container {
        font-size: 1.1em;
    }

    .day-name {
        font-size: 2rem;
    }

    .recipe-name {
        font-size: 1.3rem;
    }

    .btn-generate {
        font-size: 1.3rem;
        padding: 22px 48px;
    }
}

/* High DPI and Large Text Support */
@media (min-width: 1200px) {
    .meal-plan-container {
        max-width: 1000px;
    }

    .day-card {
        margin-bottom: 30px;
    }

    .meal-section {
        padding: 20px;
        margin-bottom: 20px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .day-card:hover {
        transform: none !important;
    }

    .btn-generate:hover {
        transform: none !important;
    }

    .meal-section:hover {
        transform: none !important;
    }
}

/* High Contrast Media Query Support */
@media (prefers-contrast: high) {
    .meal-plan-container {
        border: 2px solid #000000;
    }

    .day-card {
        border: 2px solid #000000;
    }

    .meal-section {
        border: 2px solid #000000;
    }

    .btn-generate {
        border: 2px solid #000000;
    }

    .modal-content {
        border: 3px solid #000000;
    }
}

/* Focus Management for Modals */
.modal.show {
    z-index: 1055;
}

.modal-backdrop {
    z-index: 1050;
}

/* Ensure proper focus order */
[tabindex="-1"]:focus {
    outline: none !important;
}

/* Recipe Option Cards Accessibility */
.recipe-option-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.recipe-option-card:hover {
    background-color: #f8f9fa;
    border-color: #4A7048;
}

.recipe-option-card[aria-selected="true"] {
    background-color: #e8f5e8;
    border: 2px solid #4A7048;
}

.recipe-option-card:focus {
    outline: 2px solid #4A7048;
    outline-offset: 2px;
}

.high-contrast .recipe-option-card[aria-selected="true"] {
    background-color: var(--accent-color) !important;
    color: var(--secondary-color) !important;
    border: 2px solid var(--border-color) !important;
}

.high-contrast .recipe-option-card:hover {
    background-color: var(--accent-color) !important;
    color: var(--secondary-color) !important;
}

/* Large Text Mode Support */
.large-text {
    font-size: 1.2em;
}

.large-text .day-name {
    font-size: 2.2rem;
}

.large-text .recipe-name {
    font-size: 1.4rem;
}

.large-text .btn-generate {
    font-size: 1.4rem;
    padding: 22px 48px;
}

.large-text .meal-type-label {
    font-size: 1.2rem;
}

.large-text .recipe-category {
    font-size: 1rem;
}

.large-text .modal-title {
    font-size: 1.6rem;
}

.large-text .form-control {
    font-size: 1.1rem;
    padding: 12px 16px;
}

/* Enhanced Focus Indicators */
.enhanced-focus *:focus,
.enhanced-focus *:focus-visible {
    outline: 4px solid #0000ff !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 4px rgba(0, 0, 255, 0.4) !important;
}

.enhanced-focus .btn:focus,
.enhanced-focus .btn:focus-visible {
    outline: 4px solid #0000ff !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 4px rgba(0, 0, 255, 0.4) !important;
}

.enhanced-focus .form-control:focus,
.enhanced-focus .form-control:focus-visible {
    outline: 4px solid #0000ff !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 4px rgba(0, 0, 255, 0.4) !important;
}

.enhanced-focus .recipe-option-card:focus,
.enhanced-focus .recipe-option-card:focus-visible {
    outline: 4px solid #0000ff !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 4px rgba(0, 0, 255, 0.4) !important;
}

/* Reduced Motion Support */
.reduced-motion *,
.reduced-motion *::before,
.reduced-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

.reduced-motion .day-card:hover {
    transform: none !important;
}

.reduced-motion .btn-generate:hover {
    transform: none !important;
}

.reduced-motion .meal-section:hover {
    transform: none !important;
}

.reduced-motion .recipe-option-card:hover {
    transform: none !important;
}

/* Combined Accessibility Classes */
.high-contrast.large-text {
    font-size: 1.3em;
}

.high-contrast.large-text .day-name {
    font-size: 2.4rem;
}

.high-contrast.large-text .recipe-name {
    font-size: 1.5rem;
}

/* ============================================================================
   ACCESSIBILITY CONTROLS
   ============================================================================ */

.accessibility-controls {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.accessibility-toggle-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.accessibility-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.accessibility-btn:hover {
    background: #e9ecef;
    border-color: #4A7048;
    color: #4A7048;
}

.accessibility-btn[aria-pressed="true"] {
    background: #4A7048;
    border-color: #4A7048;
    color: white;
}

.accessibility-btn:focus {
    outline: 2px solid #4A7048;
    outline-offset: 2px;
}

.text-scale-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.scale-label {
    font-weight: 600;
    color: #4A7048;
    margin: 0;
}

#text-scale-slider {
    flex: 1;
    max-width: 200px;
}

#text-scale-value {
    font-weight: 600;
    color: #4A7048;
    min-width: 50px;
    text-align: center;
}

/* High Contrast Mode Styles */
.high-contrast {
    --primary-color: #000000;
    --secondary-color: #ffffff;
    --accent-color: #ffff00;
    --text-color: #000000;
    --background-color: #ffffff;
    --border-color: #000000;
}

.high-contrast .meal-plan-container {
    background: #ffffff;
    border: 3px solid #000000;
    color: #000000;
}

.high-contrast .meal-plan-header-cell,
.high-contrast .meal-plan-day-cell {
    background: #000000;
    color: #ffffff;
    border: 2px solid #000000;
}

.high-contrast .meal-plan-cell {
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
}

.high-contrast .meal-plan-cell.today {
    background: #ffff00;
    color: #000000;
    border: 3px solid #000000;
}

.high-contrast .btn-primary {
    background: #000000;
    border-color: #000000;
    color: #ffffff;
}

.high-contrast .btn-primary:hover {
    background: #333333;
    border-color: #333333;
}

.high-contrast .btn-secondary {
    background: #ffffff;
    border-color: #000000;
    color: #000000;
}

.high-contrast .btn-secondary:hover {
    background: #f0f0f0;
    border-color: #000000;
}

.high-contrast .alert-success {
    background: #d4edda;
    border-color: #000000;
    color: #000000;
}

.high-contrast .alert-danger {
    background: #f8d7da;
    border-color: #000000;
    color: #000000;
}

.high-contrast .modal-content {
    background: #ffffff;
    border: 3px solid #000000;
    color: #000000;
}

.high-contrast .modal-header {
    background: #000000;
    color: #ffffff;
    border-bottom: 2px solid #000000;
}

.high-contrast .form-control,
.high-contrast .form-select {
    background: #ffffff;
    border: 2px solid #000000;
    color: #000000;
}

.high-contrast .form-control:focus,
.high-contrast .form-select:focus {
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
}

/* Large Text Mode Styles */
.large-text {
    font-size: calc(1rem * var(--text-scale, 100) / 100);
}

.large-text .meal-plan-cell {
    min-height: 100px;
    padding: 20px 16px;
}

.large-text .meal-type {
    font-size: 1.2em;
    font-weight: 600;
}

.large-text .meal-recipe {
    font-size: 1.1em;
}

.large-text .btn {
    padding: 12px 24px;
    font-size: 1.1em;
}

.large-text .modal-title {
    font-size: 1.5em;
}

.large-text .form-control,
.large-text .form-select {
    padding: 12px 16px;
    font-size: 1.1em;
}

/* Enhanced Focus Indicators */
.enhanced-focus *:focus {
    outline: 3px solid #4A7048 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(74, 112, 72, 0.3) !important;
}

.enhanced-focus .meal-plan-cell:focus {
    outline: 4px solid #4A7048 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 4px rgba(74, 112, 72, 0.4) !important;
    transform: scale(1.02);
}

.enhanced-focus .btn:focus {
    outline: 3px solid #4A7048 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(74, 112, 72, 0.3) !important;
}

.enhanced-focus .form-control:focus,
.enhanced-focus .form-select:focus {
    outline: 3px solid #4A7048 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(74, 112, 72, 0.3) !important;
}

/* Screen Reader Only Content */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Skip Links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #4A7048;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Touch Device Accessibility */
@media (hover: none) and (pointer: coarse) {
    .meal-plan-cell {
        min-height: 60px;
        padding: 16px 12px;
    }

    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .accessibility-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Print Styles for Accessibility */
@media print {
    .accessibility-controls {
        display: none;
    }

    .meal-plan-container {
        background: white !important;
        border: 1px solid black !important;
        color: black !important;
    }

    .meal-plan-header-cell,
    .meal-plan-day-cell {
        background: #f0f0f0 !important;
        color: black !important;
    }

    .meal-plan-cell {
        background: white !important;
        color: black !important;
        border: 1px solid black !important;
    }
}

.high-contrast.large-text .btn-generate {
    font-size: 1.5rem;
    padding: 24px 52px;
}

.high-contrast.enhanced-focus *:focus,
.high-contrast.enhanced-focus *:focus-visible {
    outline: 5px solid var(--accent-color) !important;
    outline-offset: 4px !important;
    box-shadow: 0 0 0 5px rgba(0, 0, 255, 0.6) !important;
}
