/* ========================================
   SEARCH MODAL - PREMIUM DESIGN
   ======================================== */

/* Modal Overlay */
.search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-modal-overlay.active {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.search-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 480px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    opacity: 0;
}

.search-modal.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .search-modal {
        width: 95%;
        max-width: 100%;
        border-radius: 12px;
        max-height: 85vh;
        top: 50%;
        transform: translate(-50%, -50%) scale(0.95);
    }

    .search-modal.active {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Search Input Area */
.search-modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-modal-header.mobile {
    padding: 16px;
    gap: 10px;
}

.search-modal-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-modal-icon {
    color: #9ca3af;
    font-size: 14px;
    position: absolute;
    left: 10px;
    pointer-events: none;
}

.search-modal-input {
    width: 100%;
    padding: 8px 10px 8px 36px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
    background: #f9fafb;
}

.search-modal-input:focus {
    outline: none;
    border-color: #2576E6;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 118, 230, 0.1);
}

.search-modal-close {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.search-modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

/* Suggestions Area */
.search-modal-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    opacity: 1;
    transition: opacity 0.1s ease;
}

.search-modal-suggestions {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-suggestion-item:nth-child(1) { animation-delay: 0.05s; }
.search-suggestion-item:nth-child(2) { animation-delay: 0.1s; }
.search-suggestion-item:nth-child(3) { animation-delay: 0.15s; }
.search-suggestion-item:nth-child(4) { animation-delay: 0.2s; }
.search-suggestion-item:nth-child(5) { animation-delay: 0.25s; }
.search-suggestion-item:nth-child(6) { animation-delay: 0.3s; }
.search-suggestion-item:nth-child(7) { animation-delay: 0.35s; }
.search-suggestion-item:nth-child(8) { animation-delay: 0.4s; }

.search-modal-placeholder {
    padding: 30px 16px 16px;
    text-align: center;
    color: #9ca3af;
}

.search-modal-placeholder-icon {
    font-size: 40px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.search-modal-placeholder-text {
    font-size: 13px;
    color: #6b7280;
}

/* Suggestion Item */
.search-suggestion-item {
    padding: 8px 14px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #374151;
    font-size: 13px;
    animation: fadeInUp 0.3s ease backwards;
}

.search-suggestion-item:hover {
    background: #f9fafb;
    color: #2576E6;
}

.search-suggestion-item.active {
    background: #eff6ff;
    color: #2576E6;
    font-weight: 600;
}

.search-suggestion-icon {
    color: #d1d5db;
    font-size: 12px;
    min-width: 14px;
}

.search-suggestion-item:hover .search-suggestion-icon {
    color: #2576E6;
}

.search-suggestion-text {
    flex: 1;
    line-height: 1.3;
}

.search-suggestion-category {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 1px;
}

.search-suggestion-arrow {
    color: #d1d5db;
    font-size: 12px;
    opacity: 0;
    transition: all 0.2s ease;
}

.search-suggestion-item:hover .search-suggestion-arrow {
    opacity: 1;
    color: #2576E6;
}

/* Popular & Recent Section */
.search-modal-section {
    padding: 10px 16px;
}

.search-modal-section-title {
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.search-modal-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.search-modal-quick-link {
    display: inline-block;
    padding: 5px 10px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.search-modal-quick-link:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
    color: #111827;
}

.search-modal-quick-link.active {
    background: #2576E6;
    border-color: #2576E6;
    color: #ffffff;
}

/* No Results */
.search-modal-no-results {
    padding: 30px 16px;
    text-align: center;
}

.search-modal-no-results-icon {
    font-size: 40px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.search-modal-no-results-text {
    font-size: 13px;
    color: #6b7280;
}

/* Loading State */
.search-modal-loading {
    padding: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.search-modal-loading-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #2576E6;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.search-modal-loading-text {
    font-size: 13px;
    color: #6b7280;
}

/* Scrollbar Styling */
.search-modal-content::-webkit-scrollbar {
    width: 6px;
}

.search-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.search-modal-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.search-modal-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .search-modal-header {
        padding: 10px;
        gap: 6px;
    }

    .search-modal-input {
        padding: 8px 8px 8px 32px;
        font-size: 14px;
    }

    .search-modal-icon {
        font-size: 13px;
        left: 8px;
    }

    .search-modal-close {
        width: 24px;
        height: 24px;
        font-size: 18px;
    }

    .search-suggestion-item {
        padding: 7px 12px;
        gap: 8px;
        font-size: 12px;
    }

    .search-modal-section {
        padding: 8px 12px;
    }

    .search-modal-quick-link {
        padding: 4px 8px;
        font-size: 11px;
    }

    .search-modal-placeholder-icon {
        font-size: 36px;
        margin-bottom: 6px;
    }

    .search-modal-placeholder-text {
        font-size: 12px;
    }
}

/* Popular Categories Section */
.search-modal-categories {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 12px 16px;
}

.search-modal-category-item {
    padding: 10px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #0369a1;
    font-weight: 500;
    font-size: 12px;
}

.search-modal-category-item:hover {
    background: linear-gradient(135deg, #e0f2fe 0%, #cffafe 100%);
    border-color: #7dd3fc;
    color: #0c4a6e;
}

@media (max-width: 640px) {
    .search-modal-categories {
        grid-template-columns: repeat(3, 1fr);
        padding: 10px 12px;
        gap: 5px;
    }

    .search-modal-category-item {
        padding: 8px;
        font-size: 11px;
    }
}
