/* PayTrials Chatbot Widget Styles */

#paytrials-chat-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    z-index: 999999;
}

/* Chat Bubble (Closed State) */
.chat-bubble {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 70px;
    height: 70px;
    z-index: 999999 !important;
    background: linear-gradient(135deg, #00ff9d 0%, #00d4ff 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 
        0 0 20px rgba(0, 255, 157, 0.6),
        0 0 40px rgba(0, 255, 157, 0.4),
        0 0 60px rgba(0, 255, 157, 0.2),
        0 8px 24px rgba(0, 255, 157, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: #0a0e1a;
    animation: floatBubble 3s ease-in-out infinite, glowPulse 2s ease-in-out infinite;
}

.chat-bubble:hover {
    transform: translateY(-50%) translateY(-4px) scale(1.05);
    box-shadow: 
        0 0 30px rgba(0, 255, 157, 0.8),
        0 0 60px rgba(0, 255, 157, 0.6),
        0 0 90px rgba(0, 255, 157, 0.4),
        0 12px 32px rgba(0, 255, 157, 0.6);
    animation: floatBubble 3s ease-in-out infinite, glowPulseHover 1s ease-in-out infinite;
}

/* Floating Animation */
@keyframes floatBubble {
    0%, 100% {
        transform: translateY(-50%) translateY(0px);
    }
    50% {
        transform: translateY(-50%) translateY(-8px);
    }
}

/* Glow Pulse Animation */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(0, 255, 157, 0.6),
            0 0 40px rgba(0, 255, 157, 0.4),
            0 0 60px rgba(0, 255, 157, 0.2),
            0 8px 24px rgba(0, 255, 157, 0.4);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(0, 255, 157, 0.8),
            0 0 60px rgba(0, 255, 157, 0.6),
            0 0 90px rgba(0, 255, 157, 0.4),
            0 8px 24px rgba(0, 255, 157, 0.6);
    }
}

/* Glow Pulse on Hover */
@keyframes glowPulseHover {
    0%, 100% {
        box-shadow: 
            0 0 30px rgba(0, 255, 157, 0.8),
            0 0 60px rgba(0, 255, 157, 0.6),
            0 0 90px rgba(0, 255, 157, 0.4),
            0 12px 32px rgba(0, 255, 157, 0.6);
    }
    50% {
        box-shadow: 
            0 0 40px rgba(0, 255, 157, 1),
            0 0 80px rgba(0, 255, 157, 0.8),
            0 0 120px rgba(0, 255, 157, 0.6),
            0 12px 32px rgba(0, 255, 157, 0.8);
    }
}

.chat-bubble svg {
    width: 28px;
    height: 28px;
}

/* Shimmer Effect */
.chat-bubble::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    border-radius: 50%;
    animation: shimmer 3s ease-in-out infinite;
    animation-delay: 1s;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

/* Pulse Animation */
.pulse-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    background: #ff4444;
    border-radius: 50%;
    border: 2px solid #ffffff;
    animation: pulseNotification 1.5s infinite;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.8);
}

@keyframes pulseNotification {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 10px rgba(255, 68, 68, 0.8);
    }
    50% {
        transform: scale(1.3);
        opacity: 0.8;
        box-shadow: 0 0 20px rgba(255, 68, 68, 1);
    }
}

/* Chat Window (Open State) */
.chat-window {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 400px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 100px);
    background: linear-gradient(135deg, rgba(26, 31, 58, 0.98) 0%, rgba(15, 20, 32, 0.98) 100%);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 2px solid rgba(0, 255, 157, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
    z-index: 999998;
}

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

/* Header */
.chat-header {
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.15) 0%, rgba(0, 212, 255, 0.15) 100%);
    border-bottom: 1px solid rgba(0, 255, 157, 0.2);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-icon {
    font-size: 1.5rem;
}

.header-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

.header-subtitle {
    font-size: 0.85rem;
    color: #00ff9d;
}

.close-btn {
    background: none;
    border: none;
    color: #b0b8cc;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.close-btn:hover {
    color: #ff4444;
    transform: rotate(90deg);
}

/* Messages Container */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 157, 0.3);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 157, 0.5);
}

/* Message Styles */
.message {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease-out;
}

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

.message-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #00ff9d 0%, #00d4ff 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.message-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 12px 16px;
    color: #ffffff;
    line-height: 1.5;
}

.message-content p {
    margin: 0 0 8px 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

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

.user-message .message-content {
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.2) 0%, rgba(0, 212, 255, 0.2) 100%);
    border: 1px solid rgba(0, 255, 157, 0.3);
}

/* Quick Buttons */
.quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.quick-btn {
    background: rgba(0, 255, 157, 0.1);
    border: 1px solid rgba(0, 255, 157, 0.3);
    color: #00ff9d;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-btn:hover {
    background: rgba(0, 255, 157, 0.2);
    border-color: #00ff9d;
    transform: translateY(-2px);
}

/* Typing Indicator */
.typing-indicator .message-content {
    width: fit-content;
    padding: 16px 20px;
}

.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #00ff9d;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Container */
.chat-input-container {
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid rgba(0, 255, 157, 0.2);
    display: flex;
    gap: 12px;
}

#chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(0, 255, 157, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    color: #ffffff;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

#chat-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: #00ff9d;
}

#chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#chat-input::placeholder {
    color: #7a82a0;
}

.send-btn {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #00ff9d 0%, #00d4ff 100%);
    border: none;
    border-radius: 12px;
    color: #0a0e1a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 255, 157, 0.4);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Footer */
.chat-footer {
    padding: 0.75rem 1.25rem;
    background: rgba(0, 0, 0, 0.3);
    text-align: center;
    font-size: 0.75rem;
    color: #7a82a0;
}

.chat-footer a {
    color: #00ff9d;
    text-decoration: none;
}

.chat-footer a:hover {
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-window {
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }

    .chat-bubble {
        bottom: 20px;
        right: 20px;
        top: auto;
        transform: none;
        width: 64px;
        height: 64px;
        animation: floatBubbleMobile 3s ease-in-out infinite, glowPulse 2s ease-in-out infinite;
    }
    
    .chat-bubble:hover {
        transform: translateY(-4px) scale(1.05);
    }
    
    @keyframes floatBubbleMobile {
        0%, 100% {
            transform: translateY(0px);
        }
        50% {
            transform: translateY(-8px);
        }
    }

    .chat-bubble svg {
        width: 26px;
        height: 26px;
    }
}

/* Link Styling in Messages */
.message-content a {
    color: #00d4ff;
    text-decoration: underline;
}

.message-content a:hover {
    color: #00ff9d;
}

/* Strong Text */
.message-content strong {
    color: #00ff9d;
    font-weight: 700;
}