/* -------------------------------------------
   FLOATING BUTTON (FAB)
--------------------------------------------*/
#wpfc-fab {
    position: fixed;
    z-index: 999999;
    cursor: pointer;
    /* IMPORTANT — position is now fully dynamic from inline style */
}

/* MAIN BUTTON */
#wpfc-main-btn {
    width: 54px;
    height: 54px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

#wpfc-main-btn img {
    width: 32px;
    height: 32px;
    transition: transform 0.35s ease;
}

/* ACTION BUTTONS (phone + WhatsApp) */
#wpfc-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;

    /* These are adjusted by JS based on left/right */
    bottom: 60px;

    opacity: 0;
    pointer-events: none;

    transform: translateY(20px);
    transition: all 0.35s ease;
}

.wpfc-action-btn {
    width: 50px;
    height: 50px;
    margin-bottom: 12px;

    background: #fff;
    padding: 2px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);

    cursor: pointer;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

/* OPEN STATE */
#wpfc-fab.open #wpfc-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

#wpfc-fab.open .wpfc-action-btn {
    transform: translateY(0);
}

/* MAIN ICON ROTATION */
#wpfc-fab.open #wpfc-main-icon {
    transform: rotate(360deg);
}

#wpfc-fab.close #wpfc-main-icon {
    transform: rotate(-360deg);
}

/* -------------------------------------------
   CHATBOX
--------------------------------------------*/
#wpfc-chatbox {
    width: 320px;
    position: fixed;

    /* Position is now dynamic — inline PHP controls it */
    z-index: 999999;
    background: #fff;
    border-radius: 10px;
    display: none;
    box-shadow: 0 4px 25px rgba(0,0,0,0.25);
}

.wpfc-header {
    display: flex;
    align-items: center;
    gap: 8px;

    background: #25d366;
    color: #fff;
    padding: 10px;
}

.wpfc-header img {
    width: 36px;
    height: 36px;
}

.wpfc-header button {
    margin-left: auto;
    background-color:#fff!important;
    border: none;
    color: black!important;
    font-size: 22px;
    cursor: pointer;
}

.wpfc-body {
    height: 260px;
    overflow-y: auto;
    padding: 15px;
}

.msg.bot {
    background: #e1ffc7;
    padding: 10px;
    border-radius: 7px;
    width: fit-content;
    font-size:14px;
    font-weight: 400;
}

.wpfc-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ddd;
}

.wpfc-input input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 20px;
}

#wpfc-send {
    margin-left: 10px;
    border: none;
    background: #25d366;
    color: white;
    padding: 7px 15px;
    border-radius: 20px;
    cursor: pointer;
}
.wpfc-emoji-btn {
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    margin-right: 5px;
}

/* Emoji Panel */
.wpfc-emoji-panel {
    position: absolute;
    bottom: 55px;
    left: 10px;
    width: 250px;
    height: 260px;
    background: #fff;
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    display: none;
    z-index: 999999;
}

.wpfc-emoji-panel input {
    width: 100%;
    padding: 6px;
    font-size: 14px;
    margin-bottom: 6px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.wpfc-emoji-list {
    height: 200px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
}

.wpfc-emoji-list span {
    cursor: pointer;
    font-size: 20px;
    padding: 5px;
}

/* MOBILE FIX */
@media (max-width: 480px) {

    /* Chatbox responsive */
    #wpfc-chatbox {
        width: 92% !important;
        left: 4% !important;
        right: 4% !important;
        bottom: 90px !important;
        top: auto !important;
    }

    /* FAB should NOT force left or right */
    #wpfc-fab {
        bottom: 20px !important;
        /* remove forced right */
        /* remove forced left */
    }
}
