/* WhatsApp Widget - iPhone 17 Pro Max Theme */
/* Premium Glassmorphism + Pulse Animation */

:root {
    --wa-green: #25D366;
    --wa-green-dark: #128C7E;
    --wa-deep-teal: #075E54;
    --wa-glass: rgba(255, 255, 255, 0.75);
    --wa-apple-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.18);
    --wa-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ── Container ── */
.wa-widget-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99999;
    font-family: var(--wa-font);
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wa-widget-container.bumped {
    bottom: 110px;
}

/* ── Pulse Button ── */
.wa-pulse-btn {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--wa-green) 0%, var(--wa-green-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    position: relative;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.wa-pulse-btn:hover {
    transform: scale(1.1);
}

.wa-pulse-btn::before,
.wa-pulse-btn::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--wa-green);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.6;
}

.wa-pulse-btn::before {
    animation: wa-pulse 2s infinite;
}

.wa-pulse-btn::after {
    animation: wa-pulse 2s infinite 1s;
}

@keyframes wa-pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

/* ── Chat Card (Glassmorphism) ── */
.wa-chat-card {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 370px;
    background: var(--wa-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    box-shadow: var(--wa-apple-shadow);
    overflow: hidden;
    display: none;
    flex-direction: column;
    transform-origin: bottom right;
    animation: wa-bounce-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wa-chat-card.active {
    display: flex;
}

.wa-chat-card.closing {
    animation: wa-bounce-out 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes wa-bounce-in {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(40px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes wa-bounce-out {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.5) translateY(40px);
    }
}

/* ── Chat Header ── */
.wa-chat-header {
    background: linear-gradient(135deg, var(--wa-green-dark) 0%, var(--wa-deep-teal) 100%);
    padding: 18px 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.wa-chat-header img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    object-fit: cover;
    flex-shrink: 0;
}

.wa-chat-header-info {
    flex: 1;
    min-width: 0;
}

.wa-chat-name {
    font-weight: 700;
    font-size: 16px;
    margin: 0;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wa-chat-status {
    font-size: 12px;
    opacity: 1;
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 2px;
}

.wa-chat-status::before {
    content: "";
    width: 8px;
    height: 8px;
    background: #4ef037;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px #4ef037;
    flex-shrink: 0;
}

/* Close Button */
.wa-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

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

/* ── Chat Body ── */
.wa-chat-body {
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
    background: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    background-color: #e5ddd5;
    background-size: cover;
}

.wa-msg {
    background: white;
    padding: 12px 16px;
    border-radius: 0 16px 16px 16px;
    font-size: 14px;
    color: #333;
    max-width: 85%;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    line-height: 1.5;
}

.wa-msg::before {
    content: "";
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 8px solid white;
    border-left: 8px solid transparent;
}

/* ── Chat Footer ── */
.wa-chat-footer {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.wa-input {
    flex: 1;
    background: white;
    border: none;
    outline: none;
    padding: 12px 18px;
    border-radius: 25px;
    font-size: 14px;
    font-family: var(--wa-font);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    color: #333;
}

.wa-input::placeholder {
    color: #999;
}

.wa-send-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--wa-green) 0%, var(--wa-green-dark) 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.wa-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .wa-widget-container {
        bottom: 20px;
        right: 16px;
    }

    .wa-chat-card {
        width: calc(100vw - 40px);
        right: -6px;
        border-radius: 20px;
    }

    .wa-pulse-btn {
        width: 58px;
        height: 58px;
        font-size: 28px;
    }
}
