/**
 * Search Functionality Styles
 * Professional styling for search results overlay
 */

/* Search Results Overlay */
.search-results-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding-top: 50px;
    overflow-y: auto;
}

/* Search Results Container */
.search-results-container {
    background: #fff;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    margin: 20px;
}

/* Search Results Header */
.search-results-header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-results-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.search-results-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: #2c3e50;
}

/* Close Button */
.close-search-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.close-search-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Search Results Content */
#search-results-content {
    padding: 20px;
}

/* Search Results List */
.search-results-list {
    margin-top: 15px;
}

/* Individual Search Result Item */
.search-result-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 15px;
    background: #fff;
    transition: all 0.3s ease;
    position: relative;
}

.search-result-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
    transform: translateY(-2px);
}

.search-result-item:last-child {
    margin-bottom: 0;
}

/* Search Result Title */
.search-result-item h5 {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 600;
}

.search-result-item h5 a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.search-result-item h5 a:hover {
    color: #3498db;
}

/* Search Snippet */
.search-snippet {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 10px 0;
}

/* Search Matches */
.search-matches {
    margin: 15px 0;
}

.search-match-tag {
    display: inline-block;
    background: #ecf0f1;
    color: #2c3e50;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 8px;
    margin-bottom: 5px;
    border: 1px solid #bdc3c7;
}

/* Search Result Link */
.search-result-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;
}

.search-result-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* No Results */
.search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.search-no-results p:first-child {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.search-no-results p:last-child {
    font-size: 14px;
    color: #7f8c8d;
}

/* Enhanced Search Input Styling */
.dez-quik-search input[name="search"] {
    border: 2px solid #3498db;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.dez-quik-search input[name="search"]:focus {
    border-color: #2980b9;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

.dez-quik-search input[name="search"]::placeholder {
    color: #95a5a6;
    font-style: italic;
}

/* Search Button Enhancement */
.dez-quik-search button {
    background: #3498db;
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.dez-quik-search button:hover {
    background: #2980b9;
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-results-container {
        width: 95%;
        margin: 10px;
        max-height: 85vh;
    }
    
    .search-results-header {
        padding: 15px;
    }
    
    .search-results-header h3 {
        font-size: 20px;
    }
    
    #search-results-content {
        padding: 15px;
    }
    
    .search-result-item {
        padding: 15px;
    }
    
    .search-result-item h5 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .search-results-overlay {
        padding-top: 20px;
    }
    
    .search-results-container {
        width: 98%;
        margin: 5px;
    }
    
    .search-results-header {
        padding: 12px;
        flex-direction: column;
        text-align: center;
    }
    
    .close-search-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
    }
    
    .search-result-item {
        padding: 12px;
    }
    
    .search-match-tag {
        font-size: 11px;
        padding: 3px 6px;
    }
}

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

.search-result-item {
    animation: fadeInUp 0.3s ease forwards;
}

.search-result-item:nth-child(1) { animation-delay: 0.1s; }
.search-result-item:nth-child(2) { animation-delay: 0.2s; }
.search-result-item:nth-child(3) { animation-delay: 0.3s; }
.search-result-item:nth-child(4) { animation-delay: 0.4s; }
.search-result-item:nth-child(5) { animation-delay: 0.5s; }

/* Loading state */
.search-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.search-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #3498db;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}