/* Smart Autocomplete Styles */

/* Variable Definitions */
:root {
    --sa-bg-color: #ffffff;
    --sa-border-color: #e2e8f0;
    --sa-hover-bg: #eff6ff;
    --sa-text-main: #1e293b;
    --sa-text-sub: #64748b;
    --sa-highlight: #3b82f6;
    --sa-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --sa-z-index: 1000;
}

.smart-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--sa-bg-color);
    width: 100%;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--sa-border-color);
    border-radius: 0 0 12px 12px;
    box-shadow: var(--sa-shadow);
    z-index: var(--sa-z-index);
    font-family: 'Inter', sans-serif;
    display: none;
    margin-top: 4px;
}

.smart-autocomplete-dropdown.active {
    display: block;
}

/* Sections */
.sa-header {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.05em;
    background: #f8fafc;
}

/* Items */
.sa-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background-color 0.15s ease;
}

.sa-item:hover,
.sa-item.selected {
    background-color: var(--sa-hover-bg);
}

.sa-item.selected {
    border-left: 3px solid var(--sa-highlight);
    padding-left: 13px;
}

/* Icon */
.sa-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    flex-shrink: 0;
}

.sa-item:hover .sa-icon,
.sa-item.selected .sa-icon {
    background-color: #dbeafe;
    color: var(--sa-highlight);
}

/* Text Content */
.sa-content {
    flex: 1;
    min-width: 0;
}

.sa-main-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--sa-text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sa-sub-text {
    font-size: 12px;
    color: var(--sa-text-sub);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Adjustments (Pricing Page Mirror) */
@media (max-width: 768px) {

    /* Flow inside overlay */
    .smart-autocomplete-dropdown {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        max-height: none;
        border: none;
        box-shadow: none;
        border-radius: 0;
        margin-top: 0;
        background: transparent;
    }

    /* Mobile Search Overlay */
    .sa-mobile-overlay {
        position: fixed;
        inset: 0;
        background: white;
        z-index: 10000;
        display: none;
        flex-direction: column;
        transform: translateY(100%);
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sa-mobile-overlay.active {
        display: flex;
        transform: translateY(0);
    }

    /* Header Mirroring Pricing Page */
    .sa-mobile-header {
        padding: 20px;
        background: white;
        border-bottom: 1px solid #f1f5f9;
        display: flex;
        flex-direction: column;
        gap: 16px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    }

    .sa-mobile-top-bar {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .sa-back-btn {
        background: #f1f5f9;
        color: #1e293b;
        border: none;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 14px;
    }

    .sa-mobile-title {
        font-size: 18px;
        font-weight: 700;
        color: #1e293b;
        margin: 0;
    }

    .sa-mobile-input-wrapper {
        position: relative;
        flex: 1;
    }

    .sa-search-icon {
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        color: #94a3b8;
        font-size: 15px;
        z-index: 10;
    }

    .sa-mobile-input {
        width: 100%;
        padding: 14px 16px 14px 48px;
        border: 2px solid #e2e8f0;
        border-radius: 14px;
        font-size: 15px;
        transition: all 0.25s ease;
        background: white;
        color: #1e293b;
        outline: none;
    }

    .sa-mobile-input:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    }

    .sa-mobile-results {
        flex: 1;
        overflow-y: auto;
        padding-bottom: 40px;
    }
}