/* ========================================================= */
/* === FILE: /assets/jz-mobile/css/jz-mobile-search.css  === */
/* === STATUS: V3 - FIXED (Removes "Ghost" Remnants)          === */
/* ========================================================= */

:root {
    /* --- BRAT TWEAK: Search Config --- */
    --search-overlay-bg: rgba(15, 23, 42, 0.8); 
    --search-height: 55px;                      
    --pill-radius: 999px;                       
    --rgb-speed: 3s;                            
    --border-thickness: 3px;                    
    --input-bg: #0f172a;                        
}

/* 1. THE OVERLAY CONTAINER */
.mobile-search-overlay {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    background: var(--search-overlay-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 9990;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 30px;
    
    /* FORCE HIDE DEFAULT STATE */
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* <-- Fix: Clicks pass through when hidden */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-search-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Re-enable clicks */
}

/* 2. THE RGB WRAPPER */
.search-rgb-wrapper {
    position: relative;
    width: 90%;          
    max-width: 600px;    
    height: var(--search-height);
    border-radius: var(--pill-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    
    transform: translateY(-20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box; 
}

.mobile-search-overlay.is-active .search-rgb-wrapper {
    transform: translateY(0);
}

/* 3. THE RGB ANIMATION LAYER */
.rgb-bg-layer {
    position: absolute;
    top: 0; 
    left: -5px;   
    right: -5px;  
    bottom: 0;
    border-radius: var(--pill-radius);
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8f00ff, #ff0000);
    background-size: 400% 100%;
    animation: borderFlow var(--rgb-speed) linear infinite;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2); 
    z-index: 1;
}

.rgb-bg-layer::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: inherit; filter: blur(10px); opacity: 0.6; z-index: -1; border-radius: var(--pill-radius);
}

@keyframes borderFlow { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }

/* 4. THE INPUT FIELD */
.mobile-search-input {
    position: relative; z-index: 2;
    width: calc(100% - (var(--border-thickness) * 2));
    height: calc(100% - (var(--border-thickness) * 2));
    box-sizing: border-box; 
    border-radius: var(--pill-radius) !important; 
    border: none; outline: none; background: var(--input-bg);
    color: #fff; font-size: 1.1rem; padding: 0 50px 0 20px; font-family: inherit;
}

/* 5. THE GO ICON */
.search-icon-inside {
    position: absolute; right: 18px; z-index: 3;
    color: #64748b; font-size: 1.2rem; cursor: pointer; transition: color 0.2s;
}
.search-icon-inside:hover { color: #fff; }

/* 6. BACKDROP */
.search-overlay-backdrop {
    position: absolute; top: var(--search-height); left: 0;
    width: 100%; height: 100%; z-index: 9980; cursor: pointer;
}