/* AI Meal Plan Frontend Styles */
.ai-meal-plan-frontend {
    max-width: 1200px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ai-meal-plan-form-container {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e5e9;
}

.form-section {
    margin-bottom: 35px;
}
.d-flex {
    display: flex;
    justify-content: center;
    column-gap: 16px;
    align-items: center;
}
.form-section h3 {
    color: #1a1a1a;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}
.error-message-frontend, .error-message , .loading-spinner, .meal-plan-result {
    display: none;
}
/* Diet Options */
.diet-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.diet-option {
    position: relative;
}

.diet-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.diet-option label {
    display: block;
    padding: 24px 16px;
    border: 2px solid #e8ecef;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.diet-option label:hover {
    border-color: #3565ff;
    background: #eef2ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.diet-option input[type="radio"]:checked + label {
    border-color: #3565ff;
    background: #eef2ff;
    color: #3565ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.diet-icon {
    font-size: 28px;
    margin-bottom: 10px;
    display: block;
}

.diet-option span {
    display: block;
    font-weight: 500;
    font-size: 14px;
}

/* Calories and Meals Section */
.calories-section,
.meals-section {
    margin-bottom: 20px;
    text-align: center;
}

.calories-section label,
.meals-section label {
    font-size: 18px;
    color: #374151;
    font-weight: 500;
}

.calories-section input,
.meals-section select {
    margin: 0 10px;
    padding: 10px 15px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    background: #fff;
    transition: border-color 0.3s ease;
}

.calories-section input:focus,
.meals-section select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Macro Targets */
.macro-targets {
    display: flex;
    flex-direction: row;
    gap: 18px;
    margin-bottom: 20px;
    align-items: stretch;
    justify-content: center;
}

.macro-item {
    background: #e5eeff;
    padding: 12px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    color: #374151;
    font-weight: 500;
}

.macro-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.macro-item input {
    width: 70px;
    padding: 8px 12px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    margin: 0 8px;
    text-align: center;
    font-weight: 600;
    transition: border-color 0.3s ease;
}

.macro-item input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Generate Button */
.generate-button {
    background: linear-gradient(135deg, #3565ff 0%, #38b9d1 100%);
    color: white;
    border: none;
    padding: 18px 50px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 250px;
    margin: 0 auto;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.generate-button:hover {
    background: linear-gradient(135deg, #3565ff 0%, #38b9d1 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgb(53 173 255 / 30%);
}

.generate-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 50px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    margin-top: 25px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e2e8f0;
    border-top: 5px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-spinner p {
    color: #64748b;
    font-weight: 500;
    font-size: 16px;
}

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

/* Meal Plan Result */
.meal-plan-result {
    margin-top: 35px;
    padding: 30px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    border: 2px solid #0ea5e9;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.1);
}

.meal-plan-result h3 {
    color: #0c4a6e;
    margin-bottom: 25px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
}

#meal-plan-content-frontend {
    line-height: 1.8;
    color: #374151;
}

#meal-plan-content-frontend h4 {
    color: #0c4a6e;
    margin: 25px 0 15px;
    padding: 12px 0;
    border-bottom: 2px solid #0ea5e9;
    font-size: 18px;
    font-weight: 600;
}

#meal-plan-content-frontend strong {
    color: #1f2937;
}

/* Error Message */
.error-message {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #dc2626;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #fca5a5;
    margin-top: 25px;
    text-align: center;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-meal-plan-frontend {
        margin: 15px;
    }
    
    .ai-meal-plan-form-container {
        padding: 25px 20px;
    }
    
    .diet-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .diet-option label {
        padding: 20px 12px;
    }
    
    .macro-targets {
        gap: 15px;
    }
    
    .calories-section label,
    .meals-section label {
        font-size: 16px;
    }
    
    .calories-section input,
    .meals-section select {
        font-size: 16px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .diet-options {
        grid-template-columns: 1fr;
    }
    
    .calories-section,
    .meals-section {
        text-align: left;
    }
    
    .calories-section input,
    .meals-section select {
        display: block;
        margin: 15px 0 10px;
        width: 100%;
        max-width: 200px;
    }
    
    .macro-item {
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    .generate-button {
        padding: 15px 40px;
        font-size: 16px;
    }
}
