/* NBOM Smart Floating Action Buttons */
/* شناسه تغییر: NBOM-OPTIMIZE-004 */

/* مخفی کردن دکمه‌های قدیمی */
#pricing-fab,
#pricing-tooltip,
#nbom-pricing-bar {
    display: none !important;
}

/* مخفی کردن هر دکمه شناور قدیمی */
[onclick*="togglePricingBar"],
[onclick*="openChat"] {
    display: none !important;
}

/* مخفی کردن تمام دکمه‌های شناور غیر از دکمه‌های جدید */
[style*="position: fixed"][style*="bottom"]:not(.fab-button):not(.floating-buttons-container) {
    display: none !important;
}

/* مخفی کردن دکمه‌های با emoji الماس */
[style*="position: fixed"]:has-text("💎") {
    display: none !important;
}

/* مخفی کردن تمام دکمه‌های شناور غیر از دکمه‌های جدید */
div[style*="position: fixed"][style*="bottom"]:not(.fab-button):not(.floating-buttons-container) {
    display: none !important;
}

/* مخفی کردن دکمه‌های با z-index بالا */
[style*="z-index: 9999"]:not(.fab-button) {
    display: none !important;
}

/* مخفی کردن دکمه‌های با background gradient */
[style*="background: linear-gradient"]:not(.fab-button) {
    display: none !important;
}

/* مخفی کردن تمام دکمه‌های شناور غیر از دکمه‌های جدید */
*[style*="position: fixed"][style*="bottom"]:not(.fab-button):not(.floating-buttons-container) {
    display: none !important;
}

/* مخفی کردن دکمه‌های با border-radius 50% */
[style*="border-radius: 50%"]:not(.fab-button) {
    display: none !important;
}

/* مخفی کردن دکمه‌های با width و height مشخص */
[style*="width: 60px"][style*="height: 60px"]:not(.fab-button) {
    display: none !important;
}

/* مخفی کردن تمام دکمه‌های شناور غیر از دکمه‌های جدید */
*[style*="position: fixed"]:not(.fab-button):not(.floating-buttons-container) {
    display: none !important;
}

/* مخفی کردن دکمه‌های با box-shadow */
[style*="box-shadow"]:not(.fab-button) {
    display: none !important;
}

/* مخفی کردن دکمه‌های با cursor pointer */
[style*="cursor: pointer"]:not(.fab-button) {
    display: none !important;
}

/* مخفی کردن تمام دکمه‌های شناور غیر از دکمه‌های جدید */
*[style*="position: fixed"]:not(.fab-button):not(.floating-buttons-container) {
    display: none !important;
}

/* مخفی کردن دکمه‌های با transition */
[style*="transition"]:not(.fab-button) {
    display: none !important;
}

/* مخفی کردن دکمه‌های با font-size */
[style*="font-size"]:not(.fab-button) {
    display: none !important;
}

/* مخفی کردن تمام دکمه‌های شناور غیر از دکمه‌های جدید */
*[style*="position: fixed"]:not(.fab-button):not(.floating-buttons-container) {
    display: none !important;
}

/* مخفی کردن دکمه‌های با color white */
[style*="color: white"]:not(.fab-button) {
    display: none !important;
}

/* مخفی کردن دکمه‌های با display flex */
[style*="display: flex"]:not(.fab-button) {
    display: none !important;
}

/* Smart Floating Buttons Container */
.floating-buttons-container {
    position: fixed;
    bottom: 120px; /* تغییر از 80px به 120px */
    left: 20px; /* تغییر از right به left */
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 10000;
    transition: all 0.3s ease;
}

/* Base FAB Button */
.fab-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.fab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.fab-button:hover::before {
    transform: translateX(100%);
}

.fab-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
}

.fab-button:active {
    transform: translateY(-1px) scale(0.98);
}

/* Contact FAB */
.contact-fab {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.contact-fab:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* WhatsApp FAB */
.whatsapp-fab {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
}

.whatsapp-fab:hover {
    background: linear-gradient(135deg, #20c05a 0%, #0f7a6b 100%);
}

/* AI Assistant FAB */
.ai-fab {
    background: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 100%);
    color: white;
}

.ai-fab:hover {
    background: linear-gradient(135deg, #ff5252 0%, #3bb5b5 100%);
}

/* Tooltip Styles */
.fab-button[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 70px; /* تغییر از right به left */
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Vazirmatn', sans-serif;
    white-space: nowrap;
    z-index: 10001;
    animation: tooltipFadeIn 0.3s ease;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-10px); /* تغییر از 10px به -10px */
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .floating-buttons-container {
        bottom: 110px; /* تغییر از 75px به 110px */
        left: 15px; /* تغییر از right به left */
        gap: 12px;
    }
    
    .fab-button {
        width: 50px;
        height: 50px;
    }
    
    .fab-button svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .floating-buttons-container {
        bottom: 100px; /* تغییر از 70px به 100px */
        left: 10px; /* تغییر از right به left */
        gap: 10px;
    }
    
    .fab-button {
        width: 48px;
        height: 48px;
    }
    
    .fab-button svg {
        width: 18px;
        height: 18px;
    }
}

/* Animation for button appearance */
.fab-button {
    animation: fabSlideIn 0.5s ease-out;
}

.fab-button:nth-child(1) { animation-delay: 0.1s; }
.fab-button:nth-child(2) { animation-delay: 0.2s; }
.fab-button:nth-child(3) { animation-delay: 0.3s; }

@keyframes fabSlideIn {
    from {
        opacity: 0;
        transform: translateX(-100px) scale(0.5); /* تغییر از 100px به -100px */
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Pulse animation for AI button */
.ai-fab {
    animation: aiPulse 2s infinite;
}

@keyframes aiPulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(255, 107, 107, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(255, 107, 107, 0.6), 0 0 0 10px rgba(255, 107, 107, 0.1);
    }
}

/* NBOM Pricing System Styles */
/* شناسه تغییر: NBOM-PRICING-BAR-002 */

/* انیمیشن‌های اضافی */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.8);
    }
}

