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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, rgba(245, 245, 220, 0.5) 0%, rgba(210, 180, 140, 0.5) 100%), url('https://source.unsplash.com/1600x900/?kitchen');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    min-height: 100vh;
    padding: 20px;
}

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

header {
    text-align: center;
    color: #333;
    margin-bottom: 40px;
}

h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.tagline {
    font-size: 1.2em;
    opacity: 0.9;
}

.search-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(245, 245, 220, 0.8) 100%), linear-gradient(45deg, rgba(139, 69, 19, 0.1) 25%, transparent 25%, transparent 75%, rgba(139, 69, 19, 0.1) 75%);
    background-size: 20px 20px;
    backdrop-filter: blur(5px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#ingredientInput {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
}

#ingredientInput:focus {
    outline: none;
    border-color: #8b4513;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #8b4513;
    color: white;
}

.btn-primary:hover {
    background: #a0522d;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.4);
}

.btn-surprise {
    background: #daa520;
    color: white;
}

.btn-surprise:hover {
    background: #b8860b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(218, 165, 32, 0.4);
}

.selected-ingredients {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    min-height: 40px;
}

.ingredient-tag {
    background: #f0f0f0;
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ingredient-tag .remove {
    cursor: pointer;
    font-weight: bold;
    color: #ff6b6b;
}

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

.results-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.recipe-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(245, 245, 220, 0.9) 100%), linear-gradient(45deg, rgba(160, 82, 45, 0.05) 25%, transparent 25%, transparent 75%, rgba(160, 82, 45, 0.05) 75%);
    background-size: 15px 15px;
    backdrop-filter: blur(5px);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.recipe-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #f5f5dc 0%, #d2b48c 100%);
}

.recipe-content {
    padding: 20px;
}

.recipe-title {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: #333;
}

.recipe-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #666;
}

.recipe-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.match-badge {
    display: inline-block;
    background: #4ade80;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.recipe-ingredients {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    max-width: 800px;
    margin: 50px auto;
    border-radius: 20px;
    padding: 40px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2em;
    cursor: pointer;
    color: #999;
}

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

.modal-title {
    font-size: 2em;
    margin-bottom: 20px;
    color: #333;
}

.modal-section {
    margin-bottom: 30px;
}

.modal-section h3 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #8b4513;
}

.modal-section ul {
    list-style: none;
    padding-left: 0;
}

.modal-section ul li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.modal-section ul li:before {
    content: "✓ ";
    color: #4ade80;
    font-weight: bold;
    margin-right: 8px;
}

.instructions-list {
    list-style: none;
    counter-reset: step-counter;
}

.instructions-list li {
    counter-increment: step-counter;
    margin-bottom: 15px;
    padding-left: 40px;
    position: relative;
}

.instructions-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: #8b4513;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.no-results {
    text-align: center;
    color: #333;
    font-size: 1.2em;
    padding: 40px;
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    float: right;
    transition: transform 0.2s;
}

.favorite-btn:hover {
    transform: scale(1.2);
}

.favorite-btn.active {
    color: #ff6b6b;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }

    .input-group {
        flex-direction: column;
    }

    .action-buttons {
        flex-direction: column;
    }

    .results-section {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 20px;
        padding: 20px;
    }
}
