/* WP Chatbot Public Styles */

/* Chat Toggle Button */
#wp-chatbot-toggle {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    overflow: visible;
    padding: 0;
}

#wp-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#wp-chatbot-toggle-icon,
.wp-chatbot-chat-icon {
    width: 100%;
    height: 100%;
    min-width: 60px;
    min-height: 60px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    background: transparent;
}

/* Show background only when close icon is visible */
#wp-chatbot-toggle.wp-chatbot-show-close-bg {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

.wp-chatbot-close-toggle-icon {
    width: 24px;
    height: 24px;
    display: block;
    color: white;
    margin: 0 auto;
}

.wp-chatbot-close-toggle-icon path {
    fill: currentColor;
}

.wp-chatbot-close-toggle-icon.wp-chatbot-hidden,
.wp-chatbot-chat-icon.wp-chatbot-hidden {
    display: none;
}

#wp-chatbot-toggle.wp-chatbot-hidden {
    display: none;
}

/* Welcome Bubble */
#wp-chatbot-welcome-bubble {
    position: fixed;
    bottom: 170px;
    right: 20px;
    width: 280px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 9997;
    padding: 16px;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    display: block;
    visibility: hidden;
}

#wp-chatbot-welcome-bubble.wp-chatbot-bubble-visible {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

#wp-chatbot-welcome-bubble.wp-chatbot-bubble-hidden {
    opacity: 0 !important;
    transform: translateY(20px) scale(0.9) !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

.wp-chatbot-close-bubble {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #333;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.2s;
}

.wp-chatbot-close-bubble:hover {
    color: #dc2626;
}

.wp-chatbot-close-icon {
    width: 30px;
    height: 30px;
    display: block;
    color: #333;
}

.wp-chatbot-close-icon path {
    fill: currentColor;
}

.wp-chatbot-bubble-content {
    padding-right: 24px;
    cursor: pointer;
}

.wp-chatbot-bubble-content p {
    margin: 0;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Chat Container */
#wp-chatbot-container {
    position: fixed;
    bottom: 170px;
    right: 100px;
    width: 320px;
    max-width: calc(100vw - 40px);
    height: 480px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#wp-chatbot-container.wp-chatbot-hidden {
    opacity: 0;
    transform: translateY(100px);
    pointer-events: none;
    visibility: hidden;
}

#wp-chatbot-container.wp-chatbot-minimized {
    height: auto;
    max-height: 60px;
}

/* Header */
#wp-chatbot-header {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: #fff;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}


.wp-chatbot-header-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.wp-chatbot-header-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wp-chatbot-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.wp-chatbot-header-text {
    display: flex;
    align-items: baseline;
    gap: 0px;
    flex-wrap: wrap;
}

.wp-chatbot-header-name {
    font-size: 16px;
    font-weight: 600;
}

.wp-chatbot-status {
    font-size: 11px;
    opacity: 0.85;
    text-transform: lowercase;
	margin-left: 10px;
}

#wp-chatbot-header button {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0px;
    margin-left: 0px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#wp-chatbot-header button:hover {
    opacity: 1;
}

.wp-chatbot-btn-signout {
    font-size: 12px;
    padding: 6px 12px;
    margin-left: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    align-self: flex-start;
}

.wp-chatbot-btn-signout:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Toggle button removed - icon now handles toggle */

/* Messages Container */
#wp-chatbot-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f7fa;
    scrollbar-width: thin;
    scrollbar-color: #dc2626 #f2f2f2;
}

#wp-chatbot-messages-container::-webkit-scrollbar {
    width: 8px;
}

#wp-chatbot-messages-container::-webkit-scrollbar-track {
    background: #f2f2f2;
}

#wp-chatbot-messages-container::-webkit-scrollbar-thumb {
    background: #dc2626;
    border-radius: 4px;
}

#wp-chatbot-messages {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Messages */
.wp-chatbot-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

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

.wp-chatbot-message-user {
    align-self: flex-end;
}

.wp-chatbot-message-bot {
    align-self: flex-start;
    display: flex;
    flex-direction: row;
    gap: 10px;
    max-width: 85%;
}

.wp-chatbot-message-avatar {
    flex-shrink: 0;
}

.wp-chatbot-message-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.wp-chatbot-message-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wp-chatbot-message-sender {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 4px;
    padding: 0 4px;
}

.wp-chatbot-message-content {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
}

.wp-chatbot-message-user .wp-chatbot-message-content {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.wp-chatbot-message-bot .wp-chatbot-message-content {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wp-chatbot-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 8px;
}

/* User Info Form */
#wp-chatbot-user-info-form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-top: 10px;
}

.wp-chatbot-form-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

#wp-chatbot-user-info-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

#wp-chatbot-user-info-form input:focus {
    outline: none;
    border-color: #dc2626;
}

#wp-chatbot-submit-info {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
}

#wp-chatbot-submit-info:hover {
    transform: translateY(-2px);
}

/* Typing Indicator */
#wp-chatbot-typing {
    padding: 10px 0;
}

