﻿/*.site-search-group .form-control:focus {
    box-shadow: none;
}

.site-search-group .input-group-text {
    border-color: rgba(0,0,0,.15);
    background: #fff;
    color: #6c757d;
    border-right: 0;
}

.site-search-group .form-control {
    border-left: 0 !important;
    border-right: 0 !important;
    border-top: 0 !important;
    border-color: rgba(0,0,0,.15) !important;
    border: 2px solid gainsboro;
    border-radius: 999px;
    height: 40px;
    color: #fff;
}

.site-search-group .form-control::placeholder{
    color: #fff !important;
}

.site-search-group .input-group-text:first-child {
    border-top-left-radius: 999px;
    border-bottom-left-radius: 999px;
}

.site-search-group .input-group-text#site-search-loading {
    border-left: 0;
}*/

/*.search-container {
    position: relative;
    width: 50px;
    height: 50px;
    transition: width 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

    .search-container.expanded {
        width: 320px;
    }

.search-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.search-input {
    width: 100% !important;
    height: 50px;
    padding: 0 60px 0 20px;
    border: 2px solid gainsboro !important;
    border-radius: 25px;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: #fff !important;
}

.search-container.expanded .search-input {
    opacity: 1;
}

.search-container.expanded .search-input::placeholder{
    color: #fff !important;
}

.search-btn {
    position: absolute;
    right: 0;
    top: 0;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

    .search-btn:hover {
        background: #f8f9fa;
        transform: scale(1.05);
    }

    .search-btn i {
        font-size: 18px;
        color: gainsboro;
        transition: transform 0.3s ease;
    }

.search-container.expanded .search-btn i {
    transform: rotate(90deg);
}

.search-input:focus {
    outline: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#site-search-dropdown {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.spinner-border {
    width: 20px;
    height: 20px;
}

.loading-spinner {
    position: absolute;
    right: 60px;
    top: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .loading-spinner.show {
        opacity: 1;
    }


#site-search-dropdown {
	max-height: 60vh;
	overflow-y: auto;
	transform-origin: top;
	animation: siteDropdownIn .12s ease-out;
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
    z-index: 2000;*/ /* above fixed header/nav */
    /*border-radius: .5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

@keyframes siteDropdownIn {
	from { opacity: 0; transform: scaleY(0.98); }
	to { opacity: 1; transform: scaleY(1); }
}

#site-search-results .dropdown-item.active,
#site-search-results .dropdown-item:active {
	background-color: #e9ecef !important;
	color: #212529 !important; 
}

@media (max-width: 576px) {
	#site-search-dropdown { min-width: 100% !important; left: 0 !important; right: 0 !important; }
}*/

/* Ensure bootstrap dropdown-menu is visible when we add .show */
/*.site-search .dropdown-menu.show { display: block; }*/

/* Optional: subtle border/background to match Bootstrap */
/*.site-search .dropdown-menu { background: #fff; border: 1px solid rgba(0,0,0,.125); }*/

/* Items */
/*#site-search-results .dropdown-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
}

#site-search-results .dropdown-item:hover {
    background-color: #f8f9fa;
}

.site-search-item-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e9ecef;
    color: #495057;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    flex: 0 0 28px;
}

.site-search-item-main {
    min-width: 0;
    flex: 1 1 auto;
}

.site-search-item-title {
    font-weight: 600;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-search-item-meta {
    color: #6c757d;
    font-size: .8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-search-item-badge {
    font-size: .7rem;
    color: #0d6efd;
    background: rgba(13,110,253,.08);
    border: 1px solid rgba(13,110,253,.2);
    padding: .15rem .4rem;
    border-radius: 999px;
    flex: 0 0 auto;
}*/


/* Search Container */
.search-container {
    position: relative;
    width: 50px;
    height: 50px;
    transition: width 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

    .search-container.expanded {
        width: 320px;
    }

.search-wrapper {
    position: relative;
    width: 80%;
    height: 100%;
}

/* Search Input */
.search-input {
    width: 100% !important;
    height: 40px;
    padding: 0 60px 0 20px;
    border: 2px solid gainsboro !important;
    border-radius: 25px;
    font-size: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: #fff !important;
    background: white;
}

.search-container.expanded .search-input {
    opacity: 1;
    pointer-events: auto;
}

.search-input::placeholder {
    color: #fff !important;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-color: gainsboro !important;
}

/* Search Button */
.search-btn {
    position: absolute;
    right: 0;
    top: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10;
    color: #fff;
}

    .search-btn:hover {
        background: #f8f9fa;
        transform: scale(1.05);
        color: #333;
    }

    .search-btn i {
        font-size: 18px;
        color: gainsboro;
        transition: transform 0.3s ease;
    }

/* Loading Spinner */
.loading-spinner {
    position: absolute;
    right: 60px;
    top: 40%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

    .loading-spinner.d-none {
        display: none !important;
    }

.spinner-border {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-right-color: gainsboro;
    border-radius: 50%;
    animation: spinner-rotate 0.75s linear infinite;
}

@keyframes spinner-rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Dropdown */
#site-search-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    max-height: 400px;
    min-width: 320px;
    overflow: hidden;
    transform-origin: top;
    animation: siteDropdownIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2000;
    border-radius: 12px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 10px 40px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
    background: #fff;
    backdrop-filter: blur(10px);
}

#site-search-results {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

    /* Custom Scrollbar */
    #site-search-results::-webkit-scrollbar {
        width: 8px;
    }

    #site-search-results::-webkit-scrollbar-track {
        background: transparent;
    }

    #site-search-results::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 4px;
    }

        #site-search-results::-webkit-scrollbar-thumb:hover {
            background: #9ca3af;
        }

@keyframes siteDropdownIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Ensure bootstrap dropdown-menu is visible when we add .show */
.site-search .dropdown-menu.show {
    display: block;
}

/* Dropdown Items */
#site-search-results .dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

    #site-search-results .dropdown-item::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        background: gainsboro;
        transform: scaleY(0);
        transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    #site-search-results .dropdown-item:hover {
        background: linear-gradient(to right, rgba(102, 126, 234, 0.05), transparent);
        padding-left: 20px;
    }

        #site-search-results .dropdown-item:hover::before {
            transform: scaleY(1);
        }

    #site-search-results .dropdown-item.active {
        background: linear-gradient(to right, rgba(102, 126, 234, 0.08), rgba(102, 126, 234, 0.02));
        padding-left: 20px;
    }

        #site-search-results .dropdown-item.active::before {
            transform: scaleY(1);
        }

    #site-search-results .dropdown-item:not(:last-child) {
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    }

    /* No results message */
    #site-search-results .dropdown-item.text-muted {
        justify-content: center;
        padding: 24px 16px;
        color: #9ca3af;
        font-style: italic;
    }

/* Item Components */
.site-search-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, gainsboro 0%, #764ba2 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex: 0 0 36px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    transition: transform 0.2s ease;
}

#site-search-results .dropdown-item:hover .site-search-item-icon {
    transform: scale(1.05);
}

.site-search-item-main {
    min-width: 0;
    flex: 1 1 auto;
}

.site-search-item-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.site-search-item-meta {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

    .site-search-item-meta::before {
        content: '🔗';
        font-size: 10px;
        opacity: 0.6;
    }

.site-search-item-badge {
    font-size: 11px;
    font-weight: 600;
    color: gainsboro;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 1px solid rgba(102, 126, 234, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    flex: 0 0 auto;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive */
@media (max-width: 576px) {
    .search-container.expanded {
        width: 280px;
    }

    #site-search-dropdown {
        min-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
    }
}