/* Premium AI Loader Overlay */
#ai-loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, sans-serif;
}

.loader-content {
    text-align: center;
    position: relative;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.8);
}

/* Sophisticated AI Sparkle with Gradient Pulse */
.ai-sparkle-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    animation: pulseGlow 2s infinite ease-in-out;
}

.ai-sparkle {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 15px rgba(217, 83, 79, 0.4));
}

.ai-sparkle svg {
    fill: url(#aiGradient);
}

/* Scanning Line Animation */
.scanning-line {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d9534f, transparent);
    animation: scanMove 2s infinite ease-in-out;
    opacity: 0.8;
}

@keyframes scanMove {
    0%, 100% { top: 20%; opacity: 0; }
    50% { top: 80%; opacity: 1; }
}

@keyframes pulseGlow {
    0% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(217, 83, 79, 0.3)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 25px rgba(217, 83, 79, 0.6)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(217, 83, 79, 0.3)); }
}

/* Shimmering Text */
.loader-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -0.01em;
    background: linear-gradient(90deg, #1a1a1a 0%, #d9534f 50%, #1a1a1a 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textShimmer 3s linear infinite;
}

@keyframes textShimmer {
    to { background-position: 200% center; }
}

/* Anti-Gravity Suggestion UI */
#search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    text-align: left;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

.suggestion-breadcrumb {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 2px;
}

.suggestion-text {
    font-weight: 600;
    color: #333;
}

.suggestion-type {
    float: right;
    font-size: 0.7rem;
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
    color: #666;
    margin-top: 5px;
}

#unlock-search {
    display: none;
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: #eee;
    border: none;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    z-index: 6;
    color: #d9534f;
    font-weight: bold;
}

#unlock-search:hover {
    background: #ddd;
}

/* Floating AI Search Modal */
#ai-search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.ai-search-modal {
    background: white;
    width: 90%;
    max-width: 800px;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 40px 100px rgba(0,0,0,0.2);
    position: relative;
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    border: none;
    background: none;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 5px 20px;
    transition: all 0.2s;
}

.search-input-wrapper:focus-within {
    background: white;
    border-color: #d9534f;
    box-shadow: 0 0 0 4px rgba(217, 83, 79, 0.1);
}

#locked-entity-pill {
    display: none;
    background: #d9534f;
    color: white;
    padding: 6px 12px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: 10px;
    white-space: nowrap;
    align-items: center;
}

#locked-entity-pill .remove-pill {
    margin-left: 8px;
    cursor: pointer;
    opacity: 0.8;
}

#locked-entity-pill .remove-pill:hover {
    opacity: 1;
}

#modal-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 15px 0;
    font-size: 1.2rem;
    font-weight: 500;
    outline: none;
    width: 100%;
}

.modal-search-suggestions {
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
    border-radius: 12px;
}
