/* Inline Search Container */
.nav-search-container {
    position: relative;
    margin-right: 20px;
    display: flex;
    align-items: center;
}

.nav-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 250px;
    /* Adjust width as needed */
    transition: width 0.3s ease;
}

.nav-search-wrapper:focus-within {
    width: 300px;
    /* Expand on focus */
}

/* Search Input */
.nav-search-input {
    width: 100%;
    padding: 8px 35px 8px 15px;
    font-size: 1rem;
    font-family: 'Caveat', cursive;
    /* Match site font */
    border: 2px solid #ccc;
    /* Sketchy border color */
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    /* Sketchy border radius */
    background-color: transparent;
    color: var(--text-main);
    outline: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-search-input:focus {
    border-color: var(--accent);
    background-color: rgba(255, 255, 255, 0.7);
    box-shadow: 2px 2px 8px rgba(0, 113, 227, 0.2), 0 0 0 3px rgba(0, 113, 227, 0.1);
    transform: scale(1.02);
}

.nav-search-input::placeholder {
    color: #999;
    font-family: 'Caveat', cursive;
}

/* Search Icon inside Input */
.nav-search-icon-inline {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-sub);
    pointer-events: none;
}

/* Dropdown Results */
.search-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    /* Align right or left depending on preference, right is safer for nav */
    width: 350px;
    background-color: rgba(253, 251, 247, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid #2c2c2c;
    /* Sketchy border */
    border-radius: 15px 225px 15px 255px / 255px 15px 225px 15px;
    /* Sketchy border radius */
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
    padding: 10px 0;
    z-index: 2002;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 400px;
    overflow-y: auto;
}

.search-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Dropdown Items */
.search-dropdown-item {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    border-bottom: 1px dashed #ddd;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateX(-10px);
    animation: slideInFade 0.4s ease forwards;
}

.search-dropdown-item:last-child {
    border-bottom: none;
}

.search-dropdown-item:hover {
    background-color: rgba(0, 113, 227, 0.05);
    transform: translateX(0) scale(1.02);
    padding-left: 25px;
}

.search-dropdown-title {
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 4px;
    transition: color 0.2s ease;
}

.search-dropdown-item:hover .search-dropdown-title {
    color: #005bb5;
}

.search-dropdown-desc {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.9rem;
    color: var(--text-sub);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Staggered animation for search results */
@keyframes slideInFade {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.search-dropdown-item:nth-child(1) {
    animation-delay: 0.05s;
}

.search-dropdown-item:nth-child(2) {
    animation-delay: 0.1s;
}

.search-dropdown-item:nth-child(3) {
    animation-delay: 0.15s;
}

.search-dropdown-item:nth-child(4) {
    animation-delay: 0.2s;
}

.search-dropdown-item:nth-child(5) {
    animation-delay: 0.25s;
}

.search-dropdown-item:nth-child(6) {
    animation-delay: 0.3s;
}

.search-dropdown-item:nth-child(7) {
    animation-delay: 0.35s;
}

.search-dropdown-item:nth-child(8) {
    animation-delay: 0.4s;
}

.search-dropdown-item:nth-child(9) {
    animation-delay: 0.45s;
}

.search-dropdown-item:nth-child(10) {
    animation-delay: 0.5s;
}

.dropdown-no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-sub);
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
}

/* Scrollbar for dropdown */
.search-dropdown::-webkit-scrollbar {
    width: 6px;
}

.search-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.search-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Mobile Responsiveness */
/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .nav-search-container {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        padding: 10px 20px;
        background-color: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        margin-right: 0;
    }

    .nav-search-container.active {
        display: flex;
        justify-content: center;
    }

    .nav-search-wrapper {
        width: 100%;
        max-width: 400px;
    }

    .nav-search-wrapper:focus-within {
        width: 100%;
    }

    .search-dropdown {
        width: 100%;
        max-width: 400px;
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }

    /* Specific fix for mobile search dropdown in hero */
    .mobile-search-dropdown {
        width: 100% !important;
        left: 0 !important;
        transform: none !important;
        max-width: none !important;
        border-radius: 0 0 10px 10px;
        top: 100%;
        margin-top: 5px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }
}