/* Main Wrapper */
.fts-smart-search-wrapper {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    font-family: 'Inter', sans-serif;
}

/* Trigger Icon - Minimal & Clean */
.fts-ss-trigger {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    /* Slightly squared for modern feel */
    cursor: pointer;
    background: transparent;
    /* Cleaner look */
    color: #334155;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.fts-ss-trigger:hover,
.fts-smart-search-wrapper.active .fts-ss-trigger {
    background: #f1f5f9;
    color: #0f172a;
}

.fts-ss-trigger i {
    font-size: 18px;
}

/* Tooltip / Card Popup */
.fts-ss-tooltip {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 380px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 20px 25px -5px rgba(0, 0, 0, 0.1);
    /* Layered Shadow */
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(15px) scale(0.95) !important;
    transform-origin: top right !important;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    /* Smooth Bouncy Effect */
    z-index: 9999 !important;
}

/* No Arrow - Clean Floating Card */
.fts-ss-tooltip::before {
    display: none !important;
}

.fts-smart-search-wrapper.active .fts-ss-tooltip {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
}

.fts-ss-tooltip-inner {
    padding: 20px;
}

/* Header Text */
.fts-ss-header {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fts-ss-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

/* Search Input Group - Flexbox Layout */
.fts-ss-input-group {
    position: relative;
    margin-bottom: 24px;
    height: 52px;
    /* Fixed height */
    display: flex;
    align-items: center;
    gap: 8px;
    /* Space between input and button */
}

/* Remove focus-within logic as we don't have a single border anymore */

.fts-ss-submit-btn {
    display: flex;
    /* Flex center for icon */
    align-items: center;
    justify-content: center;
    width: 52px;
    /* Square button */
    height: 100%;
    background: #ff7f50;
    /* Brand Color */
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.fts-ss-submit-btn:hover {
    background: #e66a3c;
}

.fts-ss-input {
    flex: 1;
    /* Take remaining space */
    height: 100%;
    border: none !important;
    background: #f1f5f9 !important;
    /* Light gray background */
    padding: 0 16px !important;
    /* Padding on both sides */
    border-radius: 12px;
    /* Rounded input */
    font-size: 16px;
    color: #0f172a;
    outline: none;
    box-shadow: none !important;
    width: auto;
    transition: all 0.2s ease;
}

.fts-ss-input:focus {
    background: #fff !important;
    box-shadow: 0 0 0 2px #e2e8f0 !important;
    /* Ring effect */
}

.fts-ss-input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

/* Popular Searches Area */
.fts-ss-popular {
    border-top: 1px solid #f1f5f9;
    padding-top: 20px;
}

.fts-ss-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 12px;
    display: block;
    letter-spacing: 0.05em;
}

.fts-ss-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fts-ss-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.fts-ss-tag:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
    transform: translateY(-1px);
}

/* Close Button (Mobile Only) */
.fts-ss-close-btn {
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.fts-ss-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Mobile Responsive - Centered Modal Card */
@media (max-width: 768px) {
    .fts-ss-tooltip {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;

        width: 90% !important;
        max-width: 360px !important;
        height: auto !important;
        /* Auto height based on content */
        margin: 0 !important;

        background: #ffffff !important;
        border-radius: 20px !important;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;

        /* Initial State for Animation */
        transform: translate(-50%, -50%) scale(0.9) !important;
        opacity: 0 !important;
        visibility: hidden !important;

        padding-bottom: 20px !important;
        /* Normal padding */
        z-index: 99999 !important;
        display: block !important;
        flex-direction: column !important;
    }

    /* Fixed Overlay */
    .fts-smart-search-wrapper.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(15, 23, 42, 0.6);
        /* Darker overlay for focus */
        z-index: 99998;
        backdrop-filter: blur(4px);
        animation: ftsFadeIn 0.3s ease forwards;
    }

    /* Active Animation State */
    .fts-smart-search-wrapper.active .fts-ss-tooltip {
        transform: translate(-50%, -50%) scale(1) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .fts-ss-close-btn {
        display: flex !important;
        top: 15px !important;
        right: 15px !important;
        background: #f8fafc !important;
    }

    .fts-ss-tooltip-inner {
        padding: 50px 24px 30px !important;
        /* Top padding for close button */
        flex: auto !important;
    }
}

@keyframes ftsFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}