:root {
    --primary-color: #408ee7;
    --primary-hover: #2e6ead;
    --secondary-color: #f0a62d;
    --secondary-hover: #cf902c;
    --background-color: #ffffff;
    --card-background: #ffffff;
    --text-color: #383667;
    --border-color: #e0e0e0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.067);
}
body {
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
}
.container {
    max-width: 900px;
    margin: 0 auto;
}
header {
    text-align: center;
    margin-bottom: 30px;
}
header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}
header p {
    font-size: 1.1rem;
    color: #4f4e4e;
}
.filter-container {
    display: flex;
    gap: 10px;
    flex-grow: 1;
}
.filter-container select {
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #ccc9c9;
    border-radius: 8px;
    background-color: white;
    flex-grow: 1;
}
#search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}
#search-input {
    flex-grow: 1;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #ffffff;
    border-radius: 8px;
}
#search-button {
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    background-color: #007bff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}
#search-button:hover {
    background-color: #0056b3;
}
#search-button:disabled {
    background-color: #5f5555;
    cursor: not-allowed;
}
.hidden {
    display: none;
}
#loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40%;
    height: 40px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% {transform: rotate(0deg);}
    100% {transform: rotate(360deg);}
}
#error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}
#results-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.recipe-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.2s;
}
.recipe-card:hover {
    transform: scale(1.02);
}
.recipe-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.recipe-content {
    padding: 20px;
}
.recipe-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 10px;
}
.recipe-summary {
    font-size: 0.9rem;
    color: #4c4b4b;
    margin-bottom: 15px;
    line-height: 1.5;
}
.recipe-link {
    display: inline-block;
    background-color: #e6f2ff;
    color: #0056b3;
    padding: 8px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}
.recipe-link:hover {
    background-color: #cce4ff;
}
#load-more-button {
    display: block;
    width: 200px;
    margin: 30px auto 0;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    background-color: #28a745;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}
#load-more-button:hover {
    background-color: #218838;
}
#load-more-button:disabled {
    background-color: #b1aaaa;
    cursor: not-allowed;
}
.view-details-button, .save-favourite-button{
    width: 100%;
    padding: 10px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.view-details-button:hover {
    background-color: #0056b3;
}
#recipe-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
#recipe-modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}
#modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.67);
    z-index: 101;
}
.modal-content {
    background-color: var(--background-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 102;
}
#modal-close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.67rem;
    font-weight: bold;
    color: #867979;
    background: none;
    border: none;
    cursor: pointer;
}
#modal-close-button:hover {
    color: #3d3b3b;
}
#modal-data-container img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
}
#modal-data-container h2 {
    font-size: 1.67rem;
    margin-bottom: 15px;
}
#modal-data-container h3 {
    font-size: 1.41rem;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 2px solid #ffffff;
    padding-bottom: 5px;
}
#modal-data-container ul,
#modal-data-container ol {
    margin-left: 20px;
}
#modal-data-container li {
    margin-bottom: 8px;
    line-height: 1.67;
}
#modal-loader {
    margin: 41px auto;
}
#my-favourites-button {
    background-color: var(--secondary-color);
}
#my-favourites-button:hover {
    background-color: var(--secondary-hover);
}
.save-favourite-button {
    background-color: #eae6e6;
    color: var(--text-color);
    border: none;
}
.save-favourite-button:hover {
    background-color: #413e3e;
}
.save-favourite-button.saved {
    background-color: var(--secondary-color);
    color: white;
}
.save-favourite-button.saved:hover {
    background-color: var(--secondary-hover);
}
#random-recipe-button {
    background-color: #49a749;
}
#random-recipe-button:hover {
    background-color: #4cae4c;
}
