/**
 * smart_search_styles.css - أنماط البحث الذكي والتفاعلي
 */

/* =====================
   SUGGESTIONS BOX
   ===================== */
.smart-suggestions {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: #fff;
    border: 2px solid var(--sg);
    border-top: none;
    border-radius: 0 0 var(--rs) var(--rs);
    box-shadow: 0 8px 24px rgba(0, 114, 41, 0.15);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    animation: slideDown 0.25s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.suggestions-list {
    padding: 8px 0;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--tr);
    border-left: 4px solid transparent;
    background: #fff;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: var(--sg-l);
    border-left-color: var(--sg);
    padding-left: 20px;
}

.suggestion-item i {
    color: var(--sg);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.suggestion-text {
    flex: 1;
    font-weight: 600;
    color: var(--sb);
    font-size: 0.95rem;
}

.suggestion-type {
    display: inline-block;
    background: var(--gold);
    color: var(--sb);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 8px;
}

.suggestions-loading,
.suggestions-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 16px;
    color: #999;
    font-size: 0.9rem;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid var(--sg-l);
    border-top-color: var(--sg);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================
   NOTIFICATIONS
   ===================== */
.smart-notifications {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

@media (max-width: 768px) {
    .smart-notifications {
        right: 10px;
        left: 10px;
        top: 70px;
    }
}

.smart-notification {
    min-width: 300px;
    max-width: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border-right: 5px solid var(--sg);
    overflow: hidden;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.smart-notification.show {
    opacity: 1;
    transform: translateX(0);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(400px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    color: var(--sb);
    font-weight: 600;
    font-size: 0.95rem;
}

.notification-success {
    background: linear-gradient(135deg, #e8f5e9, #fff8e1);
    border-right-color: #4caf50;
}

.notification-error {
    background: linear-gradient(135deg, #fce4ec, #fff8e1);
    border-right-color: #d32f2f;
}
.notification-error .notification-content {
    color: #d32f2f;
}

.notification-warning {
    background: linear-gradient(135deg, #fff3e0, #fff8e1);
    border-right-color: #ff9800;
}
.notification-warning .notification-content {
    color: #ff9800;
}

.notification-loading {
    background: linear-gradient(135deg, #e3f2fd, #fff8e1);
    border-right-color: var(--sg);
}
.notification-loading .notification-content {
    color: var(--sg);
}

.notification-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    display: flex;
    align-items: center;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.notification-close:hover {
    opacity: 1;
}

/* =====================
   TRENDING SEARCHES
   ===================== */
.trending-searches {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, var(--sg-l), #fff8e1);
    border-radius: var(--rs);
    border: 2px dashed var(--sg);
}

.trending-searches h4 {
    color: var(--sg);
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.trending-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.trending-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 2px solid var(--sg);
    color: var(--sg);
    padding: 8px 14px;
    border-radius: 20px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--tr);
    white-space: nowrap;
}

.trending-item:hover {
    background: var(--sg);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 114, 41, 0.25);
}

.trending-item i {
    font-size: 0.95rem;
}

.trending-item .count {
    display: inline-block;
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 4px;
}

.trending-item:hover .count {
    background: rgba(255, 255, 255, 0.3);
}

/* =====================
   SEARCH STATS BAR
   ===================== */
.search-stats-bar {
    background: linear-gradient(135deg, var(--sg), var(--sg2));
    color: #fff;
    padding: 14px 18px;
    border-radius: var(--rs);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    animation: slideDown 0.3s ease;
}

.search-stats-bar.show {
    animation: slideDown 0.3s ease;
}

/* =====================
   SIMPLE SEARCH ENHANCEMENTS
   ===================== */
.simple-big {
    position: relative;
}

.simple-big input {
    transition: all 0.2s ease;
}

.simple-big input:focus {
    box-shadow: 
        0 0 0 4px rgba(0, 114, 41, 0.1),
        inset 0 2px 8px rgba(0, 114, 41, 0.05);
}

.simple-big input::placeholder {
    color: #aaa;
    font-style: italic;
}

/* =====================
   FILTER CHIPS ENHANCED
   ===================== */
.qc {
    position: relative;
}

.qc::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.qc:active {
    transform: scale(0.98);
}

.qc.unavailable {
    opacity: 0.35;
    pointer-events: none;
    cursor: not-allowed;
    border-style: dashed;
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 768px) {
    .smart-suggestion {
        min-width: 100%;
        max-width: 100%;
    }

    .suggestions-list {
        max-height: 250px;
    }

    .trending-item {
        flex: 1;
        min-width: 80px;
    }
}

/* =====================
   LOADING ANIMATION
   ===================== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.searching {
    animation: pulse 1s ease-in-out infinite;
}

/* =====================
   INPUT FOCUS STATES
   ===================== */
.f-inp:focus,
.f-sel:focus {
    box-shadow: 
        0 0 0 4px rgba(0, 114, 41, 0.1),
        inset 0 2px 8px rgba(0, 114, 41, 0.05);
}

/* =====================
   SCROLL BAR STYLING
   ===================== */
.smart-suggestions::-webkit-scrollbar,
.suggestions-list::-webkit-scrollbar {
    width: 6px;
}

.smart-suggestions::-webkit-scrollbar-track,
.suggestions-list::-webkit-scrollbar-track {
    background: var(--bg);
}

.smart-suggestions::-webkit-scrollbar-thumb,
.suggestions-list::-webkit-scrollbar-thumb {
    background: var(--sg);
    border-radius: 3px;
}

.smart-suggestions::-webkit-scrollbar-thumb:hover,
.suggestions-list::-webkit-scrollbar-thumb:hover {
    background: var(--sg2);
}
