/* Search Bar Styles */
.hero-search-container {
    margin-top: 30px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 600px;
    position: relative;
    z-index: 100;
}

.hero-search-bar {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 50px;
    padding: 10px 25px;
    width: 100%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    transition: none;
}

.hero-search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 1.1rem;
    color: #2d3436;
    padding: 5px;
    text-align: right;
    font-family: inherit;
}

.hero-search-bar input::placeholder {
    color: rgba(45, 52, 54, 0.5);
}

.hero-search-bar button {
    background: none;
    color: var(--accent-color);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s;
    padding: 5px;
}

.hero-search-bar button:hover {
    transform: scale(1.1);
}

/* Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 2000;
    border: 1px solid var(--border-color);
}

/* Make hero search dropdown push content down */
.hero-search-container .search-results-dropdown {
    position: relative;
    top: auto;
    margin-top: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.search-results-dropdown.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    gap: 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f8f9fa;
}

.search-result-image {
    width: 50px;
    height: 65px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    text-align: right;
}

.search-result-title {
    font-weight: 700;
    color: #2d3436;
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.search-result-author {
    font-size: 0.85rem;
    color: #636e72;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: #636e72;
    font-size: 0.95rem;
}

/* Hide original search bar in header initially */
.header .search-bar {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    position: relative;
    /* Ensure dropdown is positioned relative to this */
}

/* Show search bar when header is scrolled */
.header.scrolled .search-bar {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Header Search Dropdown Specifics */
.header .search-results-dropdown {
    top: calc(100% + 15px);
    width: 300px;
    right: 0;
    left: auto;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .hero-search-bar {
        padding: 8px 15px;
    }

    .hero-search-bar input {
        font-size: 1rem;
    }

    .search-results-dropdown {
        max-height: 300px;
    }

    .search-result-item {
        padding: 10px 15px;
    }

    .search-result-image {
        width: 40px;
        height: 55px;
    }

    /* Mobile adjustments for header search dropdown */
    .header .search-results-dropdown {
        position: fixed;
        top: 70px;
        left: 10px;
        right: 10px;
        position: relative;
        z-index: 100;
    }

    .hero-search-bar {
        display: flex;
        align-items: center;
        background: #ffffff;
        border-radius: 50px;
        padding: 10px 25px;
        width: 100%;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
        border: 1px solid var(--border-color);
        transition: none;
    }

    .hero-search-bar input {
        flex: 1;
        border: none;
        background: transparent;
        outline: none;
        font-size: 1.1rem;
        color: #2d3436;
        padding: 5px;
        text-align: right;
        font-family: inherit;
    }

    .hero-search-bar input::placeholder {
        color: rgba(45, 52, 54, 0.5);
    }

    .hero-search-bar button {
        background: none;
        color: var(--accent-color);
        border: none;
        font-size: 1.2rem;
        cursor: pointer;
        transition: transform 0.3s;
        padding: 5px;
    }

    .hero-search-bar button:hover {
        transform: scale(1.1);
    }

    /* Search Results Dropdown */
    .search-results-dropdown {
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        right: 0;
        background: #ffffff;
        border-radius: 15px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        max-height: 400px;
        overflow-y: auto;
        display: none;
        z-index: 2000;
        border: 1px solid var(--border-color);
    }

    /* Make hero search dropdown push content down */
    .hero-search-container .search-results-dropdown {
        position: relative;
        top: auto;
        margin-top: 10px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    }

    .search-results-dropdown.show {
        display: block;
        animation: slideDown 0.3s ease;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .search-result-item {
        display: flex;
        align-items: center;
        padding: 12px 20px;
        gap: 15px;
        cursor: pointer;
        transition: background 0.2s;
        border-bottom: 1px solid #f0f0f0;
    }

    .search-result-item:last-child {
        border-bottom: none;
    }

    .search-result-item:hover {
        background: #f8f9fa;
    }

    .search-result-image {
        width: 50px;
        height: 65px;
        object-fit: cover;
        border-radius: 5px;
        flex-shrink: 0;
    }

    .search-result-info {
        flex: 1;
        text-align: right;
    }

    .search-result-title {
        font-weight: 700;
        color: #2d3436;
        font-size: 0.95rem;
        margin-bottom: 3px;
    }

    .search-result-author {
        font-size: 0.85rem;
        color: #636e72;
    }

    .search-no-results {
        padding: 20px;
        text-align: center;
        color: #636e72;
        font-size: 0.95rem;
    }

    /* Hide original search bar in header initially */
    .header .search-bar {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        pointer-events: none;
        position: relative;
        /* Ensure dropdown is positioned relative to this */
    }

    /* Show search bar when header is scrolled */
    .header.scrolled .search-bar {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    /* Header Search Dropdown Specifics */
    .header .search-results-dropdown {
        top: calc(100% + 15px);
        width: 300px;
        right: 0;
        left: auto;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(0, 0, 0, 0.05);
    }

    /* Mobile Adjustments */
    @media (max-width: 768px) {
        .hero-search-bar {
            padding: 8px 15px;
        }

        .hero-search-bar input {
            font-size: 1rem;
        }

        .search-results-dropdown {
            max-height: 300px;
        }

        .search-result-item {
            padding: 10px 15px;
        }

        .search-result-image {
            width: 40px;
            height: 55px;
        }

        /* Mobile adjustments for header search dropdown */
        .header .search-results-dropdown {
            position: fixed;
            top: 70px;
            left: 10px;
            right: 10px;
            width: auto;
            max-height: 50vh;
        }
    }

    /* Prevent focus highlight on hero search - Aggressive Fix */
    .hero-search-bar:focus-within,
    .hero-search-bar:active,
    .hero-search-bar:focus {
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05) !important;
        border-color: var(--border-color) !important;
        outline: none !important;
        transform: none !important;
        background: #ffffff !important;
    }

    .hero-search-bar input:focus,
    .hero-search-bar input:active {
        outline: none !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }