/* Mobile Search Box Styling */
/* ========================== */

.mobile-search-container {
    width: 100%;
    margin-top: 60px;
    margin-bottom: 10px;
    padding: 0 20px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.4s ease-out;
}

.top-nav.active .mobile-search-container {
    opacity: 1;
    transform: translateY(0);
    animation: slideInDown 0.5s ease-out 0.2s both;
}

.mobile-search-form {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid var(--glass-border);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.mobile-search-form:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2),
                0 8px 32px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.mobile-search-input {
    flex: 1;
    padding: 16px 20px;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.mobile-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    transition: all 0.3s ease;
}

.mobile-search-input:focus::placeholder {
    color: rgba(255, 255, 255, 0.4);
    transform: translateX(5px);
}

.mobile-search-btn {
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    outline: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    position: relative;
    overflow: hidden;
}

.mobile-search-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.mobile-search-btn:hover::before {
    left: 100%;
}

.mobile-search-btn:hover {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.mobile-search-btn:active {
    transform: scale(0.98);
}

.mobile-search-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
    transition: all 0.3s ease;
}

.mobile-search-btn:hover svg {
    transform: rotate(15deg) scale(1.1);
}

/* Animation for search container */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse animation for search button */
@keyframes searchPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
}

.mobile-search-btn:focus {
    animation: searchPulse 1.5s infinite;
}

/* Enhanced focus states */
.mobile-search-input:focus {
    color: #ffffff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

/* Typing indicator */
.mobile-search-input.typing {
    border-right: 2px solid #667eea;
    animation: typing-blink 1s infinite;
}

@keyframes typing-blink {
    0%, 50% {
        border-color: #667eea;
    }
    51%, 100% {
        border-color: transparent;
    }
}

/* Mobile search suggestions (for future enhancement) */
.mobile-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-top: none;
    border-radius: 0 0 15px 15px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.mobile-search-suggestions.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-suggestion-item {
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.search-suggestion-item:hover {
    background: rgba(102, 126, 234, 0.2);
    color: white;
    padding-left: 25px;
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .mobile-search-container {
        padding: 0 15px;
        margin-bottom: 25px;
    }
    
    .mobile-search-input {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .mobile-search-btn {
        padding: 14px 16px;
        min-width: 50px;
    }
    
    .mobile-search-btn svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 360px) {
    .mobile-search-input {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .mobile-search-btn {
        padding: 12px 14px;
        min-width: 45px;
    }
    
    .mobile-search-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* Only show on mobile devices and when mobile menu is active */
.mobile-search-container {
    display: none;
}

@media (max-width: 767px) {
    .top-nav.active .mobile-search-container {
        display: block;
    }
}

@media (min-width: 768px) {
    .mobile-search-container {
        display: none !important;
    }
}

/* Dark theme compatibility */
@media (prefers-color-scheme: dark) {
    .mobile-search-form {
        background: rgba(0, 0, 0, 0.3);
        border-color: rgba(255, 255, 255, 0.15);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .mobile-search-form {
        border-width: 3px;
        border-color: white;
    }
    
    .mobile-search-input {
        color: white;
    }
    
    .mobile-search-btn {
        background: white;
        color: black;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .mobile-search-container,
    .mobile-search-form,
    .mobile-search-input,
    .mobile-search-btn,
    .mobile-search-btn svg {
        animation: none !important;
        transition: none !important;
    }
    
    .mobile-search-btn:hover {
        transform: none !important;
    }
}
