/* Chatbot Widget Styles */
.selcam-chatbot-widget {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.selcam-chatbot-widget.selcam-chatbot-bottom-right {
    /* Position will be set dynamically via JavaScript */
}

.selcam-chatbot-widget.selcam-chatbot-bottom-left {
    /* Position will be set dynamically via JavaScript */
}

.selcam-chatbot-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
    color: white;
    position: relative;
    overflow: visible;
}

.selcam-chatbot-icon {
    width: 28px;
    height: 28px;
    stroke: white;
    fill: none;
    animation: chatFloat 3s ease-in-out infinite;
}

.selcam-chatbot-icon-static {
    width: 28px;
    height: 28px;
    stroke: white;
    fill: none;
}

#selcam-chatbot-lottie-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
}

#selcam-chatbot-lottie-icon svg {
    width: 100%;
    height: 100%;
    min-width: 80px;
    min-height: 80px;
}

/* White filter for icon-chat.json */
.selcam-chatbot-lottie-white svg {
    filter: brightness(0) invert(1); /* Make icon white */
}

/* Original colors for chatbot.json */
.selcam-chatbot-lottie-original svg {
    filter: none; /* Keep original colors */
}

.selcam-chatbot-notification-dot {
    position: absolute;
    top: -6px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: #ff4757;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 0;
    animation: pulseNotification 2s ease-in-out infinite;
    z-index: 10;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(255, 71, 87, 0.4), 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Continuous floating animation */
@keyframes chatFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-5px) scale(1.05);
    }
}

/* Continuous pulse animation for notification dot */
@keyframes pulseNotification {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.3);
    }
}

/* Additional bounce animation every 15 seconds */
.selcam-chatbot-animate .selcam-chatbot-icon {
    animation: chatBounce 1s ease-in-out, chatFloat 3s ease-in-out infinite 1s;
}

.selcam-chatbot-pulse {
    animation: pulseDot 1.5s ease-in-out, pulseNotification 2s ease-in-out infinite 1.5s;
}

@keyframes chatBounce {
    0% {
        transform: translateY(0) scale(1) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) scale(1.2) rotate(-8deg);
    }
    50% {
        transform: translateY(-5px) scale(1.15) rotate(8deg);
    }
    75% {
        transform: translateY(-8px) scale(1.2) rotate(-5deg);
    }
    100% {
        transform: translateY(0) scale(1) rotate(0deg);
    }
}

@keyframes pulseDot {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    30% {
        opacity: 1;
        transform: scale(1.5);
    }
    60% {
        opacity: 0.8;
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.selcam-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.selcam-chatbot-container {
    position: absolute;
    right: 0;
    width: 380px;
    max-height: calc(100vh - 20px);
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    direction: rtl;
    /* Position will be set dynamically via JavaScript */
    backdrop-filter: blur(10px);
}

.selcam-chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}

.selcam-chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.selcam-chatbot-support-avatars {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.selcam-chatbot-support-avatars {
    display: flex;
    align-items: center;
}

.selcam-chatbot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    overflow: hidden;
    position: relative;
    margin-left: -22px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: white;
}

.selcam-chatbot-avatar:first-child {
    margin-left: 0;
}

.selcam-chatbot-avatar:hover {
    transform: scale(1.1);
    z-index: 2;
    border-color: rgba(255, 255, 255, 0.6);
}

.selcam-chatbot-avatar.active {
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
    z-index: 1;
}

.selcam-chatbot-avatar.online {
    border-color: rgba(74, 222, 128, 0.9);
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3), 0 2px 8px rgba(74, 222, 128, 0.2);
    animation: rippleOnline 2s ease-in-out infinite;
}

.selcam-chatbot-avatar.online::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 2px solid rgba(74, 222, 128, 0.6);
    animation: ripplePulse 2s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

.selcam-chatbot-avatar.online::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 2px solid rgba(74, 222, 128, 0.4);
    animation: ripplePulse 2s ease-in-out infinite 0.5s;
    pointer-events: none;
    z-index: -1;
}

.selcam-chatbot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

@keyframes rippleOnline {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.3), 0 2px 8px rgba(74, 222, 128, 0.2);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.15), 0 2px 8px rgba(74, 222, 128, 0.2);
    }
}

@keyframes ripplePulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.4;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.selcam-chatbot-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    padding-right: 8px;
}

.selcam-chatbot-header-title {
    font-size: 16px;
    opacity: 0.95;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selcam-chatbot-header-info h4 {
    margin: 0;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.85;
}

.selcam-chatbot-header-status {
    font-size: 10px;
    opacity: 0.8;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}



.selcam-chatbot-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    font-weight: 300;
    line-height: 1;
}

.selcam-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.selcam-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(to bottom, #fafbfc 0%, #f8f9fa 100%);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    display: flex;
    flex-direction: column;
}

.selcam-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.selcam-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.selcam-chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.selcam-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.selcam-chatbot-message {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.selcam-chatbot-message-user {
    justify-content: flex-end;
}

.selcam-chatbot-message-assistant {
    justify-content: flex-start;
}

.selcam-chatbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.selcam-chatbot-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.selcam-chatbot-message-user .selcam-chatbot-message-avatar {
    display: none;
}

.selcam-chatbot-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.6;
    font-size: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.selcam-chatbot-message-user .selcam-chatbot-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.selcam-chatbot-message-assistant .selcam-chatbot-message-content {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.selcam-chatbot-display-prompt-container {
    margin: 12px 0;
    display: flex;
    justify-content: center;
    width: 100%;
}

.selcam-chatbot-display-prompt-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    max-width: 90%;
    word-wrap: break-word;
    line-height: 1.5;
}

.selcam-chatbot-display-prompt-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.selcam-chatbot-display-prompt-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.selcam-chatbot-prompt-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.selcam-chatbot-prompt-text {
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.selcam-chatbot-message-system {
    margin: 10px 0;
    padding: 12px;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 8px;
    justify-content: center !important;
}

.selcam-chatbot-display-prompt-details {
    background: transparent !important;
    color: #1565c0;
    font-size: 14px;
    line-height: 1.6;
    padding: 0;
    max-width: 100% !important;
}

.selcam-chatbot-input-container {
    display: flex;
    padding: 16px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    gap: 8px;
    border-radius: 0 0 16px 16px;
}

.selcam-chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    direction: rtl;
    text-align: right;
    background: #f8f9fa;
}

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

.selcam-chatbot-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.selcam-chatbot-send {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    padding: 0;
}

.selcam-chatbot-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.selcam-chatbot-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Scrollbar styling */
.selcam-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.selcam-chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.selcam-chatbot-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.selcam-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive */
@media (max-width: 768px) {
    .selcam-chatbot-container {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        /* Position will be set dynamically via JavaScript */
    }
}

