/**
 * Meal Planner & Recipe Manager Recipe CSS
 * Styling for recipe display
 */

.mpr-recipe-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.mpr-recipe-header {
    text-align: center;
    margin-bottom: 20px;
}

.mpr-recipe-header h1 {
    margin-bottom: 10px;
}

.mpr-recipe-image {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 20px;
    border-radius: 8px;
    overflow: hidden;
}

.mpr-recipe-image img {
    width: 100%;
    height: auto;
    display: block;
}

.mpr-recipe-overview {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.mpr-recipe-overview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.mpr-recipe-overview-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.mpr-recipe-overview-value {
    font-size: 16px;
    font-weight: bold;
}

.mpr-recipe-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.mpr-recipe-action-button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #f5f5f5;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.mpr-recipe-action-button:hover {
    background-color: #f0f0f0;
}

.mpr-recipe-action-button i {
    font-size: 16px;
}

.mpr-recipe-save-button.saved {
    color: #e74c3c;
}

.mpr-recipe-description {
    margin-bottom: 30px;
    line-height: 1.6;
}

.mpr-recipe-section {
    margin-bottom: 30px;
}

.mpr-recipe-section-title {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 20px;
}

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

.mpr-recipe-ingredient {
    padding: 8px 0;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f5f5f5;
}

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

.mpr-recipe-ingredient-checkbox {
    margin-right: 10px;
}

.mpr-recipe-ingredient-text {
    flex-grow: 1;
}

.mpr-recipe-directions-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    counter-reset: step-counter;
}

.mpr-recipe-direction {
    padding: 10px 0 10px 40px;
    position: relative;
    margin-bottom: 10px;
}

.mpr-recipe-direction::before {
    content: counter(step-counter);
    counter-increment: step-counter;
    position: absolute;
    left: 0;
    top: 5px;
    width: 30px;
    height: 30px;
    background-color: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.mpr-recipe-notes {
    background-color: #fffde7;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.mpr-recipe-notes-title {
    font-weight: bold;
    margin-bottom: 10px;
}

.mpr-recipe-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 20px;
}

.mpr-recipe-tag {
    padding: 5px 10px;
    background-color: #e3f2fd;
    border-radius: 20px;
    font-size: 12px;
    color: #0d47a1;
}

.mpr-recipe-author {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    font-style: italic;
    color: #666;
}

/* Unit switcher */
.mpr-unit-switcher {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.mpr-unit-switch-button {
    padding: 5px 10px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.mpr-unit-switch-button.active {
    background-color: #f5f5f5;
    font-weight: bold;
}

.mpr-metric {
    display: none;
}

/* Servings adjuster */
.mpr-servings-adjuster {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.mpr-servings-label {
    font-size: 14px;
}

.mpr-servings-select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Recipe Card */
.mpr-recipe-card-image {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.mpr-recipe-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mpr-recipe-placeholder-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
}

.mpr-recipe-placeholder-icon i {
    font-size: 48px;
}

/* Loading state - orange color */
.mpr-recipe-placeholder-icon.loading {
    color: #fca58f;
}

/* Failed state - revert to grey */
.mpr-recipe-placeholder-icon.failed {
    color: #aaa;
}

/* Recipe Search Bar */
.mpr-search-container {
    position: relative;
    max-width: 400px;
    margin: 20px auto;
    margin-bottom: 30px;
}

.mpr-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.mpr-search-input:focus {
    outline: none;
    border-color: var(--wp--preset--color--primary, #505450);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Hide recipes when searching */
.mpr-recipe-card.mpr-hidden {
    display: none !important;
}

/* No results message */
.mpr-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    display: none;
}

.mpr-no-results.mpr-show {
    display: block;
}

/* Recipe save button states */
.mpr-recipe-save-button {
    background: #fff !important; /* Force white background */
    background-color: #fff !important; /* Force white background */
    border: 1px solid #ddd !important;
}

.mpr-recipe-save-button:hover {
    background: #f8f9fa !important; /* Light gray on hover */
    background-color: #f8f9fa !important;
    border-color: #adb5bd !important;
}

.mpr-recipe-save-button.mpr-saved i {
    color: #dc3545 !important; /* Red heart when saved */
}

/* More specific targeting for Font Awesome heart icons to ensure visibility */
.mpr-recipe-save-button .fa-heart,
.mpr-recipe-save-button .fa-regular,
.mpr-recipe-save-button .fa-solid {
    color: #666 !important;
}

/* Ensure unsaved hearts are specifically grey, not white */
.mpr-recipe-save-button:not(.mpr-saved) i,
.mpr-recipe-save-button:not(.mpr-saved) .fa-heart {
    color: #666 !important;
}

/* Login button heart should also be grey */
.mpr-recipe-login-button i,
.mpr-recipe-login-button .fa-heart {
    color: #666 !important;
}

.mpr-recipe-save-button.mpr-loading {
    opacity: 0.6;
    pointer-events: none;
}

.mpr-recipe-save-button.mpr-loading i {
    animation: mpr-spin 1s linear infinite;
}

/* Recipe save button feedback */
.mpr-feedback {
    position: absolute;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    white-space: nowrap;
}

.mpr-feedback-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.mpr-feedback-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

@keyframes mpr-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .mpr-recipe-overview {
        gap: 10px;
    }
    
    .mpr-recipe-overview-item {
        min-width: 70px;
    }
    
    .mpr-recipe-actions {
        flex-wrap: wrap;
    }
    
    .mpr-search-container {
        max-width: 90%;
        margin: 15px auto;
    }
} 