/**
 * استایل امکانات پیشرفته جستجو
 */

/* نمایش Grid/List */
.view-toggle {
    display: flex;
    gap: 8px;
    background: white;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.view-toggle button {
    padding: 8px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    color: #6b7280;
}

.view-toggle button:hover {
    background: #f3f4f6;
}

.view-toggle button.active {
    background: #667eea;
    color: white;
}

/* نتایج List */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.results-list .result-card {
    width: 100%;
    padding: 20px;
}

/* نتایج Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.results-grid .result-card {
    padding: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.results-grid .result-card h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.results-grid .result-card p {
    font-size: 14px;
    flex: 1;
}

/* Export Menu */
.export-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s;
}

.export-menu-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    direction: rtl;
}

.export-menu-content h3 {
    margin: 0 0 20px 0;
    color: #1f2937;
    font-size: 20px;
}

.export-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.export-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.export-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-2px);
}

.export-option i {
    font-size: 32px;
    color: #667eea;
}

.export-option span {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.export-close {
    width: 100%;
    padding: 12px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: background 0.2s;
}

.export-close:hover {
    background: #e5e7eb;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* فیلترهای پیشرفته */
.advanced-filters {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.advanced-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.advanced-filters-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1f2937;
}

.filter-toggle {
    background: #f3f4f6;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: background 0.2s;
}

.filter-toggle:hover {
    background: #e5e7eb;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.filter-group input[type="date"],
.filter-group input[type="number"],
.filter-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.filter-group input[type="date"]:focus,
.filter-group input[type="number"]:focus,
.filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-category-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-category-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.filter-category-item label {
    margin: 0;
    cursor: pointer;
    font-size: 14px;
    color: #6b7280;
}

.filter-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.filter-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.filter-btn-apply {
    background: #667eea;
    color: white;
}

.filter-btn-apply:hover {
    background: #5568d3;
}

.filter-btn-reset {
    background: #f3f4f6;
    color: #374151;
}

.filter-btn-reset:hover {
    background: #e5e7eb;
}

/* Auto-complete بهبود یافته */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 4px;
    display: none;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f3f4f6;
}

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

.suggestion-item:hover {
    background: #f9fafb;
}

.suggestion-item i {
    color: #9ca3af;
    font-size: 14px;
}

.suggestion-item span {
    color: #374151;
    font-size: 14px;
}

/* جستجوهای ترند */
.trending-searches {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.trending-searches h3 {
    margin: 0 0 16px 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trending-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.trending-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.trending-item:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.trending-item .trend-icon {
    margin-left: 6px;
    font-size: 12px;
}

/* تاریخچه جستجو */
.search-history {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.search-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.search-history-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1f2937;
}

.clear-history {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.clear-history:hover {
    background: #dc2626;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.history-item:hover {
    background: #f3f4f6;
}

.history-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.history-item-content i {
    color: #9ca3af;
}

.history-item-content span {
    color: #374151;
    font-size: 14px;
}

.history-item-actions {
    display: flex;
    gap: 8px;
}

.history-item-actions button {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.history-item-actions button:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Responsive */
@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .export-options {
        grid-template-columns: 1fr;
    }
    
    .filter-categories {
        flex-direction: column;
    }
    
    .trending-list {
        flex-direction: column;
    }
}
