/* WhatsApp Chat Bubble - Black Book Ibiza Style */

/* Reset and Base */
* {
    box-sizing: border-box;
}

/* Main Widget Container */
.wcb-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    text-shadow: none;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.wcb-widget * {
    text-shadow: none;
    font-family: inherit;
    text-decoration: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.wcb-widget.wcb-position-right {
    right: 20px;
}

.wcb-widget.wcb-position-left {
    left: 20px;
}

/* Chat Bubble - WhatsApp Icon */
.wcb-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgb(37, 211, 102);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: rgb(0 0 0 / 15%) 0px 3px 12px;
    transition: all 0.3s ease;
    color: white;
    position: relative;
    z-index: 999997;
}

.wcb-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.wcb-bubble.wcb-bubble-hidden {
    transform: scale(0);
    opacity: 0;
}

.wcb-bubble svg {
    width: 32px;
    height: 32px;
}

/* Chat Window - Floating Container */
.wcb-chat-window {
    position: absolute;
    bottom: 76px;
    width: 360px;
    max-width: calc(100vw - 40px);
    border-radius: 16px;
    box-shadow: rgb(0 0 0 / 10%) 0px 1px 6px, rgb(0 0 0 / 20%) 0px 2px 32px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    background: white;
    animation: wcb-slideUp 0.3s ease;
    z-index: 999998;
}

.wcb-position-right .wcb-chat-window {
    right: 0;
}

.wcb-position-left .wcb-chat-window {
    left: 0;
}

.wcb-chat-window.wcb-show {
    display: flex;
}

@keyframes wcb-slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Close Button */
.wcb-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    padding: 0;
    transition: color 0.2s;
    z-index: 10;
}

.wcb-close-btn:hover {
    color: white;
}

.wcb-close-btn svg {
    width: 20px;
    height: 20px;
}

/* Chat Header */
.wcb-chat-header {
    background: rgb(7, 94, 84);
    padding: 16px 16px 16px 20px;
    display: flex;
    align-items: center;
    position: relative;
    min-height: 60px;
}

.wcb-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.wcb-avatar-container {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

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

.wcb-online-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: rgb(0, 230, 118);
    border: 2px solid rgb(7, 94, 84);
    border-radius: 50%;
}

.wcb-agent-info {
    flex: 1;
    color: white;
}

.wcb-agent-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: white;
    line-height: 1.1;
    padding: 0;
}

.wcb-agent-status {
    font-size: 13px;
    opacity: 0.9;
    margin: 1px 0 0 0;
    color: white;
    line-height: 1.2;
    padding: 0;
}

/* Chat Body */
.wcb-chat-body {
    background-color: rgb(230, 221, 212);
    background-image: url('../images/background-whatsapp.jpg');
    background-size: contain;
    background-position: center;
    background-repeat: repeat;
    min-height: 300px;
    padding: 16px;
    flex: 1;
    overflow-y: auto;
    position: relative;
}

/* If background image doesn't exist, use pattern fallback */
.wcb-chat-body:not([style*="background-image"]) {
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='pattern' x='0' y='0' width='40' height='40' patternUnits='userSpaceOnUse'%3E%3Cpath d='M0 38.5L5 33.5L0 28.5M0 18.5L5 13.5L0 8.5' stroke='%23D4D4D4' stroke-width='0.5' fill='none' opacity='0.2'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100' height='100' fill='url(%23pattern)'/%3E%3C/svg%3E");
    background-size: 100px 100px;
    background-repeat: repeat;
}

/* Time Display */
.wcb-time-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    width: 100%;
}