/* سوالات سریع */
.quick-questions {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.quick-questions-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 14px;
}

.quick-questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.quick-question-btn {
    padding: 8px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 12px;
    color: #333;
    transition: all 0.3s ease;
    text-align: center;
}

.quick-question-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
}

/* بهبود پیام‌های چت */
.message {
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
}

.user-message {
    background: #667eea;
    color: white;
    margin-left: auto;
    text-align: right;
}

.bot-message {
    background: #f1f3f4;
    color: #333;
    margin-right: auto;
    text-align: right;
}

/* بهبود فرمت‌بندی متن */
.message strong {
    color: #667eea;
    font-weight: 600;
}

.message a {
    color: #667eea;
    text-decoration: underline;
}

.message a:hover {
    color: #5a6fd8;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* بهبود استایل نوار قیمت‌گذاری */
#nbom-pricing-bar {
    animation: slideIn 0.5s ease-out;
}

#pricing-fab {
    animation: pulse-glow 2s infinite;
}

#pricing-fab:hover {
    animation: none;
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

/* بهبود استایل چت */
#nbom-chat {
    animation: fadeIn 0.3s ease-out;
}

/* استایل‌های اضافی برای موبایل */
@media (max-width: 480px) {
    #nbom-pricing-bar {
        width: 280px;
        left: 5px;
        top: 5px;
    }
    
    #nbom-chat {
        width: 320px;
        height: 400px;
        right: 10px;
        bottom: 10px;
    }
    
    #pricing-fab {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 20px;
    }
}

/* استایل‌های تاریک */
@media (prefers-color-scheme: dark) {
    #nbom-chat {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .chat-messages {
        background: #2d2d2d;
    }
    
    .chat-input {
        border-top-color: #444;
    }
    
    #chat-input-field {
        background: #333;
        color: #fff;
        border-color: #555;
    }
    
    .bot-message {
        background: #333;
        color: #fff;
        border-color: #555;
    }
}

/* بهبود accessibility */
@media (prefers-reduced-motion: reduce) {
    #nbom-pricing-bar,
    #nbom-chat,
    #pricing-fab {
        animation: none;
    }
}

/* استایل‌های چاپ */
@media print {
    #nbom-pricing-bar,
    #nbom-chat,
    #pricing-fab,
    #pricing-tooltip {
        display: none !important;
    }
}

/* بهبود focus states */
#product-search:focus,
#chat-input-field:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

#search-btn:focus,
#send-message:focus,
#chat-btn:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* استایل‌های loading */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* استایل‌های notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10002;
    font-family: 'Vazirmatn', sans-serif;
    animation: slideIn 0.3s ease-out;
}

.notification.error {
    background: #f44336;
}

.notification.warning {
    background: #ff9800;
}

.notification.info {
    background: #2196F3;
}

/* استایل‌های پیشرفته برای قیمت */
.price-breakdown {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
    font-size: 12px;
}

.price-breakdown .row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.price-breakdown .label {
    opacity: 0.8;
}

.price-breakdown .value {
    font-weight: 600;
}

/* استایل‌های پیشرفته برای محصولات */
.product-category {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    margin-right: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-category.microscope {
    background: #FF6B6B;
}

.product-category.lens {
    background: #4ECDC4;
}

.product-category.optical {
    background: #45B7D1;
}

/* استایل‌های پیشرفته برای چت */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px;
    color: #666;
    font-style: italic;
}

.typing-indicator::after {
    content: '...';
    animation: typing 1.5s infinite;
}

@keyframes typing {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* استایل‌های پیشرفته برای دکمه‌ها */
.gradient-button {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gradient-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.gradient-button:hover::before {
    left: 100%;
}

.gradient-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* استایل‌های پیشرفته برای کارت‌ها */
.pricing-card {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 20px;
    margin: 10px 0;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* استایل‌های پیشرفته برای فیلدهای ورودی */
.modern-input {
    background: rgba(255,255,255,0.9);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 12px 16px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
    width: 100%;
}

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

.modern-input::placeholder {
    color: #999;
    font-style: italic;
}
