/* ================================================
   CHATBOT MODE STYLES
   ================================================ */

/* Chatbot container */
.wp-exit-chatbot-mode .wp-exit-content {
    padding: 20px;
    overflow-y: auto;
    max-height: 500px;
}

.wp-exit-chat-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Chat message base */
.wp-exit-chat-message {
    display: flex;
    margin-bottom: 16px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bot message (left-aligned) */
.wp-exit-bot-message {
    align-items: flex-start;
    justify-content: flex-start;
}

.wp-exit-bot-message .wp-exit-bubble {
    background: var(--bot-bubble-color, #f0f0f0);
    color: var(--bot-text-color, #000000);
    border-radius: 18px 18px 18px 4px;
    padding: 12px 16px;
    max-width: 70%;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* User message (right-aligned) */
.wp-exit-user-message {
    align-items: flex-end;
    justify-content: flex-end;
}

.wp-exit-user-message .wp-exit-bubble {
    background: var(--user-bubble-color, #0073aa);
    color: var(--user-text-color, #ffffff);
    border-radius: 18px 18px 4px 18px;
    padding: 12px 16px;
    max-width: 70%;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Avatar */
.wp-exit-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Typing indicator container */
.wp-exit-typing-container {
    align-items: center;
}

.wp-exit-typing-indicator {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bot-bubble-color, #f0f0f0);
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.wp-exit-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    margin: 0 2px;
    animation: typing-bounce 1.4s infinite;
}

.wp-exit-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.wp-exit-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
}

/* Chat buttons */
.wp-exit-chat-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 20px;
    padding: 0 50px 0 0; /* Offset for alignment */
}

.wp-exit-chat-btn {
    background: #fff;
    border: 2px solid var(--user-bubble-color, #0073aa);
    color: var(--user-bubble-color, #0073aa);
    padding: 12px 20px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
    width: 100%;
}

.wp-exit-chat-btn:hover {
    background: var(--user-bubble-color, #0073aa);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.wp-exit-chat-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .wp-exit-chatbot-mode .wp-exit-content {
        padding: 15px;
        max-height: 400px;
    }
    
    .wp-exit-bot-message .wp-exit-bubble,
    .wp-exit-user-message .wp-exit-bubble {
        max-width: 80%;
        font-size: 14px;
        padding: 10px 14px;
    }
    
    .wp-exit-avatar {
        width: 32px;
        height: 32px;
        margin-right: 8px;
    }
    
    .wp-exit-chat-buttons {
        padding: 0 40px 0 0;
    }
    
    .wp-exit-chat-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Scrollbar styling for chat */
.wp-exit-chatbot-mode .wp-exit-content::-webkit-scrollbar {
    width: 6px;
}

.wp-exit-chatbot-mode .wp-exit-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.wp-exit-chatbot-mode .wp-exit-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.wp-exit-chatbot-mode .wp-exit-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ================================================
   EXISTING STANDARD MODE STYLES
   (Keep all your existing styles below)
   ================================================ */

/* These styles will remain unchanged and work for standard mode */
/* Add your existing frontend.css content here */

/* Example existing styles that should remain: */
.wp-exit-popup-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
}

.wp-exit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Background color and blur applied via JavaScript based on settings */
}

/* Blocking overlay - default behavior */
.wp-exit-overlay-blocking .wp-exit-overlay {
    /* Background applied via JS */
    pointer-events: auto;
}

/* Non-blocking overlay - allows site interaction */
.wp-exit-overlay-non-blocking .wp-exit-overlay {
    background: transparent;
    pointer-events: none;
}

/* Modal always clickable */
.wp-exit-modal {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    pointer-events: auto;
}

/* Center position needs margin auto */
.wp-exit-pos-center .wp-exit-modal {
    margin: auto;
}

.wp-exit-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 10;
}

.wp-exit-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #000;
}

.wp-exit-content {
    padding: 30px;
    overflow-y: auto;
    max-height: 80vh;
}

/* Standard mode heading and options */
.wp-exit-heading {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.wp-exit-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wp-exit-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.wp-exit-btn:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.wp-exit-btn:active {
    transform: translateY(0);
}

/* Loading state */
.wp-exit-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

.wp-exit-loading:after {
    content: '...';
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Size variations */
.wp-exit-size-small .wp-exit-modal {
    width: 400px;
}

.wp-exit-size-medium .wp-exit-modal {
    width: 600px;
}

.wp-exit-size-large .wp-exit-modal {
    width: 800px;
}

.wp-exit-size-xlarge .wp-exit-modal {
    width: 1200px;
}

.wp-exit-size-fullscreen .wp-exit-modal {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
}

/* Position variations */
.wp-exit-pos-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-exit-pos-bottom-right {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 20px;
}

.wp-exit-pos-top-bar .wp-exit-modal {
    width: 100%;
    border-radius: 0 0 8px 8px;
    margin: 0;
}

/* Animation variations */
.wp-exit-anim-fade .wp-exit-modal {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.wp-exit-anim-zoom .wp-exit-modal {
    animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.wp-exit-anim-slide-up .wp-exit-modal {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wp-exit-anim-slide-down .wp-exit-modal {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .wp-exit-size-small .wp-exit-modal,
    .wp-exit-size-medium .wp-exit-modal,
    .wp-exit-size-large .wp-exit-modal,
    .wp-exit-size-xlarge .wp-exit-modal {
        width: 95%;
        max-width: 95%;
    }
    
    .wp-exit-content {
        padding: 20px;
    }
    
    .wp-exit-heading {
        font-size: 20px;
    }
    
    .wp-exit-btn {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .wp-exit-pos-bottom-right {
        padding: 10px;
    }
}

/* Prevent body scroll when popup is open */
body.wp-exit-open {
    overflow: hidden;
}