/* ===== HERO SZEKCIÓ ===== */
.hero-section {
    background-image: url('../../images/hero_background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 64px 0;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    overflow: visible;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 160px;
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.12) 0%,
        rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    z-index: 5;
}

.hero-section::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 260px;
    background: linear-gradient(to bottom,
        rgba(250, 246, 240, 0) 0%,
        rgba(250, 246, 240, 0.1) 35%,
        rgba(250, 246, 240, 0.3) 55%,
        rgba(250, 246, 240, 0.6) 75%,
        rgba(250, 246, 240, 0.85) 90%,
        #FAF6F0 100%);
    pointer-events: none;
    z-index: 5;
}

.hero-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 80px;
    position: relative;
    z-index: 6;
}

.hero-text {
    position: static;
    flex: 3;
    max-width: none;
    padding-left: 1rem;
}

.hero-title {
    font-size: 2.5rem;
    color: var(--color-dark-brown);
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-highlight {
    color: var(--color-hero-highlight);
}

/* Ez a sortörés csak mobilon aktív, hogy a cím pontosan 3 sorra törjön */
.mobile-break {
    display: none;
}

.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 30px;
}

.hero-assistant-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    color: var(--color-cta);
    font-weight: 700;
    background: rgba(74, 124, 47, 0.4);
    padding: 0.15em 0.6em;
    border-radius: 999px;
}

.hero-subtitle-icon {
    width: 1.1em;
    height: 1.1em;
    color: var(--color-cta-hover);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-dark-brown);
    padding: 12px 28px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    border: 2px solid var(--color-dark-brown);
    transition: all 0.3s;
}

.btn-secondary:hover {
    background-color: var(--color-dark-brown);
    color: var(--color-white);
}

.hero-image {
    flex: 2.5;
    background: transparent;
    height: auto;
    overflow: visible;
    margin-left: auto;
}

.hero-image img {
    width: 100%;
    position: relative;
    top: -25px;
    z-index: 10;
    filter: drop-shadow(0 30px 60px var(--color-shadow-dark));
    margin-top: 0px;
    margin-bottom: -180px;
}

/* ===== SZEKCIÓK ===== */
.latest-section,
.recipes-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 45px 20px 60px 20px;
    position: relative;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-align: center;
    color: var(--color-heading);
    border-bottom: 3px solid var(--color-border-dark);
    display: inline-block;
    padding-bottom: 8px;
}

/* ===== MODERN KERESŐ SÁV - doboz (a benne lévő mezők/gombok osztályai az app.css-ben vannak,
   mert a fejléc görgetős keresője is ugyanazokat használja) ===== */
.search-bar {
    max-width: 720px;
    margin: 3rem 0 2rem;
    padding: 1rem;
    background-color: var(--color-white);
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.08), 0 10px 20px rgba(0,0,0,0.12);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* A kártyák feletti kereső (recipes-section) vékonyabb, mint a fejléc/hero-beli változat */
.recipes-section .search-bar {
    padding: 0.5rem;
}

.recipes-section .search-bar .search-input-group,
.recipes-section .search-bar .btn-search,
.recipes-section .search-bar .btn-filters,
.recipes-section .search-bar .btn-sort {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.recipes-section .search-bar .btn-search,
.mobile-search-sticky .search-bar .btn-search {
    background: var(--color-primary);
}

.recipes-section .search-bar .btn-search:hover,
.mobile-search-sticky .search-bar .btn-search:hover {
    background: var(--color-primary-hover);
}

/* Amikor a fejléc görgetős keresője aktív, a főoldal saját alsó keresősávja elhalványul,
   de a helye megmarad (visibility, nem display), hogy a kártyák ne csússzanak feljebb */
header.scrolled ~ main .recipes-section .search-bar {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ===== SZŰRŐ CSOPORTOK (Szűrők modal - a modal-keret alapstílusa app.css-ben van,
   mert a Profil oldal is használja a fiók törlése megerősítéséhez) ===== */
.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group h4 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary-soft);
    padding-bottom: 0.5rem;
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    cursor: pointer;
}

.checkbox-label:hover,
.radio-label:hover {
    background-color: var(--color-bg-hover);
}

