/* Enhanced Delightful Search Styles - BRAND NEW DESIGN */

/* Search Input with Transparent Background as Requested */
.search-input {
    background: transparent !important;
    backdrop-filter: none;
    box-shadow: none;
    border: none;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

.search-input:focus {
    background: transparent !important;
    box-shadow: none;
    border: none;
    outline: none;
    animation: inputGlow 2s ease-in-out infinite;
}

/* Enhanced Search Pill with Glassmorphism */
.search-pill {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px) saturate(1.8);
    border: 2px solid transparent;
    border-radius: 50px;
    position: relative;
    overflow: visible;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: pillFloat 6s ease-in-out infinite;
}

/* Search Button Enhanced */
.search-button {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(204, 153, 51, 0.3);
}

.search-button:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 30px rgba(204, 153, 51, 0.5);
    background: linear-gradient(135deg, var(--accent-hover), var(--accent));
}

.search-button:active {
    transform: scale(0.95) rotate(-5deg);
    animation: buttonPulse 0.6s ease-out;
}

/* Typing Indicator */
.search-input:focus ~ .typing-indicator {
    opacity: 1;
    transform: scale(1);
}

.typing-indicator {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 3;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Loading States */
.search-button.loading {
    animation: searchLoading 1s infinite ease-in-out;
    pointer-events: none;
}

.search-button.loading svg {
    display: none;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Success State */
.search-pill.success {
    animation: successPulse 0.8s ease-out;
    border: 2px solid #28a745;
}

.search-pill.success .search-button {
    background: linear-gradient(135deg, #28a745, #20c997);
}

/* Error State */
.search-pill.error {
    animation: errorShake 0.6s ease-out;
    border: 2px solid #dc3545;
}

/* Confetti Celebration */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--accent);
    animation: confettiFall 2s ease-out forwards;
}

/* Animations */
@keyframes inputGlow {
    0%, 100% {
        box-shadow: none;
    }
    50% {
        box-shadow: 0 0 20px rgba(204, 153, 51, 0.2);
    }
}

@keyframes pillFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

@keyframes searchLoading {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(180deg);
    }
}

@keyframes buttonPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.8);
    }
}

@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 383.98px) {
    .search-button {
        width: 40px;
        height: 40px;
    }

    .search-input {
        font-size: 14px;
        padding: 10px 15px;
    }

    .typing-indicator {
        right: 50px;
    }
}

@media (min-width: 1536px) {
    .search-pill {
        max-width: 800px;
    }

    .search-button {
        width: 56px;
        height: 56px;
    }

    .search-input {
        font-size: 18px;
        padding: 16px 28px;
    }

    .loading-spinner {
        width: 24px;
        height: 24px;
        border-width: 4px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .search-pill,
    .search-button,
    .search-input {
        animation: none;
        transition: none;
    }

    .confetti {
        display: none;
    }
}