/* HealthyMeal Frontend Styles */

/* Recipe Section on Product Page */
.healthymeal-recipe-section {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.healthymeal-recipe-title {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #333;
}

.healthymeal-recipe-summary {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.healthymeal-recipe-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.healthymeal-calories {
    font-size: 18px;
    color: #28a745;
}

.healthymeal-servings,
.healthymeal-time {
    color: #6c757d;
    font-size: 14px;
}

.healthymeal-recipe-description {
    margin: 0;
    color: #495057;
    line-height: 1.5;
}

.healthymeal-view-recipe-btn {
    align-self: flex-start;
    padding: 12px 24px;
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.healthymeal-view-recipe-btn:hover {
    background: #005a87;
    color: #fff;
}

/* Recipe Modal */
.healthymeal-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.healthymeal-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.healthymeal-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 900px;
    max-height: 90vh;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.healthymeal-modal-header {
    display: flex;
    justify-content: flex-end;
    padding: 10px 15px;
    border-bottom: 1px solid #e9ecef;
}

.healthymeal-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.healthymeal-modal-close:hover {
    color: #333;
}

.healthymeal-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 70px);
}

/* Recipe Content */
.healthymeal-recipe-modal-content,
.healthymeal-recipe-tab-content {
    line-height: 1.6;
}

.recipe-header h2 {
    margin: 0 0 20px 0;
    font-size: 28px;
    color: #333;
}

.recipe-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
}

.recipe-nutrition {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

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

.nutrition-item .label {
    display: block;
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nutrition-item .value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-top: 2px;
}

.recipe-times {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #6c757d;
}

.recipe-description {
    margin-bottom: 25px;
    color: #495057;
    font-size: 16px;
}

.recipe-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.ingredients-section h3,
.instructions-section h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    color: #333;
    border-bottom: 2px solid #007cba;
    padding-bottom: 5px;
}

.ingredients-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.ingredient-item:last-child {
    border-bottom: none;
}

.ingredient-item .quantity {
    font-weight: 600;
    color: #007cba;
    min-width: 80px;
}

.ingredient-item .name {
    flex: 1;
    margin-left: 10px;
}

.ingredient-item .calories {
    font-size: 12px;
    color: #6c757d;
}

.instructions-list {
    padding-left: 0;
    counter-reset: step-counter;
}

.instruction-step {
    counter-increment: step-counter;
    padding: 15px 0 15px 40px;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

.instruction-step:last-child {
    border-bottom: none;
}

.instruction-step::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 15px;
    width: 25px;
    height: 25px;
    background: #007cba;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* Calorie Search Form */
.healthymeal-search-form {
    background: #fff;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 30px;
}

.healthymeal-search-form.compact {
    padding: 15px;
}

.search-main-fields {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.healthymeal-search-form.compact .search-main-fields {
    grid-template-columns: 1fr auto;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.field-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.field-group input,
.field-group select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.field-group input:focus,
.field-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.healthymeal-search-btn {
    padding: 10px 20px;
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.healthymeal-search-btn:hover {
    background: #005a87;
}

.search-advanced-fields {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.healthymeal-toggle-advanced {
    margin-top: 10px;
    padding: 8px 16px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    color: #007cba;
}

.healthymeal-toggle-advanced:hover {
    background: #f8f9fa;
}

/* Search Results */
.healthymeal-search-results {
    margin-top: 30px;
}

.search-results-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.search-results-header h2 {
    margin: 0 0 10px 0;
    color: #333;
}

.search-info {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #6c757d;
}

.target-info {
    font-weight: 600;
}

.products-grid .products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.healthymeal-product-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.product-image-link {
    position: relative;
    display: block;
}

.calorie-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #28a745;
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.product-details {
    padding: 15px;
}

.product-title {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.product-title a {
    color: #333;
    text-decoration: none;
}

.product-title a:hover {
    color: #007cba;
}

.recipe-description {
    margin-bottom: 10px;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.4;
}

.recipe-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 12px;
    color: #6c757d;
}

.product-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-actions .price {
    font-size: 18px;
    font-weight: 600;
    color: #28a745;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-buttons .button {
    padding: 8px 12px;
    font-size: 12px;
}

/* Calorie Badge */
.healthymeal-calorie-badge {
    display: inline-block;
    background: #28a745;
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.healthymeal-calorie-badge.shop-badge {
    margin-top: 5px;
    font-size: 11px;
    padding: 3px 6px;
}

/* Shop Page Calories */
.healthymeal-shop-calories {
    margin-top: 8px;
}

/* Order Recipe Info */
.healthymeal-order-recipe {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-left: 3px solid #007cba;
    font-size: 14px;
}

/* Similar Products */
.healthymeal-similar-products {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.healthymeal-similar-products h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.similar-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.similar-product-item {
    text-align: center;
    background: #fff;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.similar-product-item a {
    text-decoration: none;
    color: #333;
}

.similar-product-item h4 {
    margin: 10px 0 5px 0;
    font-size: 14px;
}

.similar-product-item .calories,
.similar-product-item .price {
    display: block;
    font-size: 12px;
    margin: 2px 0;
}

.similar-product-item .calories {
    color: #28a745;
    font-weight: 600;
}

.similar-product-item .price {
    color: #007cba;
    font-weight: 600;
}

/* Widget Styles */
.healthymeal-widget-recipes {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.widget-recipe-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.recipe-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.recipe-info {
    flex: 1;
}

.recipe-name {
    margin: 0 0 5px 0;
    font-size: 14px;
    line-height: 1.3;
}

.recipe-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
    font-size: 11px;
    color: #6c757d;
}

.button-link {
    background: none;
    border: none;
    color: #007cba;
    text-decoration: underline;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
}

.button-link:hover {
    color: #005a87;
}

/* Responsive Design */
@media (max-width: 768px) {
    .recipe-content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .search-main-fields {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .search-advanced-fields {
        grid-template-columns: 1fr;
    }
    
    .healthymeal-recipe-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .products-grid .products {
        grid-template-columns: 1fr;
    }
    
    .similar-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .healthymeal-modal-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .healthymeal-modal-body {
        padding: 15px;
        max-height: calc(95vh - 70px);
    }
}

@media (max-width: 480px) {
    .healthymeal-recipe-section {
        padding: 15px;
    }
    
    .healthymeal-search-form {
        padding: 15px;
    }
    
    .search-info {
        flex-direction: column;
        gap: 5px;
    }
    
    .product-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .similar-products-grid {
        grid-template-columns: 1fr;
    }
}

/* No Results */
.healthymeal-no-results {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.healthymeal-no-results h2 {
    margin: 0 0 15px 0;
    color: #333;
}

.search-suggestions {
    margin-top: 20px;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.search-suggestions h3 {
    margin-bottom: 10px;
    color: #333;
}

.search-suggestions ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.search-suggestions li {
    margin-bottom: 5px;
    color: #6c757d;
}
