/**
 * Search Modal Styles
 * AgenWebsite Theme
 * Version: 1.0.0
 */

/* Search Modal Overlay */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 22, 40, 0.95);
    display: none;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Search Modal Content */
.search-modal-content {
    width: 90%;
    max-width: 800px;
    position: relative;
    animation: slideDownFade 0.4s ease;
}

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

/* Search Close Button */
.search-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 10px;
    transition: all 0.3s ease;
    z-index: 10;
}

.search-close:hover {
    transform: rotate(90deg);
    opacity: 0.8;
}

/* Search Container */
.search-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Search Input Wrapper */
.search-input-wrapper {
    position: relative;
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.search-icon {
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 20px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 18px 60px 18px 60px;
    font-size: 18px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--text-dark);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 102, 0, 0.1);
}

.search-input::placeholder {
    color: #adb5bd;
    font-weight: 400;
}

/* Search Spinner */
.search-spinner {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 20px;
    display: none;
}

.search-spinner.active {
    display: block;
}

/* Search Results */
.search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: white;
}

.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

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

.search-no-results i {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 15px;
    display: block;
}

.search-no-results p {
    font-size: 16px;
    margin: 0;
}

/* Search Result Categories */
.search-category {
    margin-bottom: 25px;
}

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

.search-category-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6c757d;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

/* Search Result Items */
.search-result-item {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.search-result-item:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

.search-result-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.search-result-item:hover::before {
    transform: translateX(0);
}

/* Result Thumbnail */
.search-result-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-result-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-thumbnail.no-image {
    background: var(--primary-color);
    opacity: 0.1;
}

.search-result-thumbnail.no-image i {
    font-size: 24px;
    color: var(--primary-color);
    opacity: 1;
}

/* Result Content */
.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-excerpt {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #adb5bd;
}

.search-result-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.search-result-meta i {
    font-size: 11px;
}

/* Result Badge */
.search-result-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.search-result-badge.page {
    background: var(--secondary-color);
}

.search-result-badge.product {
    background: #28a745;
}

.search-result-badge.plugin {
    background: #6f42c1;
}

/* Product Price */
.search-result-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 4px;
}

/* Search Suggestions */
.search-suggestions {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.search-suggestions-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 10px;
}

.search-suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-suggestion-tag {
    padding: 6px 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.search-suggestion-tag:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* View All Results */
.search-view-all {
    display: block;
    text-align: center;
    padding: 15px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-view-all:hover {
    background: #e55a00;
    color: white;
}

/* Loading State */
.search-loading {
    text-align: center;
    padding: 40px 20px;
}

.search-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Highlight Search Term */
.search-highlight {
    background: #ffeaa7;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-modal-content {
        width: 95%;
    }

    .search-input-wrapper {
        padding: 20px;
    }

    .search-input {
        font-size: 16px;
        padding: 15px 50px;
    }

    .search-icon {
        left: 35px;
        font-size: 18px;
    }

    .search-spinner {
        right: 35px;
        font-size: 18px;
    }

    .search-close {
        top: 10px;
        right: 10px;
        font-size: 28px;
        position: fixed;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .search-result-thumbnail {
        width: 50px;
        height: 50px;
    }

    .search-result-title {
        font-size: 15px;
    }

    .search-result-excerpt {
        font-size: 13px;
    }
}