/* Main Wrapper */
.wc-wrapper {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Positions */
.wc-pos-bottom-right {
    bottom: 20px;
    right: 20px;
}

.wc-pos-bottom-left {
    bottom: 20px;
    left: 20px;
    align-items: flex-start;
}

/* Variables */
:root {
    --wc-bg: #fff;
    --wc-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --wc-radius: 12px;
}

/* Chat Box */
.wc-chat-box {
    width: 350px;
    height: 450px;
    background: #e5ddd5;
    border-radius: var(--wc-radius);
    box-shadow: var(--wc-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 20px;
    transform-origin: bottom right;
    transition: all 0.3s ease;
}

.wc-wrapper.wc-pos-bottom-left .wc-chat-box {
    transform-origin: bottom left;
}

.wc-hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    display: none;
    /* simple hide */
}

/* Header */
.wc-chat-header {
    background: var(--wc-header);
    color: #fff;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wc-agent-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

.wc-agent-text {
    line-height: 1.2;
}

.wc-name {
    display: block;
    font-weight: bold;
    font-size: 16px;
}

.wc-status {
    display: block;
    font-size: 12px;
    opacity: 0.9;
}

.wc-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

/* Body */
.wc-chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    background-repeat: repeat;
    background-size: 400px;
}

.wc-message-bubble {
    background: #fff;
    padding: 10px 15px;
    border-radius: 0 10px 10px 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    max-width: 85%;
    position: relative;
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
}

.wc-time {
    display: block;
    text-align: right;
    font-size: 10px;
    color: #999;
    margin-top: 4px;
}

/* Routing / Context Step */
.wc-step-msg {
    background: #e1f5fe;
    /* Light blue info bg */
    color: #0277bd;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.wc-context-btn,
.wc-routing-btn {
    display: block;
    background: #fff;
    color: #333;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    border: 1px solid #ddd;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    text-align: center;
    font-weight: 500;
}

.wc-context-btn:hover,
.wc-routing-btn:hover {
    background: #f5f5f5;
    border-color: #bbb;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

.wc-context-btn.wc-selected {
    background: #dcf8c6;
    border-color: #25D366;
    color: #075E54;
    font-weight: 600;
}

.wc-context-btn.wc-active {
    border-left: 5px solid #25D366;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

/* Footer (Input) */
.wc-chat-footer {
    background: #f0f0f0;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#wc-user-msg {
    flex: 1;
    border: none;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
}

.wc-send-btn {
    background: none;
    border: none;
    color: #919191;
    cursor: pointer;
    transition: color 0.2s;
}

.wc-send-btn:hover {
    color: var(--wc-primary);
}

/* Lead Form */
.wc-lead-form {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 10;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.wc-hidden-step {
    display: none;
}

.wc-lead-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

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

.wc-disclaimer {
    font-size: 11px;
    color: #777;
    margin-bottom: 20px;
}

.wc-btn-primary {
    background: var(--wc-primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    width: 100%;
}

.wc-btn-link {
    background: none;
    border: none;
    color: #777;
    margin-top: 10px;
    cursor: pointer;
    text-decoration: underline;
    font-size: 12px;
}

/* Bubble */
.wc-bubble {
    width: 60px;
    height: 60px;
    background: var(--wc-primary);
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}

.wc-bubble:hover {
    transform: scale(1.1);
}

.wc-whatsapp-icon {
    width: 35px;
    height: 35px;
    fill: #fff;
}

.wc-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff3b30;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}