/* -------------------------------------- */
/* 1. Global Setup and Typography */
/* -------------------------------------- */
:root {
    /* Define a clean, modern color palette */
    --color-primary: #1e3a8a;    /* Deep Navy Blue */
    --color-accent: #f97316;     /* Vibrant Orange (for action) */
    --color-text: #374151;       /* Dark Grey Text */
    --color-light: #ffffff;      /* Pure White */
    --color-background: #f3f4f6; /* Light Grey Background */
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: linear-gradient(135deg, var(--color-primary), #10427c);
    color: var(--color-light);
    padding: 40px 0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

h1 {
    font-family: 'Playfair Display', serif;
    margin: 0 0 8px 0;
    font-size: 2.8em;
    font-weight: 700;
}

main {
    flex-grow: 1;
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* -------------------------------------- */
/* 2. Search Section Styling */
/* -------------------------------------- */
.search-section {
    display: flex;
    gap: 15px;
    margin-bottom: 50px;
}

#ingredients-input {
    flex-grow: 1;
    padding: 16px 20px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1.1em;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: var(--color-light);
}

#ingredients-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.2);
    outline: none;
}

#search-button {
    padding: 16px 35px;
    background-color: var(--color-accent);
    color: var(--color-light);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(249, 115, 22, 0.4);
}

#search-button:hover {
    background-color: #e3600f;
    box-shadow: 0 6px 15px rgba(249, 115, 22, 0.5);
}

#search-button:active {
    transform: scale(0.98);
}

/* -------------------------------------- */
/* 3. Recipe Display (Elevated Card Design) */
/* -------------------------------------- */
.recipe-display {
    background-color: var(--color-light);
    padding: 50px;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    min-height: 300px;
    border: 1px solid #e5e7eb;
}

.initial-message, .error-message {
    text-align: center;
    color: #9ca3af;
    font-size: 1.4em;
    padding: 80px 0;
}

.recipe-card {
    display: flex;
    flex-direction: column;
}

.recipe-title {
    color: var(--color-primary);
    font-family: 'Playfair Display', serif;
    margin-top: 0;
    font-size: 3em;
    font-weight: 700;
    padding-bottom: 15px;
    margin-bottom: 30px;
    position: relative;
}

.recipe-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--color-accent);
    position: absolute;
    bottom: 0;
    left: 0;
    border-radius: 2px;
}

.recipe-meta {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    font-size: 1em;
    font-weight: 600;
    color: var(--color-primary);
}

.recipe-meta span {
    background-color: #eff6ff;
    padding: 10px 18px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recipe-content {
    display: flex;
    gap: 60px;
    flex-wrap: wrap;
}

.recipe-image-container {
    flex: 1 1 400px;
}

.recipe-image {
    width: 100%;
    max-width: 500px;
    height: 350px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border: 3px solid var(--color-light);
}

.recipe-details {
    flex: 2 1 600px;
}

.recipe-details h3 {
    color: var(--color-accent);
    padding-bottom: 8px;
    margin-top: 25px;
    font-weight: 700;
    font-size: 1.8em;
    border-bottom: 1px solid #eee;
}

.recipe-details p {
    line-height: 1.7;
    margin-bottom: 20px;
}

.ingredient-list {
    padding-left: 20px;
}

.ingredient-list li {
    margin-bottom: 10px;
    line-height: 1.5;
    list-style-type: '• ';
}

/* -------------------------------------- */
/* 4. Footer and Responsiveness */
/* -------------------------------------- */
footer {
    text-align: center;
    padding: 20px;
    background-color: var(--color-text);
    color: #e5e7eb;
    margin-top: 50px;
    font-size: 0.9em;
}

@media (max-width: 1024px) {
    .recipe-content {
        gap: 30px;
    }
    .recipe-image {
        height: 300px;
    }
}

@media (max-width: 800px) {
    .recipe-content {
        flex-direction: column;
    }
    .search-section {
        flex-direction: column;
    }
    #search-button {
        width: 100%;
    }
    .recipe-display {
        padding: 30px;
    }
    .recipe-image-container {
        flex: auto;
    }
}