/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

 /* Widget Styles */
 .whatsapp-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.widget-button {
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
}

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

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

.whatsapp-icon {
    width: 32px;
    height: 32px;
    fill: white;
}

.chat-popup {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: bottom right;
    overflow: hidden;
}

.chat-popup.active {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.chat-header {
    background: #128C7E;
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.agent-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="50" fill="%23e2e8f0"/><circle cx="50" cy="35" r="15" fill="%2394a3b8"/><path d="M20 80 Q20 65 35 65 L65 65 Q80 65 80 80 Z" fill="%2394a3b8"/></svg>');
    background-size: cover;
    position: relative;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.agent-avatar img{
    width: 100%;
    height: 100%;
    border-radius: 100%;
    object-fit: cover;
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #4ade80;
    border: 2px solid white;
    border-radius: 50%;
}

.agent-info h3 {
    font-size: 16px;
    margin-bottom: 2px;
    font-weight: 500;
    color: #fff;
}

.agent-status {
    font-size: 13px;
    opacity: 0.9;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
    transform: rotate(90deg);
}

.chat-body {
    padding: 0;
    min-height: 260px;
    background: #e5ddd5;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.chat-messages {
    padding: 20px 15px;
    flex: 1;
}

.message-time {
    text-align: center;
    color: #8696a0;
    font-size: 12px;
    margin-bottom: 15px;
    font-weight: 500;
}

.message {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    margin-bottom: 8px;
    max-width: 85%;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 12px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 8px solid white;
}

.message-text {
    font-size: 14px;
    line-height: 1.4;
    color: #303030;
    margin-bottom: 4px;
}

.message-timestamp {
    font-size: 11px;
    color: #8696a0;
    text-align: right;
}

.chat-input-container {
    padding: 12px 15px;
    background: #f0f0f0;
    border-top: 1px solid #d1d1d6;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 25px;
    padding: 8px 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    gap: 10px;
}

.message-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 8px 0;
    background: transparent;
    color: #303030;
}

.message-input::placeholder {
    color: #8696a0;
}

.send-button {
    background: #25D366;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-button:hover {
    background: #128C7E;
    transform: scale(1.1);
}

.send-button:disabled {
    background: #bbb;
    cursor: not-allowed;
    transform: scale(1);
}

.send-icon {
    width: 18px;
    height: 18px;
    fill: white;
}

.notification-badge {
    display: none;
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    margin-top: 8px;
    max-width: 120px;
}

.typing-indicator::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 12px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 8px solid rgba(255, 255, 255, 0.9);
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #8696a0;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

@media (max-width: 480px) {
    .chat-popup {
        width: calc(100vw - 40px);
        right: -10px;
    }
}

.emoji {
    font-size: 16px;
}