/* استایل اصلی جستجوی ایمن سرا */

.imensara-search-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border: 2px solid #FFCD00;
    border-radius: 50px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 205, 0, 0.1);
}

.imensara-search-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(255, 205, 0, 0.3);
}

.imensara-search-trigger svg {
    width: 24px;
    height: 24px;
    stroke: #FFCD00;
}

.imensara-search-trigger .search-label {
    background: linear-gradient(90deg, #FFCD00, #ff8c00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

/* مودال */
.imensara-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.imensara-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
}

.imensara-modal-container {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
    border-radius: 16px;
    border: 1px solid rgba(255, 205, 0, 0.2);
    box-shadow: 0 0 60px rgba(255, 205, 0, 0.1);
    padding: 30px;
}

.imensara-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.imensara-modal-close:hover {
    color: #FFCD00;
    transform: rotate(90deg);
}

.imensara-modal-close svg {
    width: 28px;
    height: 28px;
}

/* جعبه جستجو */
.imensara-search-box {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 60px;
    padding: 8px 8px 8px 24px;
    border: 2px solid rgba(255, 205, 0, 0.2);
    transition: all 0.3s ease;
}

.imensara-search-box:focus-within {
    border-color: #FFCD00;
    box-shadow: 0 0 30px rgba(255, 205, 0, 0.15);
}

.imensara-search-icon svg {
    width: 22px;
    height: 22px;
    stroke: #FFCD00;
}

.imensara-search-input-wrapper {
    flex: 1;
    position: relative;
}

.imensara-search-input {
    width: 100%;
    padding: 14px 0;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 18px;
    outline: none;
}

.imensara-search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.imensara-typing-indicator {
    position: absolute;
    left: 0;
    bottom: -28px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 205, 0, 0.7);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.imensara-typing-indicator.active {
    opacity: 1;
}

.typing-text {
    color: #FFCD00;
}

.typing-cursor {
    animation: blink 1s step-end infinite;
    color: #FFCD00;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* دکمه صوتی */
.imensara-voice-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.imensara-voice-btn:hover {
    color: #FFCD00;
    background: rgba(255, 205, 0, 0.1);
}

.imensara-voice-btn.listening {
    color: #ff4444;
    animation: pulseGlow 1s ease infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.4); }
    50% { box-shadow: 0 0 30px 10px rgba(255, 68, 68, 0.1); }
}

/* نتایج */
.imensara-results {
    margin-top: 25px;
}

/* تب‌ها */
.imensara-tabs {
    display: flex;
    gap: 8px;
    padding: 0 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
}

.imensara-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.imensara-tab:hover {
    color: rgba(255, 255, 255, 0.8);
}

.imensara-tab.active {
    color: #FFCD00;
    border-bottom-color: #FFCD00;
}

/* کارت‌های نتایج */
.imensara-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px 2px;
}

.imensara-results-grid::-webkit-scrollbar {
    width: 6px;
}

.imensara-results-grid::-webkit-scrollbar-thumb {
    background: #FFCD00;
    border-radius: 10px;
}

.imensara-result-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

.imensara-result-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 205, 0, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.imensara-result-card .card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.imensara-result-card .card-content {
    padding: 14px 16px 16px;
}

.imensara-result-card .card-title {
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.imensara-result-card .card-description {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin-bottom: 10px;
}

.imensara-result-card .card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.imensara-result-card .card-price {
    color: #FFCD00;
    font-size: 16px;
    font-weight: 700;
}

.imensara-result-card .card-view-btn {
    padding: 6px 16px;
    background: #FFCD00;
    color: #1a1a1a;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.imensara-result-card .card-view-btn:hover {
    background: #ffffff;
    transform: scale(1.05);
}

/* بدون نتیجه */
.imensara-no-results {
    text-align: center;
    padding: 50px 20px;
    color: rgba(255, 255, 255, 0.5);
}

/* بارگذاری */
.imensara-loading .loader {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 205, 0, 0.1);
    border-top-color: #FFCD00;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

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

/* واکنش‌گرا */
@media (max-width: 768px) {
    .imensara-modal-container {
        padding: 20px;
    }
    
    .imensara-search-input {
        font-size: 15px;
    }
    
    .imensara-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .imensara-result-card .card-image {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .imensara-modal-container {
        padding: 16px;
    }
    
    .imensara-search-box {
        padding: 4px 4px 4px 12px;
    }
    
    .imensara-results-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .imensara-result-card .card-image {
        height: 100px;
    }
}