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

html {
    scroll-behavior: smooth;
}
body{
    font-family: 'Quicksand', sans-serif;
    background-color: #Faf4ed;
    color: #4a2c24;
    padding: 0 20px 20px;
    min-height: 100vh;
}
.app{ 
    max-width: 1300px; 
    margin: 0 auto; 
}

.navbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 10px;
    border-bottom: 1px solid #f0e3d4;
    margin-bottom: 30px;
}
.logo {
    font-size: 1.6rem;
    font-weight: 600;
    color: #4d342b;
    cursor: pointer;
}
.logo i{ 
    color: #f66b82; 
    margin-right: 8px;
}
.nav-links{
    display: flex;
    flex-wrap: wrap;
    gap: 1.8rem;
    font-weight: 500;
    align-items: center;
}
.nav-links a {
    color: #4d342b;
    text-decoration: none;
    font-size: 1rem;
    transition: 0.2s;
    cursor: pointer;
}
.nav-links a:hover{ 
    color: #f66b82;
}
.nav-links .btn-outline {
    background: #f66b82;
    border: none;
    padding: 0.3rem 1.2rem;
    border-radius: 40px;
    font-weight: 600;
    color: #ffffff;
    transition: 0.2s;
    cursor: pointer;
}
.nav-links .btn-outline:hover{
    background: #ea4f6c;
    color: white;
}
.nav-links .fav-count {
    background: #f66b82;
    color: white;
    border-radius: 50%;
    padding: 0.1rem 0.6rem;
    font-size: 0.75rem;
    margin-left: -0.5rem;
}
.hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0 30px;
    gap: 2rem;
}
.hero-text{ 
    flex: 1 1 300px;
}
.hero-text h1{
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 700;
    line-height: 1.2;
    color: #3e2e28;
}
.hero-text p{
    font-size: 1.15rem;
    color: #6b4f44;
    margin: 0.8rem 0 1.8rem;
    max-width: 500px;
}
.btn-primary{
    background: #f66b82;
    border: none;
    padding: 0.8rem 2.8rem;
    border-radius: 60px;
    font-weight: 600;
    font-size: 1.1rem;
    color: white;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(246, 107, 130, 0.3);
    transition: 0.25s;
}
.btn-primary:hover {
    background: #ea4f6c;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(246, 107, 130, 0.4);
}
.hero-image {
    flex: 1 1 120px;
    text-align: center;
    padding: 1.8rem 1rem;
}
.hero-image img {
    max-width: 500px;
    width: 100%;
    height: auto;
}

.selector-section{ 
    margin: 2.5rem 0 1.8rem;
}
.selector-section h2 {
    font-weight: 500;
    font-size: 1.8rem;
    color: #4d342b;
    margin-bottom: 0.5rem;
}
.selector-section .sub {
    color: #6b4f44;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.ingredient-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}
.ingredient-card {
    background: white;
    width: 110px;
    height: 130px;
    flex-direction: column;
    border-radius: 24px;
    padding: 0.8rem 0.5rem;
    border: 2px solid #f0e3d4;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 500;
    color: #3e2e28;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    font-size: 0.85rem;
    text-align: center;
}
.ingredient-card img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
    background: #f8efe8;
    border: 2px solid #f0e3d4;
    flex-shrink: 0;
}
.ingredient-card.active {
    background: #fce4e8;
    border-color: #f66b82;
    box-shadow: 0 4px 12px rgba(246, 107, 130, 0.15);
}
.ingredient-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.search-wrapper{ 
    text-align: center; 
    margin: 2rem 0 2.5rem;
}
.btn-find {
    background: #f66b82;
    border: none;
    padding: 0.9rem 3.5rem;
    border-radius: 60px;
    font-weight: 600;
    font-size: 1.3rem;
    color: #ffffff;
    cursor: pointer;
    transition: 0.25s;
    box-shadow: 0 6px 20px rgba(246, 107, 130, 0.3);
    letter-spacing: 0.5px;
}
.btn-find:hover {
    background: #ea4f6c;
    transform: scale(1.02);
    box-shadow: 0 10px 28px rgba(246, 107, 130, 0.4);
}
.btn-find:active {
     transform: scale(0.95);
    }

.results-header{
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    margin: 2rem 0 1.2rem;
}
.results-header h3{ 
    font-size: 1.8rem;
    font-weight: 500;
    color: #3e2e28;
}
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
}

.load-more-wrapper {
    text-align: center;
    margin: 2rem 0;
}
.btn-load-more {
    background: transparent;
    border: 2px solid #f66b82;
    padding: 0.7rem 2.5rem;
    border-radius: 60px;
    font-weight: 600;
    font-size: 1rem;
    color: #f66b82;
    cursor: pointer;
    transition: 0.25s;
}
.btn-load-more:hover {
    background: #f66b82;
    color: white;
    transform: scale(1.02);
}

