/**
 * WhatsApp Widget Styles
 * IEM - Instant Exam Maker
 * 
 * Global WhatsApp support widget styles
 * Include this CSS file in all pages
 */

/* WhatsApp Floating Widget Container */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

/* WhatsApp Button */
.whatsapp-btn {
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    animation: wa-pulse 2s infinite;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(37, 211, 102, 0.55);
    animation: none;
}

.whatsapp-btn svg {
    width: 32px;
    height: 32px;
    fill: white;
}

/* Pulse Animation */
@keyframes wa-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* WhatsApp Popup */
.whatsapp-popup {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 300px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s ease;
}

.whatsapp-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Popup Header */
.whatsapp-popup-header {
    background: #075E54;
    color: white;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.whatsapp-popup-header .w-10 {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.whatsapp-popup-header .font-semibold {
    font-weight: 600;
    font-size: 14px;
}

.whatsapp-popup-header .text-green-100 {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

/* Close Button */
.whatsapp-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.whatsapp-close:hover {
    opacity: 1;
}

/* Popup Body */
.whatsapp-popup-body {
    padding: 16px;
    background: #e5ddd5;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9b99a' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Message Bubble */
.whatsapp-popup-msg {
    background: white;
    border-radius: 0 8px 8px 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #1a1a1a;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    line-height: 1.5;
}

.whatsapp-popup-msg .urdu-inline {
    font-size: 15px;
    font-family: 'Noto Nastaliq Urdu', 'urdu', serif;
    direction: rtl;
    display: inline;
}

.whatsapp-popup-msg .msg-time {
    font-size: 11px;
    color: #999;
    text-align: right;
    margin-top: 4px;
}

/* Popup Footer */
.whatsapp-popup-footer {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.whatsapp-popup-footer a {
    display: block;
    width: 100%;
    text-align: center;
    background: #25D366;
    color: white;
    padding: 10px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}

.whatsapp-popup-footer a:hover {
    background: #1ebe5a;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 16px;
        right: 16px;
    }

    .whatsapp-btn {
        width: 56px;
        height: 56px;
    }

    .whatsapp-btn svg {
        width: 28px;
        height: 28px;
    }

    .whatsapp-popup {
        width: 280px;
        right: -8px;
    }
}

@media (max-width: 480px) {
    .whatsapp-popup {
        width: calc(100vw - 32px);
        right: 0;
    }
}
