:root {
    --main-yellow: #FFD100;
    --main-black: #222222;
    --accent-grey: #F0F0F0;
    --accent-white: #FFFFFF;
    --background-cream: #FFFBF0;
    --header-font: 'Bebas Neue', sans-serif;
    --body-font: 'Montserrat', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--body-font);
}

body {
    max-width: 1000px;
    margin: 0 auto;
    background-color: var(--background-cream);
    color: var(--main-black);
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60" opacity="0.03"><path d="M30,5 C35,15 45,20 55,20 C45,25 40,35 40,45 C35,40 25,40 15,45 C20,35 15,25 5,20 C15,15 25,15 30,5 Z M32,25 C35,30 40,32 45,32 C40,34 38,40 38,44 C35,42 30,42 25,44 C27,39 25,34 20,32 C25,30 30,30 32,25 Z" fill="%23FFD100"/></svg>'), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="20" viewBox="0 0 100 20" opacity="0.05"><path d="M0,10 C30,15 70,5 100,10 C70,15 30,15 0,10 Z" fill="%23222222"/></svg>');
    background-size: 60px 60px, 100px 20px;
    background-position: 0 0, 0 0;
    z-index: -1;
}

header {
    background-color: var(--main-yellow);
    padding: 20px;
    position: relative;
    overflow: hidden;
    border-bottom: 4px solid var(--main-black);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
}

.site-logo {
    width: 45px;
    height: 45px;
    margin-right: 15px;
    border: 2px solid var(--main-black);
    border-radius: 50%;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
    object-fit: cover;
}

.header-text {
    text-align: left;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="3" cy="3" r="1.5" fill="%23222222" opacity="0.2"/></svg>');
    background-size: 20px 20px;
    opacity: 0.5;
    z-index: 0;
}

h1 {
    font-family: var(--header-font);
    font-size: 4.5rem;
    letter-spacing: 2px;
    color: var(--main-black);
    margin: 0;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.1);
}

header p {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 5px;
    position: relative;
    z-index: 1;
}

.search-container {
    padding: 20px;
    background-color: var(--accent-white);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="3" cy="3" r="1" fill="%23FFD100" opacity="0.3"/></svg>');
    background-size: 20px 20px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 4px solid var(--main-black);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#search-box {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 3px solid var(--main-black);
    border-radius: 50px;
    background-color: var(--accent-white);
    transition: all 0.3s ease;
    box-shadow: 4px 4px 0 var(--main-black);
}

#search-box:focus {
    outline: none;
    box-shadow: 8px 8px 0 var(--main-black);
    transform: translate(-4px, -4px);
}

.pasta-list {
    list-style-type: none;
    padding: 20px;
}

.pasta-item {
    background-color: var(--accent-white);
    border-radius: 12px;
    border: 3px solid var(--main-black);
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 6px 6px 0 var(--main-black);
    display: flex;
    align-items: flex-start;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    backdrop-filter: blur(2px);
}

/* Animation only on initial page load */
.pasta-item.initial-load {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.pasta-item:hover {
    transform: translate(-4px, -4px);
    box-shadow: 10px 10px 0 var(--main-black);
}

.pasta-image-wrapper {
    position: relative;
    width: 120px;
    min-width: 120px;
    height: 120px;
    margin-right: 20px;
    border: 3px solid var(--main-black);
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--main-yellow);
    flex-shrink: 0; /* Prevent the image wrapper from shrinking */
}

.pasta-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.pasta-item:hover .pasta-image {
    transform: scale(1.1);
}

.pasta-content {
    flex: 1;
}

.pasta-name {
    font-family: var(--header-font);
    color: var(--main-black);
    font-size: 2rem;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.pasta-name a {
    color: inherit;
    text-decoration: none;
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
}

.pasta-name a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--main-yellow);
    transition: width 0.3s ease;
}

.pasta-name a:hover::after {
    width: 100%;
}

.pasta-description {
    line-height: 1.7;
    font-size: 1rem;
}

.no-results {
    text-align: center;
    padding: 50px 20px;
    font-style: italic;
    color: var(--main-black);
    font-size: 1.2rem;
    display: none;
    border: 3px dashed var(--main-black);
    border-radius: 12px;
    margin: 20px;
    background-color: var(--accent-grey);
}

.results-counter {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--main-black);
    font-weight: 600;
    text-align: right;
    padding-right: 10px;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding: 30px 20px;
    background-color: var(--main-yellow);
    color: var(--main-black);
    font-size: 1rem;
    border-top: 4px solid var(--main-black);
    position: relative;
}

footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="3" cy="3" r="1.5" fill="%23222222" opacity="0.2"/></svg>');
    background-size: 20px 20px;
    opacity: 0.5;
    z-index: 0;
}

footer a {
    color: var(--main-black);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

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

footer p {
    position: relative;
    z-index: 1;
    margin: 5px 0;
}

@media (max-width: 768px) {
    h1 {
        font-size: 3.5rem;
    }
    
    .site-logo {
        width: 35px;
        height: 35px;
    }
    
    .pasta-item {
        flex-direction: column;
    }
    
    .pasta-image-wrapper {
        width: 100%;
        height: 180px;
        margin-right: 0;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2.5rem;
    }
    
    .site-logo {
        width: 30px;
        height: 30px;
        margin-right: 10px;
    }
    
    header p {
        font-size: 0.9rem;
    }
    
    .header-content {
        flex-direction: row; /* Keep items in a row */
        justify-content: flex-start;
    }
    
    .header-text {
        text-align: left;
    }
}