.wp-chatbot-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 18px;
    width: fit-content;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wp-chatbot-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Container */
#wp-chatbot-input-container {
    display: flex;
    padding: 15px;
    background: #fff;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    gap: 10px;
}

#wp-chatbot-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#wp-chatbot-input:focus {
    border-color: #dc2626;
}

#wp-chatbot-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    border: none;
    padding: 0;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#wp-chatbot-send:hover {
    transform: scale(1.1);
}

#wp-chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

#wp-chatbot-send svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: currentColor;
}

/* Rating Form */
#wp-chatbot-rating-form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-top: 10px;
}

.wp-chatbot-rating-stars {
    display: flex;
    gap: 5px;
    margin: 15px 0;
    font-size: 32px;
    cursor: pointer;
}

.wp-chatbot-star {
    color: #ddd;
    transition: color 0.2s;
    cursor: pointer;
}

.wp-chatbot-star:hover,
.wp-chatbot-star.wp-chatbot-star-hover {
    color: #ffc107;
}

.wp-chatbot-star.wp-chatbot-star-selected {
    color: #dc2626;
}

#wp-chatbot-rating-comment {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

#wp-chatbot-rating-comment:focus {
    outline: none;
    border-color: #dc2626;
}

#wp-chatbot-submit-rating {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
}

#wp-chatbot-submit-rating:hover {
    transform: translateY(-2px);
}

/* Header Avatar */
.wp-chatbot-header-info {
    display: flex;
    align-items: left;
    flex: 1;
    gap: 12px;
}

.wp-chatbot-header-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.wp-chatbot-header-text {
    display: flex;
    align-items: baseline;
    gap: 0px;
}

.wp-chatbot-header-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.wp-chatbot-status {
    font-size: 11px;
    text-transform: lowercase;
    opacity: 0.85;
    color: rgba(255, 255, 255, 0.9);
}

.wp-chatbot-header-info .wp-chatbot-btn-signout {
    margin-left: auto;
}

.wp-chatbot-header-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Hidden class */
.wp-chatbot-hidden {
    display: none !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Chat Container - Smaller on mobile */
    #wp-chatbot-container {
        right: 10px;
        bottom: 80px;
        width: calc(100vw - 20px);
        max-width: 360px;
        height: calc(100vh - 100px);
        max-height: 500px;
    }
    
    /* Welcome Bubble - Smaller on mobile */
    #wp-chatbot-welcome-bubble {
        right: 10px;
        bottom: 140px;
        width: calc(100vw - 20px);
        max-width: 300px;
    }
    
    /* Toggle Button - Smaller on mobile */
    #wp-chatbot-toggle {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
    }
    
    /* Header - Smaller padding on mobile */
    #wp-chatbot-header {
        padding: 12px 15px;
    }
    
    .wp-chatbot-header-name {
        font-size: 14px;
    }
    
    .wp-chatbot-header-avatar {
        width: 36px;
        height: 36px;
    }
    
    /* Messages Container - Smaller padding on mobile */
    #wp-chatbot-messages-container {
        padding: 15px;
    }
    
    /* Message bubbles - Adjust for mobile */
    .wp-chatbot-message {
        max-width: 85%;
    }
    
    .wp-chatbot-message-bot {
        max-width: 90%;
    }
    
    /* Input Container - Smaller on mobile */
    #wp-chatbot-input-container {
        padding: 12px;
        gap: 8px;
    }
    
    #wp-chatbot-input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    #wp-chatbot-send {
        width: 40px;
        height: 40px;
    }
    
    #wp-chatbot-send svg {
        width: 18px;
        height: 18px;
    }
    
    /* User Info Form - Smaller on mobile */
    #wp-chatbot-user-info-form {
        padding: 15px;
    }
    
    #wp-chatbot-user-info-form input {
        padding: 10px;
        font-size: 14px;
    }
    
    /* Rating Form - Smaller on mobile */
    #wp-chatbot-rating-form {
        padding: 15px;
    }
    
    .wp-chatbot-rating-stars {
        font-size: 28px;
    }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
    #wp-chatbot-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 90px);
        max-height: 450px;
    }
    
    #wp-chatbot-welcome-bubble {
        width: calc(100vw - 20px);
        max-width: 280px;
    }
    
    #wp-chatbot-toggle {
        width: 50px;
        height: 50px;
        bottom: 10px;
        right: 10px;
    }
    
    .wp-chatbot-header-name {
        font-size: 13px;
    }
    
    .wp-chatbot-header-avatar {
        width: 32px;
        height: 32px;
    }
    
    #wp-chatbot-messages-container {
        padding: 12px;
    }
    
    .wp-chatbot-message-content {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    #wp-chatbot-input-container {
        padding: 10px;
    }
    
    #wp-chatbot-input {
        padding: 9px 10px;
        font-size: 13px;
    }
    
    #wp-chatbot-send {
        width: 38px;
        height: 38px;
    }
    
    #wp-chatbot-send svg {
        width: 16px;
        height: 16px;
    }
}