.recipe-card {
    background: white;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(94,60,50,0.06);
    border: 1px solid #f0e3d4;
    transition: 0.3s ease;
    display: flex;
    flex-direction: column;
}
.recipe-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(94,60,50,0.10);
}
.recipe-img {
    background: #eddccf;
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.recipe-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}
.recipe-img .match-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: #fce4e8;
    padding: 0.3rem 0.9rem;
    border-radius: 40px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #4d342b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 2;
}
.recipe-body{ 
    padding: 1.2rem 1.2rem 1rem;
    flex: 1;
}
.recipe-body h4{ 
    font-size: 1.3rem; 
    font-weight: 600; 
    margin-bottom: 0.2rem; 
}
.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 1.2rem;
    font-size: 0.85rem;
    color: #6b4f44;
    margin: 0.3rem 0 0.5rem;
}
.recipe-meta i{ 
    margin-right: 4px; 
    color: #f66b82; 
}
.missing-tag {
    background: #faf3ed;
    border-radius: 30px;
    padding: 0.3rem 1rem;
    font-size: 0.8rem;
    display: inline-block;
    color: #5e3c32;
    margin: 0.4rem 0 0.8rem;
}
.recipe-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}
.btn-view {
    background: #f66b82;
    border: none;
    padding: 0.4rem 1.4rem;
    border-radius: 40px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.85rem;
}
.btn-view:hover{ 
    background: #ea4f6c; 
    transform: scale(1.03); 
}
.heart {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #f9c3cc;
    cursor: pointer;
    transition: 0.2s;
}
.heart.liked{ 
    color: #f66b82; 
}
.heart:hover{ 
    transform: scale(1.2); 
}
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    background: #fce4e8;
    border-radius: 50px;
    margin: 1.5rem 0;
}
.empty-state i{ 
    font-size: 4rem; 
    color: #f66b82; 
    margin-bottom: 0.5rem; 
}
.empty-state h3{ 
    font-size: 1.6rem; 
    color: #4d342b; 
}
.empty-state p{ 
    color: #6b4f44; 
    max-width: 400px; 
    margin: 0.5rem auto 1.2rem; 
}
.btn-secondary {
    background: #f66b82;
    border: none;
    padding: 0.6rem 2.2rem;
    border-radius: 60px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: 0.2s;
}
.btn-secondary:hover{ 
    background: #ea4f6c; 
}

.favorites-page{ display: none; 
    padding: 1rem 0; 
}
.favorites-page.active{ 
    display: block;
}
.favorites-page h2{ 
    font-size: 2rem; 
    margin-bottom: 1rem; 
    color: #3e2e28; 
}
.favorites-page .empty-fav{ 
    text-align: center; 
    padding: 3rem;
    color: #6b4f44; 
}
.favorites-page .empty-fav i{ 
    font-size: 4rem; 
    color:#f9c3cc; 
    margin-bottom: 1rem; 
}
.main-content.hidden{ 
    display: none; 
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(60, 40, 30, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s ease;
}
.modal-overlay.open{ 
    opacity: 1; 
    pointer-events: auto; 
}
.modal-box {
    background: white;
    max-width: 650px;
    width: 100%;
    border-radius: 28px;
    padding: 2rem;
    box-shadow: 0 40px 80px rgba(0,0,0,0.2);
    transform: scale(0.95);
    transition: 0.25s ease;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-overlay.open .modal-box{ 
    transform: scale(1); 
}
.modal-box .close-modal {
    float: right;
    background: none;
    border: none;
    font-size: 2rem;
    color: #f66b82;
    cursor: pointer;
    transition: 0.2s;
}
.modal-box .close-modal:hover{ 
    transform: rotate(90deg); 
}
.modal-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 16px;
    margin: 0.5rem 0 1rem;
    background: #eddccf;
}
.modal-box h2 { 
    font-size: 2rem; 
    margin-bottom: 0.2rem; 
    color: #3e2e28; 
}
.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.95rem;
    color: #5e3c32;
    margin: 0.25rem 0 0.8rem;
}
.modal-box .servings {
    background: #fce4e8;
    padding: 0.2rem 1rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
}
.modal-box ul, .modal-box ol{ 
    padding-left: 1.2rem; 
    margin: 0.5rem 0 1rem; 
}
.modal-box li { 
    margin-bottom: 0.5rem; 
    line-height: 1.6; 
}
.modal-box .instructions-list li {
    margin-bottom: 0.8rem;
    padding-left: 0.5rem;
    border-left: 3px solid #f66b82;
    padding-left: 0.8rem;
}
.modal-tip {
    background: #fce4e8;
    padding: 0.8rem 1.2rem;
    border-radius: 20px;
    margin: 1rem 0 0.2rem;
}

.footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #f0e3d4;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}
.footer-col { 
    min-width: 140px; 
}
.footer-col h4 { 
    font-weight: 600; 
    color: #3e2e28; 
    margin-bottom: 0.5rem; 
}
.footer-col a, .footer-col p {
    display: block;
    color: #5e3c32;
    text-decoration: none;
    margin: 0.3rem 0;
    font-weight: 400;
    transition: 0.2s;
    cursor: pointer;
}
.footer-col a:hover{ 
    color: #f66b82; 
}
.footer-bottom {
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    color: #6b4f44;
    padding-top: 1.2rem;
    border-top: 1px solid #f0e3d4;
    margin-top: 1rem;
}

@media (max-width: 700px) {
    .navbar { 
        flex-direction: column; 
        gap: 0.8rem; 
        align-items: flex-start; 
    }
    .hero { 
        flex-direction: column-reverse; 
        text-align: center; 
    }
    .hero-text p { 
        margin-left: auto; 
        margin-right: auto; 
    }
    .footer { 
        flex-direction: column; 
        align-items: center; 
        text-align: center; 
    }
}
@media (max-width: 480px) {
    .ingredient-card { 
        width: 85px; 
        height: 105px; 
        padding: 0.5rem 0.3rem; 
        font-size: 0.75rem; 
    }
    .ingredient-card img { 
        width: 48px; 
        height: 48px; 
    }
    .modal-box { 
        padding: 1.5rem; 
    }
    .modal-image { 
        height: 150px; 
    }
}
.fade-in { 
    animation: fade 0.4s ease; 
}
@keyframes fade { 
    0% { 
        opacity: 0; 
        transform: translateY(6px); 
    } 
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    } 
}
.hidden { 
    display: none !important; 
}
