/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}



    .search-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.search-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 600px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-overlay.active .search-container {
    transform: translate(-50%, -50%) scale(1);
}


#searchResults {
    overflow-x: hidden;
}

.search-box {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 1rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

    .search-box:hover {
        border-color: rgba(255, 255, 255, 0.4);
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    }

.search-input-group {
    position: relative;
    margin-bottom: 1rem;
}

.search-input {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 15px;
    padding: 1rem 1rem 1rem 3.5rem;
    font-size: 1.1rem;
    width: 100%;
    color: #333;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

    .search-input:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.4), inset 0 2px 10px rgba(0, 0, 0, 0.1);
        background: white;
    }

.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(var(--bs-valsecchi-rgb));
    font-size: 1.2rem;
    z-index: 10;
}

.search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

    .filter-btn:hover, .filter-btn.active {
        background: rgba(255, 255, 255, 0.9);
        color: rgba(var(--bs-valsecchi-rgb));
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }

.results-container {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.result-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

    .result-item:hover {
        background: rgba(102, 126, 234, 0.1);
        transform: translateX(5px);
    }

    .result-item:last-child {
        border-bottom: none;
    }

.result-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

    .result-icon.fatture {
        background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    }

    .result-icon.ordini {
        background: linear-gradient(45deg, #4ecdc4, #44a08d);
    }

    .result-icon.affidamenti {
        background: linear-gradient(45deg, #45b7d1, #2980b9);
    }

    .result-icon.ddt {
        background: linear-gradient(45deg, #f9ca24, #f0932b);
    }

.result-content {
    flex: 1;
}

.result-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.result-subtitle {
    color: #666;
    font-size: 0.9rem;
}

.result-type {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

    .result-type.fatture {
        background: rgba(255, 107, 107, 0.2);
        color: #ff6b6b;
    }

    .result-type.ordini {
        background: rgba(78, 205, 196, 0.2);
        color: #4ecdc4;
    }

    .result-type.affidamenti {
        background: rgba(69, 183, 209, 0.2);
        color: #45b7d1;
    }

    .result-type.ddt {
        background: rgba(249, 202, 36, 0.2);
        color: #f9ca24;
    }

.close-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: rgba(var(--bs-valsecchi-rgb));
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

    .close-btn:hover {
        background: white;
        transform: scale(1.1);
    }

.shortcut-hint {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: 15px;
    color: rgba(var(--bs-valsecchi-rgb));
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}

.loading-spinner {
    display: none;
    text-align: center;
    padding: 2rem;
    color: rgba(var(--bs-valsecchi-rgb));
}

.no-results {
    display: none;
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .search-container {
        width: 95%;
    }

    .search-filters {
        justify-content: center;
    }

    .filter-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Scrollbar personalizzata */
.results-container::-webkit-scrollbar {
    width: 6px;
}

.results-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.results-container::-webkit-scrollbar-thumb {
    background: rgba(var(--bs-valsecchi-rgb));
    border-radius: 10px;
}

    .results-container::-webkit-scrollbar-thumb:hover {
        background: rgba(var(--bs-valsecchi-rgb));
    }
