
:root {
    --primary-color: #2c5530;
    --secondary-color: #f5f0e8;
    --accent-color: #d4a574;
    --text-color: #333;
    --light-text: #666;
}

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

body {
    font-family: 'Georgia', serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-style: italic;
    opacity: 0.9;
}

/* Search bar */
.search-container {
    max-width: 600px;
    margin: 1rem auto 0;
    padding: 0 1rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    transition: all 0.3s;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.3);
    border-color: var(--accent-color);
}

nav {
    background-color: #1e3d22;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    flex: 1;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: var(--accent-color);
}

/* Shopping list button */
.shopping-list-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    white-space: nowrap;
}

.shopping-list-btn:hover {
    background-color: #c08f5a;
    transform: scale(1.05);
}

.shopping-list-btn .badge {
    background-color: rgba(255, 255, 255, 0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.home-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-decoration: none;
}

.home-link:hover {
    text-decoration: underline;
}

/* Category sections on home page */
.category-section {
    margin-bottom: 3rem;
}

.category-section h2 {
    color: var(--primary-color);
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.recipe-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

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

.recipe-card.hidden {
    display: none;
}

.recipe-card a {
    text-decoration: none;
    color: inherit;
}

/* Recipe card checkbox */
.recipe-checkbox-wrapper {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 10;
}

.recipe-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.recipe-checkbox:hover {
    transform: scale(1.1);
}

.recipe-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.recipe-card .no-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.recipe-card-content {
    padding: 1rem;
}

.recipe-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.recipe-card .servings {
    color: var(--light-text);
    font-size: 0.9rem;
}

/* Individual recipe page */
.recipe-page {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.1);
}

.recipe-hero {
    position: relative;
}

.recipe-hero img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

.recipe-hero .no-image {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 5rem;
}

.recipe-content {
    padding: 2rem;
}

.recipe-content h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.recipe-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.recipe-meta span {
    color: var(--light-text);
}

.recipe-section {
    margin-bottom: 2rem;
}

.recipe-section h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
}

.recipe-section h3 {
    color: var(--accent-color);
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem 0;
}

.ingredients-list {
    list-style: none;
}

.ingredients-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    border-bottom: 1px dashed #eee;
}

.ingredients-list li::before {
    content: "•";
    color: var(--accent-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

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

.instructions-list li {
    padding: 1rem 0;
    padding-left: 3rem;
    position: relative;
    border-bottom: 1px solid #eee;
}

.instructions-list li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    width: 2rem;
    height: 2rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.tips-box {
    background-color: #fff9e6;
    border-left: 4px solid var(--accent-color);
    padding: 1rem;
    margin-top: 1rem;
}

.tips-box h3 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
}

/* Shopping list modal */
.shopping-list-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.shopping-list-modal.active {
    display: flex;
}

.shopping-list-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.shopping-list-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shopping-list-header h2 {
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    opacity: 0.8;
}

.shopping-list-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.selected-recipes {
    margin-bottom: 2rem;
}

.selected-recipes h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.selected-recipe-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.remove-recipe-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.remove-recipe-btn:hover {
    background-color: #c0392b;
}

.shopping-list-ingredients h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--accent-color);
}

.ingredient-group {
    margin-bottom: 1.5rem;
}

.ingredient-group h4 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.ingredient-item {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    border-bottom: 1px dashed #eee;
}

.ingredient-item::before {
    content: "•";
    color: var(--accent-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.empty-shopping-list {
    text-align: center;
    padding: 2rem;
    color: var(--light-text);
}

.shopping-list-actions {
    padding: 1rem 1.5rem;
    border-top: 2px solid #eee;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1e3d22;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    nav {
        flex-direction: column;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .shopping-list-btn {
        width: 100%;
        justify-content: center;
    }

    .recipe-content h1 {
        font-size: 1.8rem;
    }

    .recipe-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .shopping-list-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