.wcb-time-inner {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 7px;
    padding: 5px 12px;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.wcb-time-value {
    color: rgb(102, 119, 129);
    font-size: 12.5px;
    font-weight: 500;
    text-shadow: none;
}

/* Message Container */
.wcb-message-container {
    position: relative;
}

/* Typing Dots Container */
.wcb-dots-container {
    margin-bottom: 8px;
    display: inline-flex;
    max-width: 85%;
}

.wcb-typing-dots {
    background: white;
    border-radius: 18px;
    padding: 8px 12px;
    display: inline-block;
    min-width: 60px;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.wcb-dots-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 16px;
}

.wcb-dot {
    width: 8px;
    height: 8px;
    background: rgb(147, 153, 159);
    border-radius: 50%;
    animation: wcb-dot-flashing 1.4s infinite;
}

.wcb-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.wcb-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes wcb-dot-flashing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    30% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Message Bubble */
.wcb-message {
    display: inline-flex;
    align-items: flex-end;
    margin-bottom: 8px;
    animation: wcb-messageIn 0.3s ease;
    max-width: 85%;
}

.wcb-bubble-tail {
    flex-shrink: 0;
    color: white;
    margin-right: -1px;
}

.wcb-message-content {
    background: white;
    border-radius: 0 8px 8px 8px;
    padding: 8px 12px;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
    display: inline-block;
}

.wcb-message-group {
    padding: 0;
}

.wcb-message-text {
    color: #262626;
    font-size: 14.2px;
    line-height: 1.34;
    word-wrap: break-word;
    text-shadow: none;
}

.wcb-message-text div {
    margin: 0;
    padding: 0;
    text-shadow: none;
    display: inline;
}

.wcb-message-text br {
    display: block;
    content: "";
    margin: 3px 0;
}

@keyframes wcb-messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Footer */
.wcb-chat-footer {
    padding: 10px;
    background: #ffffff;
    border-top: none;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.wcb-message-field-container {
    display: flex;
    align-items: flex-end;
    gap: 5px;
}

.wcb-message-text-container {
    flex: 1;
}

.wcb-input-container {
    background: white;
    border-radius: 21px;
    border: none;
    transition: all 0.2s;
}



.wcb-input-container:focus-within {
}

.wcb-input-inner {
    padding: 0px;
	border: none!important;
}

.wcb-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 20px;
}

/* Input Field Styling */
.wcb-input-field {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: #111B21;
    font-size: 15px;
    line-height: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    text-shadow: none;
    font-weight: 400;
    letter-spacing: normal;
    padding: 0;
    margin: 0;
	border: none!important;
	border-radius: 50%;
}

#wcb-input-field {
	border: none!important;
}
.wcb-input-field::placeholder {
    color: #8696A0;
    opacity: 1;
}

.wcb-input-field:focus::placeholder {
    color: #A8B4BD;
}

/* Send Button */
.wcb-send-button-container {
    flex-shrink: 0;
}

.wcb-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgb(37, 211, 102);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    color: white;
    box-shadow: none;
    text-shadow: none;
}

.wcb-send-btn:hover {
    transform: scale(1.1);
    background: rgb(32, 195, 95);
}

.wcb-send-btn:active {
    transform: scale(0.95);
    background: rgb(28, 180, 87);
}

.wcb-send-btn.sending {
    animation: wcb-send-pulse 0.5s ease;
}

@keyframes wcb-send-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.wcb-btn-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.wcb-send-btn svg {
    width: 20px;
    height: 20px;
    margin-left: 2px;
    filter: none;
    text-shadow: none;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .wcb-widget {
        right: 15px !important;
        left: 15px !important;
    }
    
    .wcb-bubble {
        width: 56px;
        height: 56px;
    }
    
    .wcb-chat-window {
        width: calc(100vw - 30px);
        bottom: 72px;
        right: 0 !important;
        left: 0 !important;
        margin: 0 auto;
    }
    
    .wcb-chat-body {
        min-height: 280px;
        max-height: 400px;
    }
}

/* Focus States */
.wcb-widget button:focus {
    outline: none;
}

.wcb-widget button:focus-visible {
    outline: 2px solid #075E54;
    outline-offset: 2px;
}

/* Scrollbar Styling */
.wcb-chat-body::-webkit-scrollbar {
    width: 6px;
}

.wcb-chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.wcb-chat-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.wcb-chat-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Print Styles */
@media print {
    .wcb-widget {
        display: none !important;
    }
}

/* Reset any theme text shadows */
.wcb-widget,
.wcb-widget *,
.wcb-widget *::before,
.wcb-widget *::after {
    text-shadow: none !important;
    -webkit-text-shadow: none !important;
    -moz-text-shadow: none !important;
}

/* Ensure no double text */
.wcb-input-textarea::placeholder {
    opacity: 0;
}
@keyframes wcb-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.wcb-bubble.wcb-pulse {
    animation: wcb-pulse 2s infinite;
}