/* WhatsApp Floating Live Chat Widget styling */

:root {
    --wa-green: #25d366;
    --wa-green-dark: #128c7e;
    --wa-accent: #075e54;
    --wa-bg-glass: rgba(18, 18, 18, 0.85);
    --wa-text-white: #ffffff;
    --wa-text-muted: rgba(255, 255, 255, 0.6);
    --wa-border-glass: rgba(255, 255, 255, 0.1);
    --bubble-customer: #128c7e;
    --bubble-agent: rgba(255, 255, 255, 0.12);
}

/* Float Bubble Button */
.wa-widget-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: var(--wa-green);
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wa-widget-bubble:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 28px rgba(37, 211, 102, 0.5);
}

.wa-widget-bubble svg {
    width: 32px;
    height: 32px;
    fill: #fff;
}

/* Pulsing Notification Dot */
.wa-widget-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background-color: #ff3b30;
    border-radius: 50%;
    border: 2px solid #fff;
    display: none;
    animation: wa-pulse 2s infinite;
}

@keyframes wa-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 59, 48, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
    }
}

/* Chat Card Container (Glassmorphic) */
.wa-widget-card {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 520px;
    max-height: calc(100vh - 140px);
    background: var(--wa-bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--wa-border-glass);
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.wa-widget-card.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Header */
.wa-widget-header {
    background: linear-gradient(135deg, var(--wa-green-dark), var(--wa-accent));
    padding: 18px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.wa-widget-avatar-container {
    position: relative;
    width: 44px;
    height: 44px;
    margin-right: 15px;
}

.wa-widget-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.25);
    font-family: 'Outfit', 'Inter', sans-serif;
}

.wa-widget-status-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: var(--wa-green);
    border: 2px solid var(--wa-green-dark);
    border-radius: 50%;
    transition: background-color 0.3s;
}

.wa-widget-status-dot.offline {
    background: #ff9500;
}

.wa-widget-profile-info {
    flex-grow: 1;
}

.wa-widget-name {
    color: var(--wa-text-white);
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 2px 0;
    font-family: 'Outfit', 'Inter', sans-serif;
}

.wa-widget-status-text {
    color: var(--wa-text-muted);
    font-size: 11px;
    margin: 0;
    font-family: 'Inter', sans-serif;
}

.wa-widget-close {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    transition: background 0.2s;
}

.wa-widget-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Chat Body (Scrollable Messages Viewport) */
.wa-widget-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-image: radial-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 20px 20px;
    scroll-behavior: smooth;
}

/* Scrollbar Styling */
.wa-widget-body::-webkit-scrollbar {
    width: 5px;
}

.wa-widget-body::-webkit-scrollbar-track {
    background: transparent;
}

.wa-widget-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.wa-widget-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* General Message Bubble */
.wa-widget-msg {
    max-width: 80%;
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.45;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    animation: wa-bubble-appear 0.25s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
}

@keyframes wa-bubble-appear {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Agent Message Bubble (Left Side) */
.wa-widget-msg.agent {
    align-self: flex-start;
    background: var(--bubble-agent);
    color: #f1f1f1;
    border-radius: 14px 14px 14px 4px;
    border-left: 3px solid var(--wa-green);
}

/* Customer Message Bubble (Right Side) */
.wa-widget-msg.customer {
    align-self: flex-end;
    background: var(--bubble-customer);
    color: #ffffff;
    border-radius: 14px 14px 4px 14px;
}

/* System Message / Status Bubble */
.wa-widget-msg.system {
    align-self: center;
    max-width: 90%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--wa-text-muted);
    border-radius: 8px;
    font-size: 11px;
    padding: 6px 12px;
    text-align: center;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

/* Registration Form View */
.wa-widget-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 10px 5px;
    margin: auto 0;
}

.wa-widget-form-title {
    font-family: 'Outfit', 'Inter', sans-serif;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 4px 0;
    text-align: center;
}

.wa-widget-form-desc {
    font-family: 'Inter', sans-serif;
    color: var(--wa-text-muted);
    font-size: 12.5px;
    margin: 0 0 10px 0;
    text-align: center;
    line-height: 1.4;
}

.wa-widget-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.wa-widget-label {
    color: var(--wa-text-muted);
    font-size: 11.5px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    padding-left: 2px;
}

.wa-widget-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 11px 14px;
    color: #fff;
    font-size: 13.5px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.2s;
}

.wa-widget-input:focus {
    border-color: var(--wa-green);
    background: rgba(255, 255, 255, 0.08);
}

.wa-widget-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

/* Footer / Message Input Panel */
.wa-widget-footer {
    padding: 14px 20px 18px 20px;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
}

.wa-widget-input-panel {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    width: 100%;
}

.wa-widget-textarea {
    flex-grow: 1;
    height: 42px;
    min-height: 42px;
    max-height: 100px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 11px 16px;
    color: #fff;
    font-size: 13.5px;
    resize: none;
    font-family: 'Inter', sans-serif;
    outline: none;
    box-sizing: border-box;
    transition: border 0.3s;
    line-height: 1.4;
}

.wa-widget-textarea:focus {
    border-color: var(--wa-green);
    background: rgba(255, 255, 255, 0.08);
}

.wa-widget-textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.wa-widget-send-btn {
    background: var(--wa-green);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.25);
    transition: all 0.2s;
    flex-shrink: 0;
}

.wa-widget-send-btn:hover {
    background: #20ba59;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    transform: scale(1.05);
}

.wa-widget-send-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transform: translateX(1px);
}

/* Form Submit Button */
.wa-widget-start-btn {
    width: 100%;
    background: var(--wa-green);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Outfit', 'Inter', sans-serif;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.2);
    transition: all 0.2s;
    margin-top: 8px;
}

.wa-widget-start-btn:hover {
    background: #20ba59;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
    transform: translateY(-1px);
}
