/* צ'אטבוט חכם - עיצוב מודרני */

.chatbot-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    font-family: 'Heebo', 'Rubik', sans-serif;
    direction: rtl;
}

/* כפתור פתיחת הצ'אטבוט */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1FB4DA 0%, #20c997 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(31, 180, 218, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(31, 180, 218, 0.4);
}

.chatbot-toggle i {
    font-size: 24px;
    color: white;
    transition: transform 0.3s ease;
}

.chatbot-toggle:hover i {
    transform: scale(1.1);
}

/* אנימציה של הכפתור */
.chatbot-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0);
    transition: transform 0.3s ease;
}

.chatbot-toggle:hover::before {
    transform: scale(1);
}

/* חלון הצ'אטבוט */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(31, 180, 218, 0.1);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.chatbot-window.open {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

/* כותרת הצ'אטבוט */
.chatbot-header {
    background: linear-gradient(135deg, #1FB4DA 0%, #20c997 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.chatbot-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-subtitle {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

.chatbot-close {
    margin-right: auto;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* אזור ההודעות */
.chatbot-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8fafc;
    max-height: 320px;
}

.chatbot-message {
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
}

.chatbot-message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.message-avatar.bot {
    background: linear-gradient(135deg, #1FB4DA, #20c997);
    color: white;
}

.message-avatar.user {
    background: #e2e8f0;
    color: #64748b;
}

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
}

.message-content.bot {
    background: white;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.message-content.user {
    background: #1FB4DA;
    color: white;
}

/* אנימציית הקלדה */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* אזור הקלט */
.chatbot-input {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
    background: white;
}

.input-group {
    display: flex;
    gap: 8px;
}

.chatbot-input textarea {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    background: #f9fafb;
    transition: all 0.2s ease;
    direction: rtl;
}

.chatbot-input textarea:focus {
    outline: none;
    border-color: #1FB4DA;
    background: white;
    box-shadow: 0 0 0 3px rgba(31, 180, 218, 0.1);
}

.send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1FB4DA;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
    background: #20c997;
    transform: scale(1.05);
}

.send-button:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

/* הודעת ברוכים הבאים */
.welcome-message {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    text-align: center;
}

.welcome-message h5 {
    margin: 0 0 8px 0;
    color: #0369a1;
    font-size: 16px;
    font-weight: 600;
}

.welcome-message p {
    margin: 0;
    color: #075985;
    font-size: 13px;
    line-height: 1.4;
}

/* כפתורים מהירים */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.quick-action-btn {
    background: white;
    border: 1px solid #1FB4DA;
    color: #1FB4DA;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    background: #1FB4DA;
    color: white;
}

/* טופס איסוף פרטים */
.contact-form {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    border: 1px solid #e2e8f0;
}

.contact-form h6 {
    margin: 0 0 12px 0;
    color: #1e40af;
    font-size: 14px;
    font-weight: 600;
}

.form-field {
    margin-bottom: 12px;
}

.form-field label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: #374151;
    font-weight: 500;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: white;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    direction: rtl;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: #1FB4DA;
    box-shadow: 0 0 0 2px rgba(31, 180, 218, 0.1);
}

.submit-contact-btn {
    width: 100%;
    background: #1FB4DA;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.submit-contact-btn:hover:not(:disabled) {
    background: #20c997;
}

.submit-contact-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* הודעת הצלחה */
.success-message {
    background: #d1fae5;
    border: 1px solid #10b981;
    color: #065f46;
    padding: 12px;
    border-radius: 8px;
    margin: 12px 0;
    text-align: center;
    font-size: 13px;
}

/* הודעת שגיאה */
.error-message {
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    margin: 12px 0;
    text-align: center;
    font-size: 13px;
}

/* נקודה ירוקה להודעות לא נקראות */
.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* רספונסיביות */
@media (max-width: 768px) {
    .chatbot-container {
        left: 10px;
        bottom: 10px;
    }
    
    .chatbot-window {
        width: calc(100vw - 40px);
        max-width: 350px;
        height: 450px;
        left: -10px;
    }
    
    .chatbot-toggle {
        width: 55px;
        height: 55px;
    }
    
    .chatbot-toggle i {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 20px);
        left: -15px;
        bottom: 70px;
        height: 400px;
    }
    
    .chatbot-messages {
        max-height: 250px;
    }
}

/* סגנונות נוספים לחוויית משתמש משופרת */
.scroll-to-bottom {
    text-align: center;
    padding: 8px;
    background: rgba(31, 180, 218, 0.1);
    border-radius: 6px;
    margin: 8px 0;
    cursor: pointer;
    font-size: 12px;
    color: #1FB4DA;
    transition: background 0.2s ease;
}

.scroll-to-bottom:hover {
    background: rgba(31, 180, 218, 0.2);
}

/* אפקט עמעום כאשר הצ'אטבוט טוען */
.chatbot-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* סטיילים למידע על השירות */
.service-info {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
    font-size: 13px;
    color: #92400e;
}

.service-info strong {
    color: #78350f;
}