/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 3rem;
}

.search-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

input[type="text"] {
    flex: 1;
    min-width: 300px;
    padding: 1rem 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="submit"] {
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

input[type="submit"]:active {
    transform: translateY(0);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.sort-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    color: #475569;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
}

.sort-select:hover {
    border-color: #cbd5e0;
}

.sort-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.sort-controls-standalone {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ingredients-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.clear-all-btn {
    background: none;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-all-btn:hover {
    background: #fee;
    border-color: #fcc;
    color: #dc2626;
}

.ingredient-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    min-height: 2rem;
}

.ingredient-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ingredient-tag:hover {
    background: #f0f4ff;
    transform: translateY(-1px);
}

.remove-tag {
    background: none;
    border: none;
    color: #667eea;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.remove-tag:hover {
    background: #667eea;
    color: white;
}

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.recipe-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.recipe-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.recipe-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-placeholder {
    color: white;
    opacity: 0.8;
}

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

.recipe-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.recipe-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recipe-meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #e2e8f0;
}

.recipe-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stars {
    display: flex;
    gap: 2px;
}

.star {
    color: #cbd5e0;
    font-size: 1.1rem;
}

.star.filled {
    color: #f59e0b;
}

.star.half {
    background: linear-gradient(90deg, #f59e0b 50%, #cbd5e0 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rating-value {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
}

.no-rating {
    font-size: 0.875rem;
    color: #94a3b8;
    font-style: italic;
}

.recipe-author,
.recipe-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #64748b;
}

.recipe-author svg,
.recipe-time svg {
    color: #94a3b8;
}

.recipe-ingredients {
    flex: 1;
}

.recipe-ingredients h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recipe-ingredients ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.recipe-ingredients li {
    background: #f1f5f9;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #475569;
}

.recipe-ingredients li.more-ingredients {
    background: #e0e7ff;
    color: #667eea;
    font-weight: 600;
}

.no-results {
    background: white;
    padding: 4rem 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.no-results svg {
    color: #cbd5e0;
    margin-bottom: 1.5rem;
}

.no-results p {
    font-size: 1.125rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.no-results p.hint {
    font-size: 0.9rem;
    color: #94a3b8;
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    form {
        padding: 1.5rem;
    }

    .search-row {
        flex-direction: column;
        align-items: stretch;
    }

    input[type="text"] {
        min-width: 100%;
    }

    .sort-controls {
        width: 100%;
        justify-content: space-between;
    }

    .sort-select {
        flex: 1;
    }

    .recipes-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }

    form {
        padding: 1rem;
    }

    input[type="text"],
    input[type="submit"] {
        padding: 0.875rem 1.25rem;
    }
}