/* AI Gluten-Free Meal Planner WordPress Plugin Styles */

.aigfmp-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    line-height: 1.6;
}

.aigfmp-container.theme-light {
    background: linear-gradient(135deg, #f0f9ff 0%, #ecfdf5 100%);
    color: #1f2937;
}

.aigfmp-container.theme-dark {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: #f9fafb;
}

/* Header Styles */
.aigfmp-header {
    text-align: center;
    margin-bottom: 2rem;
}

.aigfmp-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.aigfmp-header p {
    font-size: 1.125rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
}

/* Form Styles */
.aigfmp-form-container {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.theme-dark .aigfmp-form-container {
    background: #374151;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.theme-dark .form-group label {
    color: #d1d5db;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.theme-dark .form-group input,
.theme-dark .form-group select,
.theme-dark .form-group textarea {
    background: #4b5563;
    border-color: #6b7280;
    color: #f9fafb;
}

.form-group textarea {
    height: 80px;
    resize: vertical;
}

/* Dietary Preferences */
.dietary-preferences {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.dietary-option {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dietary-option:hover {
    background: #f3f4f6;
}

.dietary-option input[type="checkbox"] {
    margin-right: 0.5rem;
    width: auto;
}

.dietary-option input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: #10b981;
}

.theme-dark .dietary-option {
    border-color: #6b7280;
}

.theme-dark .dietary-option:hover {
    background: #4b5563;
}

/* Compact Form Styles */
.aigfmp-form-container .compact {
    padding: 1rem;
}

.compact .form-row {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.compact .form-group {
    margin-bottom: 1rem;
}

.compact .dietary-preferences {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.compact .dietary-option {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Button Styles */
.form-actions {
    text-align: center;
    margin-top: 2rem;
}

.aigfmp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.aigfmp-btn.primary {
    background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    color: white;
}

.aigfmp-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.aigfmp-btn.primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.aigfmp-btn.secondary {
    background: #6b7280;
    color: white;
}

.aigfmp-btn.secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

/* Loading Styles */
.aigfmp-loading {
    text-align: center;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* Recipe Loading Overlay */
.aigfmp-recipe-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recipe-loading-content {
    background: white;
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    max-width: 500px;
    margin: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: fadeInScale 0.3s ease-out;
}

.theme-dark .recipe-loading-content {
    background: #374151;
    color: #f9fafb;
}

.recipe-loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f4f6;
    border-top: 5px solid #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

.recipe-loading-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
}

.theme-dark .recipe-loading-content h3 {
    color: #f9fafb;
}

.recipe-loading-message {
    font-size: 1.1rem;
    color: #10b981;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.recipe-loading-sub {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.theme-dark .recipe-loading-sub {
    color: #d1d5db;
}

.recipe-loading-progress {
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #3b82f6);
    border-radius: 4px;
    width: 0;
    transition: width 20s ease-in-out;
}

.progress-fill.animate {
    width: 90%;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Meal Plan Display Styles */
.aigfmp-meal-plan-display {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin: 2rem 0;
}

.theme-dark .aigfmp-meal-plan-display {
    background: #374151;
    color: #f9fafb;
}

.meal-plan-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 0.5rem;
}

.theme-dark .meal-plan-summary {
    background: #4b5563;
}

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

.summary-item .label {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.summary-item .value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #10b981;
}

/* Day Sections */
.meals-by-day {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.day-section h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #10b981;
}

.day-meals {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Meal Cards */
.meal-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.meal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-dark .meal-card {
    background: #4b5563;
    border-color: #6b7280;
}

.meal-card h5 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #1f2937;
}

.theme-dark .meal-card h5 {
    color: #f9fafb;
}

.meal-card .meal-type {
    font-size: 0.875rem;
    color: #10b981;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.meal-card .meal-description {
    color: #6b7280;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.meal-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.meal-stats span:first-child {
    color: #10b981;
}

.meal-nutrition {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.view-recipe-btn {
    width: 100%;
    padding: 0.5rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.view-recipe-btn:hover {
    background: #059669;
}

/* Modern Recipe Details Styles */
.recipe-header-modern {
    background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    color: white;
    padding: 2rem;
    border-radius: 1rem 1rem 0 0;
    margin-bottom: 0;
}

.recipe-title-section {
    margin-top: 1rem;
}

.recipe-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.meta-item i {
    font-style: normal;
    font-size: 1.2rem;
}

.recipe-content-modern {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    background: white;
}

.theme-dark .recipe-content-modern {
    background: #374151;
}

.recipe-section-modern {
    background: #f9fafb;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    margin-bottom: 2rem;
}

.theme-dark .recipe-section-modern {
    background: #4b5563;
    border-color: #6b7280;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1f2937;
    border-bottom: 2px solid #10b981;
    padding-bottom: 0.5rem;
}

.theme-dark .section-title {
    color: #f9fafb;
}

.section-icon {
    font-size: 1.5rem;
    font-style: normal;
}

/* Ingredients Section */
.ingredients-section {
    grid-column: 1;
}

.ingredients-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ingredient-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.ingredient-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.theme-dark .ingredient-item {
    background: #374151;
    border-color: #6b7280;
}

.ingredient-check {
    color: #10b981;
    font-weight: bold;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.ingredient-text {
    flex: 1;
    font-weight: 500;
    color: #374151;
}

.theme-dark .ingredient-text {
    color: #d1d5db;
}

/* Nutrition Section */
.nutrition-section {
    grid-column: 2;
}

.nutrition-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.nutrition-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nutrition-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: currentColor;
}

.nutrition-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.nutrition-card.red { color: #ef4444; }
.nutrition-card.blue { color: #3b82f6; }
.nutrition-card.orange { color: #f59e0b; }
.nutrition-card.green { color: #10b981; }
.nutrition-card.gray { color: #6b7280; }

.theme-dark .nutrition-card {
    background: #374151;
}

.nutrition-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.nutrition-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.theme-dark .nutrition-label {
    color: #d1d5db;
}

.nutrition-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: currentColor;
}

/* Instructions Section */
.instructions-section {
    grid-column: 1 / -1;
}

.instructions-list-modern {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.instruction-step {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.instruction-step:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
    transform: translateY(-2px);
}

.theme-dark .instruction-step {
    background: #374151;
    border-color: #6b7280;
}

.step-number {
    background: linear-gradient(135deg, #10b981, #3b82f6);
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.step-content {
    flex: 1;
    font-size: 1rem;
    line-height: 1.6;
    color: #374151;
    padding-top: 0.25rem;
}

.theme-dark .step-content {
    color: #d1d5db;
}

/* Tips Section */
.tips-section {
    grid-column: 1 / -1;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.tip-card {
    background: linear-gradient(135deg, #fef3c7 0%, #f3e8ff 100%);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid #fbbf24;
    display: flex;
    gap: 1rem;
    transition: all 0.3s ease;
}

.tip-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(251, 191, 36, 0.3);
}

.theme-dark .tip-card {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
    border-color: #6b7280;
}

.tip-icon {
    background: #fbbf24;
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.tip-content {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #92400e;
    font-weight: 500;
}

.theme-dark .tip-content {
    color: #d1d5db;
}

/* Responsive Design for Recipe */
@media (max-width: 768px) {
    .recipe-content-modern {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .recipe-title {
        font-size: 1.5rem;
    }
    
    .recipe-meta {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .nutrition-cards {
        grid-template-columns: 1fr;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .instruction-step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        align-self: center;
    }
}
.aigfmp-recent-meal-plans {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.meal-plans-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.meal-plan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 0.25rem;
    border: 1px solid #e5e7eb;
}

.plan-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.plan-date {
    font-weight: 600;
    color: #1f2937;
}

.plan-meals,
.plan-cost {
    font-size: 0.875rem;
    color: #6b7280;
}

.plan-actions {
    display: flex;
    gap: 0.5rem;
}

.plan-actions button {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.plan-actions button:hover {
    background: #f3f4f6;
    border-color: #10b981;
}

/* Enhanced Mobile UX Improvements */

/* Fix text overflow issues on mobile */
@media (max-width: 768px) {
    * {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .aigfmp-container {
        overflow-x: hidden;
        max-width: 100vw;
    }
}

/* Mobile Recipe Details Fixes */
@media (max-width: 768px) {
    .recipe-content-modern {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .recipe-header-modern {
        padding: 1rem;
        text-align: center;
    }
    
    .recipe-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .recipe-meta {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }
    
    .recipe-meta-item {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        min-width: auto;
        text-align: center;
    }
    
    .nutrition-cards {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .nutrition-card {
        padding: 1rem;
        text-align: center;
    }
    
    .nutrition-card h4 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .nutrition-card .value {
        font-size: 1.5rem;
        font-weight: 700;
    }
    
    .section-title {
        font-size: 1.1rem;
        text-align: center;
        margin-bottom: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .ingredients-section,
    .nutrition-section {
        grid-column: 1;
    }
    
    .recipe-section-modern {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .ingredient-item {
        padding: 0.75rem;
        flex-wrap: wrap;
    }
    
    .ingredient-text {
        font-size: 0.9rem;
        line-height: 1.4;
        word-break: break-word;
    }
    
    .instructions-list {
        padding: 0;
    }
    
    .instruction-step {
        flex-direction: column;
        text-align: left;
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .step-number {
        align-self: flex-start;
        margin-bottom: 0.5rem;
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .step-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .tips-item {
        padding: 1rem;
        font-size: 0.9rem;
        line-height: 1.4;
    }
}

@media (max-width: 480px) {
    .recipe-content-modern {
        padding: 0.5rem;
        gap: 0.75rem;
    }
    
    .recipe-header-modern {
        padding: 0.75rem;
    }
    
    .recipe-title {
        font-size: 1.3rem;
    }
    
    .recipe-meta-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .nutrition-card {
        padding: 0.75rem;
    }
    
    .nutrition-card h4 {
        font-size: 0.9rem;
    }
    
    .nutrition-card .value {
        font-size: 1.3rem;
    }
    
    .section-title {
        font-size: 1rem;
        gap: 0.5rem;
    }
    
    .recipe-section-modern {
        padding: 0.75rem;
    }
    
    .ingredient-item {
        padding: 0.5rem;
    }
    
    .ingredient-text {
        font-size: 0.85rem;
    }
    
    .instruction-step {
        padding: 0.75rem;
    }
    
    .step-text {
        font-size: 0.85rem;
    }
    
    .tips-item {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
}

/* Viewport and base mobile styles */
@media (max-width: 768px) {
    .aigfmp-container {
        padding: 0.5rem;
        min-height: 100vh;
    }
    
    .aigfmp-form-container {
        padding: 1rem;
        margin: 0.5rem 0;
        border-radius: 0.75rem;
    }
    
    .aigfmp-header {
        position: sticky;
        top: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        z-index: 100;
        padding: 1rem 0;
        margin-bottom: 1rem;
    }
    
    .theme-dark .aigfmp-header {
        background: rgba(31, 41, 55, 0.95);
    }
    
    .aigfmp-header h2 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .aigfmp-header p {
        font-size: 0.95rem;
        margin-top: 0.5rem;
    }
}

/* Touch-friendly interactions */
.dietary-option.touching,
.aigfmp-btn:active,
.view-recipe-btn:active {
    transform: scale(0.98);
    background: #e5e7eb;
    transition: all 0.1s ease;
}

.theme-dark .dietary-option.touching,
.theme-dark .aigfmp-btn:active,
.theme-dark .view-recipe-btn:active {
    background: #4b5563;
}

/* Form validation styles for mobile */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group.error::after {
    content: "This field is required";
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Loading states for mobile */
.loading-mobile {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-mobile .spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Improved mobile meal plan display */
@media (max-width: 768px) {
    .meal-plan-container {
        padding: 0.5rem;
    }
    
    .day-section {
        margin-bottom: 1.5rem;
        background: white;
        border-radius: 0.75rem;
        padding: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .day-section h4 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
        color: #10b981;
        font-weight: 600;
    }
    
    .meal-card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
    }
    
    .meal-card:last-child {
        margin-bottom: 0;
    }
    
    .meal-card h5 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
        color: #1f2937;
    }
    
    .meal-type {
        font-size: 0.8rem;
        text-transform: uppercase;
        font-weight: 600;
        color: #6b7280;
        margin-bottom: 0.5rem;
    }
    
    .meal-description {
        font-size: 0.9rem;
        color: #4b5563;
        margin-bottom: 0.75rem;
        line-height: 1.4;
    }
    
    .meal-stats {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .meal-stats span {
        background: #e0f2fe;
        color: #0369a1;
        padding: 0.25rem 0.5rem;
        border-radius: 0.25rem;
        font-size: 0.8rem;
        font-weight: 500;
    }
    
    .meal-nutrition {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .meal-nutrition span {
        background: #f0fdf4;
        color: #166534;
        padding: 0.25rem 0.5rem;
        border-radius: 0.25rem;
        font-size: 0.8rem;
        font-weight: 500;
    }
    
    .view-recipe-btn {
        width: 100%;
        padding: 0.75rem;
        font-size: 1rem;
        font-weight: 600;
        background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
        color: white;
        border: none;
        border-radius: 0.5rem;
        cursor: pointer;
        transition: all 0.2s ease;
        min-height: 44px;
    }
    
    .view-recipe-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    }
}
@media (max-width: 768px) {
    .aigfmp-container {
        padding: 1rem;
    }
    
    .aigfmp-header h2 {
        font-size: 2rem;
    }
    
    .aigfmp-header p {
        font-size: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dietary-preferences {
        grid-template-columns: 1fr;
    }
    
    .dietary-option {
        padding: 0.75rem;
        font-size: 1rem;
        min-height: 48px; /* Touch-friendly minimum */
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px; /* Touch-friendly minimum */
    }
    
    .aigfmp-btn {
        padding: 1rem 2rem;
        font-size: 1.1rem;
        min-height: 48px;
        width: 100%;
    }
    
    .meals-by-day {
        grid-template-columns: 1fr;
    }
    
    .meal-plan-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .meal-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .meal-card h5 {
        font-size: 1.1rem;
    }
    
    .meal-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .meal-nutrition {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .view-recipe-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        min-height: 44px;
        width: 100%;
    }
    
    .meal-plan-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .plan-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .plan-actions button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        min-height: 36px;
    }
    
    .recipe-content-modern {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .recipe-title {
        font-size: 1.5rem;
    }
    
    .recipe-meta {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .nutrition-cards {
        grid-template-columns: 1fr;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .instruction-step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        align-self: center;
    }
}

@media (max-width: 480px) {
    .aigfmp-container {
        padding: 0.5rem;
    }
    
    .aigfmp-form-container {
        padding: 1rem;
        margin: 0.5rem 0;
    }
    
    .aigfmp-header h2 {
        font-size: 1.75rem;
    }
    
    .aigfmp-header p {
        font-size: 0.9rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
        padding: 0.875rem;
    }
    
    .dietary-option {
        padding: 0.625rem;
        font-size: 0.9rem;
    }
    
    .meal-plan-summary {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .summary-item {
        text-align: center;
        padding: 0.75rem;
    }
    
    .meal-card {
        padding: 0.75rem;
    }
    
    .meal-card h5 {
        font-size: 1rem;
    }
    
    .meal-description {
        font-size: 0.85rem;
    }
    
    .meal-stats span,
    .meal-nutrition span {
        font-size: 0.8rem;
    }
    
    .compact .form-row {
        grid-template-columns: 1fr;
    }
    
    .day-section h4 {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }
    
    .recipe-title {
        font-size: 1.3rem;
    }
    
    .recipe-meta-item {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .ingredients-list li,
    .instructions-list li {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    .nutrition-card {
        padding: 0.75rem;
    }
    
    .nutrition-card h4 {
        font-size: 1.1rem;
    }
    
    .nutrition-card .value {
        font-size: 1.3rem;
    }
    
    .tips-item {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    .aigfmp-container {
        background: white !important;
        color: black !important;
        box-shadow: none;
    }
    
    .form-actions,
    .view-recipe-btn,
    .plan-actions {
        display: none !important;
    }
    
    .meal-card {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* Accessibility Improvements */
.aigfmp-container *:focus {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

.dietary-option:focus-within {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* WordPress Admin Styles */
.wp-admin .aigfmp-container {
    background: white;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.wp-admin .aigfmp-card {
    background: #fff;
    padding: 20px;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    margin-bottom: 20px;
}

.wp-admin .aigfmp-card h2 {
    margin-top: 0;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .aigfmp-container {
        border: 2px solid #000;
    }
    
    .meal-card {
        border: 2px solid #000;
    }
    
    .aigfmp-btn.primary {
        background: #000;
        color: #fff;
    }
}