/**
 * mod_whatsapp_chat - CSS
 * Tutti i selettori con prefisso #wac- o .wac- per evitare conflitti
 * Nessuna dipendenza da Tailwind o altri framework CSS
 */

/* ===== Pulsante flottante ===== */
#wac-button-container {
    position: fixed;
    bottom: 10px;
    right: 10px;
    left: auto;
    z-index: 10001;
}

.wac-trigger-btn {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--wac-btn-bg, #ffffff);
    color: var(--wac-primary, #5f9b31);
    border-radius: 9999px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
    border: 1px solid #e5e7eb;
    font-family: 'Open Sans', sans-serif;
    font-size: 18px;
}

.wac-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.wac-trigger-icon {
    font-size: 24px;
    color: var(--wac-primary, #5f9b31);
}

.wac-trigger-label {
    margin-left: 12px;
    font-size: 18px;
    font-weight: 500;
    color: var(--wac-primary, #5f9b31);
}

/* ===== Popup chat ===== */
#wac-popup {
    position: fixed;
    bottom: 80px;
    right: 20px;
    left: auto;
    width: 320px;
    max-width: calc(100vw - 40px);
    max-height: 450px;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    z-index: 10000;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: #f0f0f0;
}

#wac-popup.wac-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* ===== Header ===== */
.wac-header {
    background-color: var(--wac-primary, #5f9b31);
    padding: 10px 15px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.wac-header-left {
    display: flex;
    align-items: center;
}

.wac-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #fff;
    border: 2px solid #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
}

.wac-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
}

.wac-header-info h3 {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
    color: #fff;
    margin: 0;
    padding: 0;
}

.wac-header-info p {
    font-size: 12px;
    opacity: 0.8;
    margin: 2px 0 0 0;
    padding: 0;
    color: #fff;
}

.wac-close-btn {
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    background: none;
    border: none;
}

/* ===== Corpo messaggi ===== */
.wac-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #ece5dd;
    display: flex;
    flex-direction: column;
}

.wac-bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 8px 8px 8px 2px;
    margin-bottom: 10px;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
    position: relative;
    line-height: 1.4;
    font-size: 14px;
    background-color: #fff;
    align-self: flex-start;
    margin-right: auto;
    font-family: 'Open Sans', sans-serif;
}

.wac-msg-time {
    font-size: 10px;
    color: #999;
    position: absolute;
    bottom: 2px;
    right: 5px;
}

/* ===== Footer ===== */
.wac-footer {
    padding: 15px;
    background-color: #f0f0f0;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
}

.wac-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 25px;
    background-color: var(--wac-primary, #5f9b31);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
    max-width: 200px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    font-family: 'Open Sans', sans-serif;
}

.wac-action-btn:hover {
    background-color: #4a8a24;
    color: #fff;
    text-decoration: none;
}

.wac-action-btn i {
    font-size: 20px;
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
    #wac-popup {
        bottom: 80px;
    }
    #wac-button-container {
        right: 10px;
    }
}