.checkbox-label input,
.radio-label input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ===== GOMBOK A MODALBAN / a modal alatti "Összes recept" link ===== */
.btn-apply {
    padding: 0.6rem 1.25rem;
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
}

.btn-apply:hover {
    background-color: var(--color-primary-hover);
}

.btn-reset {
    text-decoration: none;
    color: var(--color-text-light);
    padding: 8px 12px;
}

.btn-reset:hover {
    color: var(--color-text);
    text-decoration: underline;
}

.modal-footer .btn-reset {
    padding: 0.6rem 1.25rem;
    background-color: var(--color-bg-hover);
    color: var(--color-text);
    border: none;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
}

.modal-footer .btn-reset:hover {
    background-color: var(--color-border);
}

/* ===== LOADING SPINNER ===== */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== LOAD MORE GOMB ===== */
.btn-load-more {
    display: block;
    margin: 2rem auto;
    padding: 0.8rem 2rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--color-white);
    color: var(--color-primary);
    border: 2px solid var(--color-search-border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.btn-load-more:hover {
    background: var(--color-search-bg);
    transform: translateY(-2px);
}

.btn-load-more:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* ===== MOBIL-SPECIFIKUS - DESKTOPON REJTVE ===== */
@media (min-width: 769px) {
    .mobile-search-sticky {
        display: none;
    }
}

/* ===== MOBIL NÉZET - főoldal ===== */
@media (max-width: 768px) {
    .hero-image {
        display: none !important;
    }

    /* Kereső a hero-ban, közvetlenül az alcím alatt, a szövegoszlop szélességéhez igazítva */
    .mobile-search-sticky {
        display: block;
        width: 100%;
        margin-top: 40px;
    }

    .mobile-search-sticky .search-bar {
        max-width: none;
        width: 100%;
        margin: 0;
        background-color: var(--color-white);
        border-radius: 4px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .mobile-search-sticky .search-input-group {
        flex: 2;
        min-width: 0;
        padding: 0.6rem 0.9rem;
    }

    .mobile-search-sticky .search-input {
        font-size: 1rem;
    }

    .mobile-search-sticky .btn-search,
    .mobile-search-sticky .btn-filters,
    .mobile-search-sticky .btn-sort {
        flex: 0 0 auto;
        padding: 0.6rem 0.5rem;
        font-size: 0;
        justify-content: center;
    }

    .mobile-search-sticky .btn-search svg,
    .mobile-search-sticky .btn-filters svg,
    .mobile-search-sticky .btn-sort svg {
        margin-right: 0;
        width: 1.1rem;
        height: 1.1rem;
    }

    /* Hero szekció - mobilon a 100vw helyett a szülő (main) paddingjéből "kitörős"
       negatív margós megoldás, mert a 100vw mobil nézetben/emulációban szélesebb
       tud lenni a ténylegesen látható képernyőnél, és ez okozta a kilógást */
    .hero-section {
        width: auto;
        margin-left: -1rem;
        margin-right: -1rem;
        padding: 2rem 1rem 0;
        min-height: 62vh;
        display: flex;
        align-items: stretch;
        flex-direction: column;
        justify-content: flex-start;
        background-size: 100% 100%;
        background-position: center center;
    }
    .hero-section::before {
        height: 90px;
    }

    .hero-section::after {
        height: 160px;
        background: linear-gradient(to bottom,
            rgba(250, 246, 240, 0) 0%,
            rgba(250, 246, 240, 0.1) 35%,
            rgba(250, 246, 240, 0.3) 55%,
            rgba(250, 246, 240, 0.6) 75%,
            rgba(250, 246, 240, 0.85) 90%,
            #FAF6F0 100%);
    }

    .hero-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
        padding: 0 1rem;
        justify-content: flex-start;
        order: 1;
    }

    .hero-text {
        flex: 0 0 auto;
        text-align: left;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .mobile-break {
        display: inline;
    }

    /* Alsó kereső sáv elrejtése mobilon (a hero-ban lévő sticky verzió jelenik meg helyette) */
    .recipes-section .search-bar {
        display: none;
    }

    .recipes-section {
        padding-top: 20px;
    }
}
