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

body {
    font-family: 'Georgia', serif;
    background: #fdfcf9;
    color: #2c2c2c;
    line-height: 1.7;
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.back {
    display: inline-block;
    text-decoration: none;
    color: #8b7d6b;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.back:hover {
    color: #4a3728;
}

h1 {
    font-size: 2rem;
    color: #3a3a3a;
    letter-spacing: 0.08em;
}

.subtitle {
    color: #8b7d6b;
    font-style: italic;
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f7f5f0;
    border-radius: 8px;
    border: 1px solid #e0d8c8;
    align-items: flex-start;
}

.filter-group {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.filter-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.4rem;
    color: #4a3728;
    font-size: 0.85rem;
}

.dropdown-filter {
    position: relative;
}

.dropdown-filter input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e0d8c8;
    border-radius: 5px;
    font-size: 0.88rem;
    font-family: 'Georgia', serif;
    background: #fff;
}

.dropdown-filter input:focus {
    outline: none;
    border-color: #8b7d6b;
}

.dropdown-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e0d8c8;
    border-top: none;
    border-radius: 0 0 5px 5px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.dropdown-list.open {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.dropdown-item:hover {
    background: #f7f5f0;
}

.dropdown-item input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.dropdown-item label {
    cursor: pointer;
    flex: 1;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    background: #4a3728;
    color: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
}

.tag button {
    background: none;
    border: none;
    color: #fff;
    margin-left: 0.4rem;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
}

#clear-filters {
    align-self: flex-end;
    padding: 0.5rem 1rem;
    background: #4a3728;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: 'Georgia', serif;
    transition: background 0.2s;
}

#clear-filters:hover {
    background: #8b6914;
}

/* Results */
.results {
    margin-top: 1rem;
}

#result-count {
    font-style: italic;
    color: #8b7d6b;
    margin-bottom: 1rem;
}

.recipe-card {
    background: #fff;
    border: 1px solid #e0d8c8;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.recipe-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.recipe-card h3 {
    color: #4a3728;
    margin-bottom: 0.3rem;
}

.recipe-card .category {
    font-size: 0.8rem;
    color: #8b7d6b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recipe-card .ailments {
    margin-top: 0.4rem;
}

.recipe-card .ailment-badge {
    display: inline-block;
    background: #f7f5f0;
    color: #4a3728;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    margin-right: 0.3rem;
    margin-top: 0.2rem;
    border: 1px solid #e0d8c8;
}

.recipe-card .ingredients-list {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid #e0d8c8;
}

.recipe-card .ingredients-list h4 {
    font-size: 0.85rem;
    color: #8b7d6b;
    margin-bottom: 0.4rem;
}

.recipe-card .ingredients-list table {
    width: 100%;
    font-size: 0.82rem;
    border-collapse: collapse;
}

.recipe-card .ingredients-list th {
    text-align: left;
    padding: 0.2rem 0.5rem;
    border-bottom: 1px solid #e0d8c8;
    color: #4a3728;
}

.recipe-card .ingredients-list td {
    padding: 0.2rem 0.5rem;
}

.recipe-card .recipe-instructions {
    margin-top: 0.8rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.recipe-card .recipe-notes {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: #4a3728;
}

.recipe-card .recipe-source {
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px solid #e0d8c8;
    font-size: 0.78rem;
    color: #8b7d6b;
}

.recipe-card .source-link {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: #8b7d6b;
    text-decoration: none;
}

.recipe-card .source-link:hover {
    color: #4a3728;
}

footer {
    margin-top: 3rem;
    text-align: center;
    font-size: 0.8rem;
    color: #a89f91;
    border-top: 1px solid #e0d8c8;
    padding-top: 1rem;
}

.footer-credit {
    margin-top: 0.3rem;
    font-size: 0.75rem;
}

footer a {
    color: #8b7d6b;
    text-decoration: none;
}

footer a:hover {
    color: #4a3728;
}

@media (max-width: 600px) {
    .filters {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
    }
}
