/* ROOT */
:root {
    --chatbot-primary: #007bff;
}

/* BASE */
#wgs-chatbot {
    position: fixed;
    bottom: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', sans-serif;
}

/* POSITION */
.wgs-chatbot-right {
    right: 5%;
}

.wgs-chatbot-left {
    left: 20px;
}

/* ================= ICON ================= */

.wgs-chat-icon {
    position: fixed;
    bottom: 20px;
    z-index: 10001;
    cursor: pointer;

    background: var(--chatbot-primary);
    border-radius: 50%;
    padding: 12px;

    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);

    animation: pulse 2s infinite;
    transition: transform 0.2s ease;
}

.wgs-chat-icon:hover {
    transform: scale(1.1);
}

.wgs-chat-icon img {
    width: 28px;
    filter: brightness(0) invert(1);
}

/* Pulse animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.3);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(0, 0, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
}

/* ================= WINDOW ================= */

.wgs-chat-window {
    position: fixed;
    bottom: 90px;
    width: 340px;
    height: 460px;
    background: #fff;
    border-radius: 16px;

    display: flex;
    flex-direction: column;

    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);

    transform: scale(0.8) translateY(20px);
    opacity: 0;
    pointer-events: none;

    transition: all 0.3s ease;
}

.wgs-chatbot-right .wgs-chat-window {
    right: 20px;
}

.wgs-chatbot-left .wgs-chat-window {
    left: 20px;
}

.wgs-chat-window.active {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* ================= HEADER ================= */

.wgs-chat-header {
    background: var(--chatbot-primary);
    color: #fff;
    padding: 14px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.wgs-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 600;
}

.wgs-header-left {
    position: relative;
}

.wgs-menu-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    padding: 6px 10px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
}

.wgs-header-left .wgs-menu-btn,
.wgs-header-right button {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;
    border: none;
    cursor: pointer;

    background: transparent;

    padding: 0;
}

.wgs-expand-btn i {
    font-size: 16px;
    color: #fff;
}

/* ALL ICONS SAME SIZE */
.wgs-header-left .wgs-menu-btn,
.wgs-header-right button img,
.wgs-header-right button svg {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

/* FORCE WHITE COLOR */
.wgs-header-right button img,
.wgs-header-left .wgs-menu-btn {
    filter: brightness(0) invert(1);
}

/* RIGHT SIDE BUTTON GROUP */
.wgs-header-right {
    display: flex;
    gap: 6px;
}

/* LEFT SIDE */
.wgs-header-left {
    display: flex;
    align-items: center;
}

/* HEADER HEIGHT FIX */


.wgs-close-btn img {
    width: 18px;
}

.wgs-header-right button:hover,
.wgs-menu-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

#wgs-chatbot img {
    object-fit: contain;
}

.wgs-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
}

.wgs-close-btn img {
    width: 18px;
    filter: brightness(0) invert(1);
}

.wgs-dropdown {
    position: absolute;
    top: 40px;
    left: 0;
    background: #fff;
    color: #333;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    width: 180px;
    display: none;
    padding: 10px;
    z-index: 999;
}

.wgs-dropdown div {
    padding: 8px;
    cursor: pointer;
}

.wgs-dropdown div:hover {
    background: #f5f5f5;
}

.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 18px;
    margin-left: 10px;
}

.switch input {
    display: none;
}

.slider {
    position: absolute;
    background: #ccc;
    border-radius: 20px;
    width: 100%;
    height: 100%;
}

.slider:before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    background: #fff;
    top: 2px;
    left: 2px;
    border-radius: 50%;
    transition: 0.2s;
}

input:checked+.slider {
    background: var(--chatbot-primary);
}

input:checked+.slider:before {
    transform: translateX(18px);
}

.wgs-chat-footer textarea {
    flex: 1;
    border: none;
    padding: 10px;
    resize: none;
    outline: none;
    max-height: 120px;
    overflow-y: auto;
}

.wgs-chat-window.expanded {
    width: 420px !important;
    height: 600px !important;
}

/* ================= BODY ================= */

.wgs-chat-body {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    background: #f7f9fc;
    display: flex;
    flex-direction: column;
}

/* Message animation */
.wgs-message {
    margin: 6px 0;
    padding: 10px 12px;
    border-radius: 12px;
    max-width: 80%;
    font-size: 14px;

    animation: fadeInUp 0.25s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wgs-message.bot {
    background: #e4e6eb;
    align-self: flex-start;
    position: relative;
    padding-right: 35px;
}

.wgs-copy-btn {
    position: absolute;
    top: 6px;
    right: 6px;

    width: 24px;
    height: 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 6px;

    background: transparent;
    cursor: pointer;

    opacity: 0;
    transition: 0.2s;
}

.wgs-message.bot:hover .wgs-copy-btn {
    opacity: 1;
}

/* ICON */
.wgs-copy-btn i {
    font-size: 13px;
    color: #666;
}

/* HOVER EFFECT */
.wgs-copy-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* COPIED STATE */
.wgs-copy-btn.copied i {
    color: green;
}

.wgs-message.user {
    background: var(--chatbot-primary);
    color: #fff;
    align-self: flex-end;
}

/* ================= FOOTER ================= */

.wgs-chat-footer {
    display: flex;
    border-top: 1px solid #eee;
    background: #fff;
}

.wgs-chat-footer input {
    flex: 1;
    border: none;
    padding: 12px;
    outline: none;
}

.wgs-send-btn {
    background: var(--chatbot-primary);
    border: none;
    padding: 0 16px;
    cursor: pointer;

    display: flex;
    align-items: center;
}

.wgs-send-btn img {
    width: 18px;
    filter: brightness(0) invert(1);
}

/* ================= TYPING DOTS ================= */

.wgs-typing {
    display: flex;
    gap: 4px;
    padding: 6px 10px;
}

.wgs-typing span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: blink 1.4s infinite;
}

.wgs-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.wgs-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {

    0%,
    80%,
    100% {
        opacity: 0.3;
    }

    40% {
        opacity: 1;
    }
}

/* ================= BADGE ================= */

.wgs-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: red;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 50%;
}

.wgs-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.wgs-overlay.hidden {
    display: none;
}

.wgs-popup {
    margin: 15px;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.wgs-popup h3 {
    font-size: 14px;
    margin-bottom: 15px;
    color: #333;
}

.wgs-btn-group {
    display: flex;
    gap: 10px;
}

.wgs-btn-continue {
    flex: 1;
    background: #3498db;
    color: #fff;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
}

.wgs-btn-new {
    flex: 1;
    background: #2ecc71;
    color: #fff;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
}

.wgs-btn-continue:hover {
    background: #2980b9;
}

.wgs-btn-new:hover {
    background: #27ae60;
}