* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f5f7fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #2c3e50;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

.container {
    width: calc(100% - 2rem);
    max-width: 800px;
    margin: 1rem auto;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

input[type="search"] {
    display: block; /* Ensure the input behaves like a block element */
    width: 100%;
    max-width: 400px;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    font-size: 1rem; /* Ensure readable text */
    border: 2px solid #e0e6ed; /* Add a standard border */
    border-radius: 50px; /* Optional: rounded corners */
    background: #ffffff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

input[type="search"]:focus {
    border-color: #2E8B57;
    box-shadow: 0 4px 20px rgba(46, 139, 87, 0.15);
    transform: translateY(-2px);
}

input[type="search"]::-webkit-search-cancel-button {
    display: inline; /* Ensure the clear button remains visible */
}

.category-menu, .categories {
    display: flex;
    flex-wrap: wrap; /* Allows items to wrap onto multiple lines */
    gap: 10px; /* Space between pills */
    justify-content: center; /* Centers buttons within each row */
}

.category-menu {
    margin-bottom: 20px;
}

.categories {
    margin: 10px 10px 20px;
}

.category-pill {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    background: transparent;
    color: #2E8B57;
    border: 1px solid #2E8B57;
    border-radius: 20px; /* Round the corners to create pill shape */
    font-size: 0.75rem; /* Adjust font size */
    font-weight: 500;
    text-align: center; /* Center text within the pill */
}

button {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #2c3e50;
    border: 2px solid #2E8B57;
    border-radius: 25px;
    cursor: pointer;
    background: #ffffff;
    transition: all 0.3s ease; /* Smooth hover effect */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

button:hover {
    transform: translateY(-2px); /* Moves the button up slightly */
    box-shadow: 0 8px 15px rgba(46, 139, 87, 0.2); /* Increases shadow on hover */
    background: #2E8B57;
    color: white;
}

.primary-button {
    background: #f8f9fa;
}

.primary-button.selected {
    background: #2E8B57;
    color: white;
    border-color: #2E8B57;
    box-shadow: 0 4px 15px rgba(46, 139, 87, 0.3);
}

.secondary-button {
    background: rgba(255, 255, 255, 0.9);
    border-color: #6c757d;
}

.recipe-container {
    display: grid; /* Use CSS Grid for layout */
    grid-template-columns: repeat(3, 1fr); /* Always have 3 equal columns */
    gap: 2rem; /* Space between cards */
    width: 100%;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .recipe-container {
        grid-template-columns: repeat(2, 1fr); /* Switch to 2 cards per row */
    }
}

@media (max-width: 480px) {
    .recipe-container {
        grid-template-columns: 1fr; /* Switch to 1 card per row */
    }
}

h1 {
    text-align: center;
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #2E8B57;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

h1.title {
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}