/* IIT Companion - WhatsApp chat button + greetings popup */

.iitc-wa-root {
    position: fixed;
    bottom: var(--iitc-wa-bottom, 20px);
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.iitc-wa-root.iitc-wa-visible {
    display: flex;
}

/* Button row */

.iitc-wa-btn-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.iitc-wa-btn {
    position: relative;
    width: var(--iitc-wa-size, 50px);
    height: var(--iitc-wa-size, 50px);
    min-width: 0;
    border: 0 !important;
    border-radius: 50% !important;
    /* !important guards against the theme's global button styling */
    background: #25d366 !important;
    color: #ffffff !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    animation: iitc-wa-heartbeat 7s ease-in-out infinite;
    transition: transform 0.15s ease;
    padding: 0 !important;
    line-height: 1;
}

.iitc-wa-btn:hover,
.iitc-wa-btn:focus {
    background: #25d366 !important;
    transform: scale(1.08);
    animation-play-state: paused;
    outline: none;
}

@keyframes iitc-wa-heartbeat {
    0%, 88%, 100% { transform: scale(1); }
    90% { transform: scale(1.12); }
    92% { transform: scale(1); }
    94% { transform: scale(1.12); }
    96% { transform: scale(1); }
}

.iitc-wa-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #ff4c4c;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    padding: 0 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.iitc-wa-cta {
    background: #ffffff;
    color: #333333;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    white-space: nowrap;
}

.iitc-wa-cta-hover {
    opacity: 0;
    transform: translateX(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.iitc-wa-btn-wrap:hover .iitc-wa-cta-hover {
    opacity: 1;
    transform: translateX(0);
}

.iitc-wa-cta-off {
    display: none;
}

/* Greetings popup */

.iitc-wa-popup {
    width: 320px;
    max-width: calc(100vw - 32px);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    background: #ece5dd;
    animation: iitc-wa-pop 0.25s ease;
}

@keyframes iitc-wa-pop {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.iitc-wa-popup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #075e54;
    padding: 12px 14px;
}

.iitc-wa-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #25d366;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.iitc-wa-online {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #06e376;
    border: 2px solid #075e54;
}

.iitc-wa-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.iitc-wa-header-text strong {
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
}

.iitc-wa-header-text small {
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
}

.iitc-wa-close {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    flex: 0 0 auto;
}

.iitc-wa-close:hover {
    color: #ffffff;
}

.iitc-wa-popup-body {
    padding: 18px 14px;
    background:
        radial-gradient(circle at 20% 20%, rgba(0, 0, 0, 0.02) 0 2px, transparent 3px),
        radial-gradient(circle at 70% 60%, rgba(0, 0, 0, 0.02) 0 2px, transparent 3px),
        #ece5dd;
    max-height: 280px;
    overflow-y: auto;
}

.iitc-wa-bubble {
    background: #ffffff;
    border-radius: 2px 12px 12px 12px;
    padding: 10px 12px;
    max-width: 85%;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.iitc-wa-bubble p {
    margin: 0 0 8px 0;
    color: #333333;
    font-size: 14px;
    line-height: 1.45;
}

.iitc-wa-bubble p:last-child {
    margin-bottom: 0;
}

.iitc-wa-popup-footer {
    padding: 12px 14px;
    background: #f7f5f2;
}

.iitc-wa-start {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0 !important;
    border-radius: 24px !important;
    background: #25d366 !important;
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 600;
    padding: 11px 16px !important;
    cursor: pointer;
    transition: background 0.15s ease;
}

.iitc-wa-start:hover,
.iitc-wa-start:focus {
    background: #1fb457 !important;
    color: #ffffff !important;
}

@media (max-width: 480px) {
    .iitc-wa-popup {
        width: 300px;
    }
}
