/* --- Global Styles & Variables --- */
:root {
    --bg-color: #F8F9FA;
    --text-color: #333333;
    --primary-color: #2E7D32;
    /* Accessible Green */
    --card-bg: #FFFFFF;
    --heading-font: 'Montserrat', sans-serif;
    --body-font: 'Roboto', sans-serif;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: var(--body-font);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Header & Navigation --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
}

.logo {
    font-family: var(--heading-font);
    font-size: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
}

.logo img {
    width: 48px;
    height: 48px;
}

#hamburger-menu {
    display: none;
    /* Hidden by default, shown on mobile */
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
}

#nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

#nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding-bottom: 5px;
}

#nav-links a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

/* --- Main Content --- */
.hero {
    text-align: center;
    padding: 4rem 1rem;
}

.hero h1 {
    font-family: var(--heading-font);
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.search-form {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.search-form input {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.search-form button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: var(--card-bg);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

.info-section {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.info-section h2 {
    font-family: var(--heading-font);
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.steps-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.step {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.step h3 {
    font-family: var(--heading-font);
    margin-bottom: 0.5rem;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem 1rem;
    background-color: #333;
    color: #eee;
    font-size: 0.9rem;
}

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

footer a:hover {
    text-decoration: underline;
}

.results-section {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.results-section h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-family: var(--heading-font);
    color: var(--primary-color);
}

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

.recipe-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.recipe-card:hover {
    transform: translateY(-5px);
}

.recipe-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    /* Added for lazy loading visual effect */
    background-color: #eee;
}

.card-content {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    font-family: var(--heading-font);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    flex-grow: 1;
    /* Pushes button to bottom */
}

.card-content p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.status-message {
    font-size: 1.2rem;
    text-align: center;
    grid-column: 1 / -1;
    /* Span full grid width */
    padding: 2rem;
}

/* --- Modal Dialog Styles --- */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2.5rem;
    font-weight: bold;
    color: #aaa;
    background: none;
    border: none;
    cursor: pointer;
}

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

#modal-body h2 {
    font-family: var(--heading-font);
    color: var(--primary-color);
    margin-bottom: 1rem;
}

#modal-body img {
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#modal-body h3 {
    font-family: var(--heading-font);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.25rem;
}

#modal-body ul {
    list-style-position: inside;
    padding-left: 10px;
}

#modal-body p {
    white-space: pre-wrap;
    /* Preserves line breaks in instructions */
}