/**
 * Recipe Plugin Public Styles
 */

/* Recipe Card Container */
.recipe-card {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Jump to Recipe Button */
.recipe-jump-button {
    text-align: center;
    margin-bottom: 20px;
}

.recipe-jump-button .button {
    background: #2271b1;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    font-weight: 600;
}

.recipe-jump-button .button:hover {
    background: #135e96;
}

/* Recipe Header */
.recipe-header {
    margin-bottom: 30px;
}

.recipe-title {
    font-size: 32px;
    margin: 0 0 20px 0;
    color: #333;
}

.recipe-image {
    margin: 20px 0;
    text-align: center;
}

.recipe-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.recipe-excerpt {
    font-size: 18px;
    line-height: 1.6;
    color: #555;
}

/* Recipe Meta */
.recipe-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 6px;
    margin-bottom: 30px;
}

.recipe-meta-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.meta-label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.meta-value {
    font-size: 16px;
    color: #666;
}

.recipe-servings-input {
    width: 80px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* Rating Section */
.recipe-rating-section {
    margin-bottom: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 6px;
}

.recipe-rating-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recipe-rating-display {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rating-stars {
    display: inline-flex;
    gap: 4px;
}

.star {
    font-size: 24px;
    color: #ffc107;
}

.star-empty {
    color: #ddd;
}

.star-half {
    position: relative;
    color: #ddd;
}

.star-half::before {
    content: '★';
    position: absolute;
    left: 0;
    color: #ffc107;
    width: 50%;
    overflow: hidden;
}

.stars-interactive .star {
    cursor: pointer;
    transition: color 0.2s;
    color: #ddd;
}

.stars-interactive .star:hover,
.stars-interactive .star.active {
    color: #ffc107;
}

.rating-text {
    font-size: 16px;
    color: #333;
}

.recipe-rating-form p {
    margin: 0 0 10px 0;
    font-weight: 600;
}

.submit-rating-button {
    margin-top: 10px;
}

.submit-rating-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rating-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
}

.rating-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.rating-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Action Buttons */
.recipe-actions {
    margin-bottom: 30px;
}

.recipe-print-button {
    background: #666;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.recipe-print-button:hover {
    background: #444;
}

/* Ingredients */
.recipe-ingredients {
    margin-bottom: 30px;
}

.recipe-ingredients h3,
.recipe-instructions h3,
.recipe-notes h3,
.recipe-nutrition h3 {
    font-size: 24px;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    color: #333;
}

.ingredients-list {
    font-size: 16px;
}

.ingredient-group {
    list-style: none !important;
    padding: 0;
    margin: 0 0 20px 0;
}

.ingredient-group li {
    list-style: none !important;
}

.ingredient-group li::before {
    content: none !important;
}

.ingredient-section {
    margin-bottom: 20px;
}

.ingredient-group-title {
    font-size: 18px;
    font-weight: 600;
    margin: 15px 0 10px 0;
    color: #555;
}

.ingredient-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ingredient-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.ingredient-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.ingredient-item label:has(.ingredient-checkbox:checked) {
    text-decoration: line-through;
    opacity: 0.6;
}

.ingredient-amount,
.ingredient-unit,
.ingredient-name {
    margin-right: 4px;
}

.ingredient-amount {
    font-weight: 600;
}

/* Instructions */
.recipe-instructions {
    margin-bottom: 30px;
}

.instruction-group {
    counter-reset: step-counter;
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.instruction-section {
    margin-bottom: 20px;
}

.instruction-group-title {
    font-size: 18px;
    font-weight: 600;
    margin: 15px 0 10px 0;
    color: #555;
}

.instruction-item {
    padding: 15px;
    margin-bottom: 15px;
    background: #f9f9f9;
    border-radius: 6px;
    counter-increment: step-counter;
    position: relative;
    padding-left: 60px;
}

.instruction-item::before {
    content: counter(step-counter);
    position: absolute;
    left: 15px;
    top: 15px;
    width: 30px;
    height: 30px;
    background: #2271b1;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.instruction-item p {
    margin: 0;
    line-height: 1.6;
}

.instruction-images {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.instruction-image {
    text-align: center;
}

.instruction-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Single image takes full width */
.instruction-images:has(.instruction-image:only-child) {
    grid-template-columns: 1fr;
}

.instruction-images:has(.instruction-image:only-child) .instruction-image img {
    max-width: 600px;
}

/* Notes */
.recipe-notes {
    margin-bottom: 30px;
    padding: 20px;
    background: #fffbf0;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
}

.recipe-notes-content {
    line-height: 1.6;
}

/* Nutrition */
.recipe-nutrition {
    margin-bottom: 30px;
    padding: 20px;
    background: #f0f8ff;
    border-radius: 6px;
}

.nutrition-note {
    font-style: italic;
    color: #666;
    margin: 0 0 10px 0;
}

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

.nutrition-list li {
    padding: 8px;
    background: white;
    border-radius: 4px;
}

/* Taxonomies */
.recipe-taxonomies {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.recipe-taxonomy {
    margin-bottom: 10px;
    font-size: 14px;
}

.recipe-taxonomy strong {
    color: #333;
    margin-right: 8px;
}

/* Print Styles */
@media print {
    .recipe-jump-button,
    .recipe-actions,
    .recipe-rating-section {
        display: none !important;
    }

    .recipe-card {
        border: none;
        box-shadow: none;
        padding: 0;
    }

    .ingredient-checkbox {
        display: none;
    }

    .instruction-item {
        page-break-inside: avoid;
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .recipe-card {
        padding: 20px;
    }

    .recipe-title {
        font-size: 24px;
    }

    .recipe-meta {
        grid-template-columns: 1fr;
    }

    .nutrition-list {
        grid-template-columns: 1fr;
    }
}
