/* KAROKA AI SEARCH ENGINE UI */

.search-modal {
    position: fixed;
    inset: 0;
    z-index: 11000;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(25px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s var(--ease-power);
}

.search-modal.active {
    opacity: 1;
    visibility: visible;
}

.close-search {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-search:hover {
    background: var(--ember-red);
    transform: rotate(90deg);
}

.search-container {
    width: 100%;
    max-width: 800px;
    padding: 0 24px;
    text-align: center;
}

.search-header h2 {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.search-header .accent {
    color: var(--ember-red);
    font-family: var(--font-script);
}

.search-header p {
    color: var(--ash-gray);
    margin-bottom: 40px;
    letter-spacing: 1px;
}

.search-input-wrap {
    position: relative;
    margin-bottom: 20px;
}

.ai-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    padding: 24px 40px;
    font-size: 1.4rem;
    color: var(--white);
    font-family: var(--font-body);
    outline: none;
    transition: all 0.4s ease;
    padding-right: 150px;
    /* Space for Visual button */
}

.ai-input:focus {
    border-color: var(--ember-red);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 40px rgba(204, 0, 0, 0.15);
}

.visual-search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--ember-red);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.visual-search-btn:hover {
    background: var(--ember-red-glow);
    transform: translateY(-50%) scale(1.05);
}

.search-suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 50px;
}

.suggestion-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--smoke);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suggestion-chip:hover {
    background: var(--ember-red);
    color: var(--white);
    border-color: var(--ember-red);
}

.search-results-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.search-results-container::-webkit-scrollbar {
    width: 6px;
}

.search-results-container::-webkit-scrollbar-thumb {
    background: var(--ember-red);
    border-radius: 10px;
}

.search-result-card {
    background: rgba(34, 34, 34, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(20px);
}

.search-result-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.search-result-card:hover {
    background: rgba(204, 0, 0, 0.05);
    border-color: rgba(204, 0, 0, 0.2);
    transform: scale(1.02);
}

.res-info h4 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.res-image {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.res-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.res-info p {
    font-size: 0.8rem;
    color: var(--ember-red);
    font-weight: 700;
    letter-spacing: 1px;
}

.res-price {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--white);
}

.res-link {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.res-link:hover {
    background: var(--white);
    color: var(--black);
}

/* SCANNING OVERLAY */
.scanning-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.scanning-overlay.active {
    opacity: 1;
    visibility: visible;
}

.scanner-box {
    position: relative;
    width: 300px;
    height: 300px;
    border: 2px solid var(--ember-red);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(204, 0, 0, 0.3);
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--ember-red);
    box-shadow: 0 0 20px var(--ember-red);
    animation: scanAnimation 2s infinite linear;
}

@keyframes scanAnimation {
    0% {
        top: 0%;
    }

    50% {
        top: 100%;
    }

    100% {
        top: 0%;
    }
}

.scanner-text {
    margin-top: 30px;
    font-family: var(--font-display);
    font-size: 1.5rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--ember-red);
    animation: blink 1s infinite alternate;
}

@keyframes blink {
    from {
        opacity: 0.4;
    }

    to {
        opacity: 1;
    }
}

.ai-match-header {
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 1rem;
}

/* SEARCH TOGGLE BUTTON IN NAVBAR */
.nav-search-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 15px;
}

.nav-search-btn:hover {
    background: var(--ember-red);
    border-color: var(--ember-red);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .search-result-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .ai-input {
        font-size: 1rem;
        padding-right: 40px;
    }

    .visual-search-btn {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        margin-top: 15px;
    }
}