/* ========================================
   MAAYAA APPLE-STYLE SEARCH CSS
   File: maayaa-search.css
   ======================================== */

/* Search Icon in Header */
.maayaa-search-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--header-text-color, #1d1d1f);
    margin-left: 20px;
}

.maayaa-search-icon:hover {
    opacity: 0.7;
    transform: scale(1.05);
}

.maayaa-search-icon svg {
    width: 20px;
    height: 20px;
}

/* Search Overlay - Apple Style */
.maayaa-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.32, 0.08, 0.24, 1), 
                visibility 0.4s cubic-bezier(0.32, 0.08, 0.24, 1);
}

.maayaa-search-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Search Wrapper */
.maayaa-search-wrapper {
    width: 90%;
    max-width: 680px;
    transform: translateY(-20px);
    transition: transform 0.4s cubic-bezier(0.32, 0.08, 0.24, 1);
}

.maayaa-search-overlay.active .maayaa-search-wrapper {
    transform: translateY(0);
}

/* Search Bar Container */
.maayaa-search-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 44px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
                0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    height: 56px;
}

.maayaa-search-bar:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15),
                0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Search Icon */
.search-icon-left {
    color: #86868b;
    flex-shrink: 0;
}

/* Search Input Wrapper */
.search-plugin-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
}

/* Style the plugin's search input */
.search-plugin-wrapper input[type="search"],
.search-plugin-wrapper input[type="text"] {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 17px;
    font-weight: 400;
    color: #1d1d1f;
    outline: none;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif;
    letter-spacing: -0.022em;
}

.search-plugin-wrapper input[type="search"]::placeholder,
.search-plugin-wrapper input[type="text"]::placeholder {
    color: #86868b;
    font-weight: 400;
}

/* Hide default plugin styling */
.search-plugin-wrapper form {
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
}

.search-plugin-wrapper .advanced-search-form {
    width: 100%;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}

/* Close Button */
.search-close-btn {
    background: rgba(142, 142, 147, 0.12);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    color: #86868b;
}

.search-close-btn:hover {
    background: rgba(142, 142, 147, 0.2);
    color: #1d1d1f;
}

/* Quick Search Links */
.search-quick-links {
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0 8px;
}

.quick-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.64);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.quick-tag {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.92);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.quick-tag:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .maayaa-search-overlay {
        padding-top: 10vh;
    }
    
    .maayaa-search-wrapper {
        width: 94%;
    }
    
    .maayaa-search-bar {
        height: 48px;
        padding: 0 16px;
    }
    
    .search-plugin-wrapper input[type="search"],
    .search-plugin-wrapper input[type="text"] {
        font-size: 16px;
    }
    
    .quick-label {
        width: 100%;
        margin-bottom: 4px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .maayaa-search-bar {
        background: rgba(30, 30, 30, 0.95);
    }
    
    .search-plugin-wrapper input[type="search"],
    .search-plugin-wrapper input[type="text"] {
        color: #f5f5f7;
    }
    
    .search-plugin-wrapper input[type="search"]::placeholder,
    .search-plugin-wrapper input[type="text"]::placeholder {
        color: #86868b;
    }
}

/* Animation Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus States */
.maayaa-search-bar:focus-within {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.16),
                0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Accessibility */
.maayaa-search-icon:focus,
.search-close-btn:focus {
    outline: 2px solid #0071e3;
    outline-offset: 2px;
}
