/* Enhanced Search Styles */
.enhanced-search-form {
    width: 100%;
    max-width: 400px;
    margin: 0;
}

.search-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #e0e6ed;
    border-radius: 25px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-wrapper:focus-within {
    border-color: #1e73be;
    box-shadow: 0 4px 16px rgba(30, 115, 190, 0.2);
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
    color: #333;
}

.search-input::placeholder {
    color: #999;
    font-style: italic;
}

.search-button {
    padding: 12px 18px;
    background: #1e73be;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.search-button:hover {
    background: #155a8a;
    transform: scale(1.05);
}

.search-button:active {
    transform: scale(0.95);
}

.search-button svg {
    transition: transform 0.3s ease;
}

.search-button:hover svg {
    transform: rotate(90deg);
}

/* Search Results Page Specific Styles */
.search-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 8px;
    margin-bottom: 20px;
}

.search-header .search-title {
    color: #fff;
}

.search-results-grid {
    gap: 24px;
}

.search-result-item {
    transition: all 0.3s ease;
}

.search-result-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.search-result-item .result-thumb {
    position: relative;
    overflow: hidden;
}

.search-result-item .result-thumb::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 115, 190, 0);
    transition: background 0.3s ease;
}

.search-result-item:hover .result-thumb::after {
    background: rgba(30, 115, 190, 0.1);
}

.result-title a:hover {
    color: #1e73be !important;
}

.read-more-btn:hover {
    background: #155a8a !important;
    transform: translateX(4px);
}

/* Highlight search terms */
mark {
    background: #ffeb3b !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
    font-weight: 600 !important;
}

/* No results section */
.no-search-results {
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .enhanced-search-form {
        max-width: 100%;
    }
    
    .search-wrapper {
        border-radius: 20px;
    }
    
    .search-input {
        padding: 10px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .search-button {
        padding: 10px 14px;
        min-width: 44px;
    }
    
    .search-header {
        text-align: center;
        padding: 20px !important;
    }
    
    .search-results-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .result-body {
        padding: 16px !important;
    }
    
    .result-title {
        font-size: 18px !important;
    }
}

/* Animation for search form dropdown */
.menu-item-search-dropdown .enhanced-search-form {
    animation: slideDown 0.3s ease;
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .search-wrapper {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .search-input {
        color: #fff;
    }
    
    .search-input::placeholder {
        color: #ccc;
    }
    
    .search-result-item {
        background: #2a2a2a !important;
        border-color: #444 !important;
        color: #fff;
    }
    
    .result-title a {
        color: #fff !important;
    }
    
    .result-excerpt {
        color: #ccc !important;
    }
}

/* Loading state */
.search-wrapper.loading .search-button {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}
