/* ============================================================
   Smart Search Styles
   ============================================================ */

.search-container {
    position: relative;
    width: 100%;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.3s ease;
    padding: 8px 12px;
}

.search-input-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    color: #94a3b8;
    margin-right: 8px;
    font-size: 18px;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: #1e293b;
}

.search-input::placeholder {
    color: #cbd5e1;
}

.search-clear-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}

.search-clear-btn:hover {
    color: #667eea;
}

/* Search Dropdown */
.search-suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-suggestions-dropdown.active {
    display: block;
}

.search-suggestions-group {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.search-suggestions-group:last-child {
    border-bottom: none;
}

.search-suggestions-group-title {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    color: inherit;
}

.search-suggestion-item:hover {
    background-color: #f8fafc;
}

.search-suggestion-item.did-you-mean {
    background-color: #fef3c7;
}

.search-suggestion-item.did-you-mean:hover {
    background-color: #fde68a;
}

.search-suggestion-icon {
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-size: 16px;
    flex-shrink: 0;
}

.search-suggestion-content {
    flex: 1;
    min-width: 0;
}

.search-suggestion-text {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-suggestion-subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

.search-suggestion-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #f1f5f9;
    color: #667eea;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

.search-suggestion-badge.trending {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.search-suggestion-badge.popular {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Search Loading State */
.search-loading {
    padding: 16px 12px;
    text-align: center;
    color: #94a3b8;
}

.search-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

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

/* Search Empty State */
.search-empty {
    padding: 24px 12px;
    text-align: center;
    color: #94a3b8;
}

.search-empty-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* Recent Searches */
.search-recent-searches {
    padding: 12px;
}

.search-recent-label {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.search-recent-item {
    display: inline-block;
    padding: 4px 12px;
    background: #f1f5f9;
    border-radius: 16px;
    font-size: 12px;
    color: #667eea;
    text-decoration: none;
    margin-right: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.search-recent-item:hover {
    background: #667eea;
    color: white;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .search-suggestions-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 12px 12px 0 0;
        max-height: 60vh;
    }

    .search-suggestion-item {
        padding: 12px 16px;
    }

    .search-suggestion-text {
        font-size: 15px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .search-input-wrapper {
        background: #1e293b;
        border-color: #334155;
    }

    .search-input {
        color: #e2e8f0;
    }

    .search-input::placeholder {
        color: #64748b;
    }

    .search-icon {
        color: #64748b;
    }

    .search-suggestions-dropdown {
        background: #1e293b;
        border-color: #334155;
    }

    .search-suggestions-group {
        border-bottom-color: #334155;
    }

    .search-suggestions-group-title {
        color: #64748b;
    }

    .search-suggestion-item {
        color: #e2e8f0;
    }

    .search-suggestion-item:hover {
        background-color: #334155;
    }

    .search-suggestion-icon {
        background: #334155;
        color: #667eea;
    }

    .search-suggestion-text {
        color: #e2e8f0;
    }

    .search-suggestion-subtitle {
        color: #64748b;
    }

    .search-suggestion-badge {
        background: #334155;
        color: #667eea;
    }

    .search-empty-icon {
        opacity: 0.3;
    }
}

/* Analytics Dashboard */
.search-analytics-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    padding: 24px;
}

.search-analytics-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.search-analytics-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
}

.search-analytics-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.search-analytics-item-label {
    font-size: 14px;
    color: #64748b;
    flex: 1;
}

.search-analytics-item-value {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
}

.search-analytics-item-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}
