/**
 * WhatsApp Button Styles
 * PurpleLab Context Engine
 */

/* Base button styles - works for both <a> and <div> */
.plce-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: inherit;
    cursor: pointer;
}

/* WhatsApp icon */
.plce-whatsapp-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* Button style (default) */
.plce-whatsapp-button {
    background-color: #25D366;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(37, 211, 102, 0.3);
    border: none;
}

.plce-whatsapp-button:hover {
    background-color: #20bd5a;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 211, 102, 0.4);
}

.plce-whatsapp-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(37, 211, 102, 0.3);
}

.plce-whatsapp-button .plce-whatsapp-icon {
    width: 22px;
    height: 22px;
}

/* Link style */
.plce-whatsapp-link {
    color: #25D366;
    padding: 4px 0;
    font-size: inherit;
}

.plce-whatsapp-link:hover {
    color: #20bd5a;
    text-decoration: underline;
}

/* Icon-only style */
.plce-whatsapp-icon-only {
    background-color: #25D366;
    color: #ffffff;
    padding: 12px;
    border-radius: 50%;
    line-height: 0;
    border: none;
}

.plce-whatsapp-icon-only:hover {
    background-color: #20bd5a;
    color: #ffffff;
    transform: scale(1.1);
}

.plce-whatsapp-icon-only .plce-whatsapp-icon {
    width: 24px;
    height: 24px;
}

/* Floating button variant (add class="floating" to shortcode) */
.plce-whatsapp-btn.floating {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.plce-whatsapp-btn.floating:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Size variants */
.plce-whatsapp-btn.small {
    padding: 8px 16px;
    font-size: 14px;
}

.plce-whatsapp-btn.small .plce-whatsapp-icon {
    width: 16px;
    height: 16px;
}

.plce-whatsapp-btn.large {
    padding: 16px 32px;
    font-size: 18px;
}

.plce-whatsapp-btn.large .plce-whatsapp-icon {
    width: 26px;
    height: 26px;
}

/* Icon-only size variants */
.plce-whatsapp-icon-only.small {
    padding: 8px;
}

.plce-whatsapp-icon-only.small .plce-whatsapp-icon {
    width: 18px;
    height: 18px;
}

.plce-whatsapp-icon-only.large {
    padding: 16px;
}

.plce-whatsapp-icon-only.large .plce-whatsapp-icon {
    width: 32px;
    height: 32px;
}

/* Color variants */
.plce-whatsapp-btn.dark {
    background-color: #075E54;
}

.plce-whatsapp-btn.dark:hover {
    background-color: #064d45;
}

.plce-whatsapp-btn.outline {
    background-color: transparent;
    color: #25D366;
    border: 2px solid #25D366;
    box-shadow: none;
}

.plce-whatsapp-btn.outline:hover {
    background-color: #25D366;
    color: #ffffff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .plce-whatsapp-btn.floating {
        bottom: 16px;
        right: 16px;
    }

    .plce-whatsapp-button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* ================================================
   WhatsApp Selector Modal
   ================================================ */

/* Modal Overlay */
.plce-wa-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.plce-wa-modal-overlay.active {
    display: block;
    opacity: 1;
}

/* Modal Container */
.plce-wa-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 99999;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.plce-wa-modal.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Modal Header */
.plce-wa-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: #25D366;
    color: #ffffff;
}

.plce-wa-modal-header svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.plce-wa-modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.plce-wa-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background 0.2s ease;
}

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

/* Modal Body */
.plce-wa-modal-body {
    padding: 8px 0;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

.plce-wa-modal-subtitle {
    padding: 12px 24px;
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Contact List */
.plce-wa-contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.plce-wa-contact-item {
    margin: 0;
    padding: 0;
}

.plce-wa-contact-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.plce-wa-contact-link:hover {
    background: #f8f9fa;
}

.plce-wa-contact-link:last-child {
    border-bottom: none;
}

/* Contact Icon */
.plce-wa-contact-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.plce-wa-contact-icon svg {
    width: 24px;
    height: 24px;
    color: #25D366;
}

/* Contact Info */
.plce-wa-contact-info {
    flex: 1;
    min-width: 0;
}

.plce-wa-contact-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
}

.plce-wa-contact-desc {
    font-size: 13px;
    color: #888;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Contact Arrow */
.plce-wa-contact-arrow {
    color: #ccc;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.plce-wa-contact-link:hover .plce-wa-contact-arrow {
    transform: translateX(4px);
    color: #25D366;
}

/* Responsive */
@media (max-width: 480px) {
    .plce-wa-modal {
        width: 95%;
        max-height: 90vh;
    }

    .plce-wa-modal-header {
        padding: 16px 20px;
    }

    .plce-wa-contact-link {
        padding: 14px 20px;
    }
}
