/* AssistantAI Widget Styles */
#upkyk-assistant-ai-container {
    position: fixed;
    bottom: 90px;
    z-index: 9999;
    font-family: var(--assistant-ai-font, 'Roboto, sans-serif');
    transition: all 0.3s ease;
}

#upkyk-assistant-ai-container.bottom-right {
    right: 20px;
}

#upkyk-assistant-ai-container.bottom-left {
    left: 20px;
}

/* Chat Window */
#upkyk-chatbox {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: var(--upkyk-window-width, 380px);
    height: var(--upkyk-window-height, 600px);
    max-width: calc(100% - 40px);
    max-height: 80vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    z-index: 999998;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

#upkyk-chatbox.active {
    pointer-events: all;
}

/* Animation Styles for Chat Window */
/* Fade animation (default) */
#upkyk-assistant-ai-container.upkyk-animation-fade #upkyk-chatbox {
    transition: opacity 0.3s ease, transform 0.3s ease !important;
    transform: translateY(20px) !important;
    opacity: 0 !important;
    pointer-events: none;
}

#upkyk-assistant-ai-container.upkyk-animation-fade #upkyk-chatbox.active {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: all;
}

/* Slide animation */
#upkyk-assistant-ai-container.upkyk-animation-slide #upkyk-chatbox {
    transition: transform 0.4s ease !important;
    transform: translateY(100%) !important;
    opacity: 1 !important;
    pointer-events: none;
}

#upkyk-assistant-ai-container.upkyk-animation-slide #upkyk-chatbox.active {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: all;
}

/* Slide Left animation */
#upkyk-assistant-ai-container.upkyk-animation-slide-left #upkyk-chatbox {
    transition: transform 0.4s ease !important;
    transform: translateX(-100%) !important;
    opacity: 1 !important;
    pointer-events: none;
}

#upkyk-assistant-ai-container.upkyk-animation-slide-left #upkyk-chatbox.active {
    transform: translateX(0) !important;
    opacity: 1 !important;
    pointer-events: all;
}

/* Slide Right animation */
#upkyk-assistant-ai-container.upkyk-animation-slide-right #upkyk-chatbox {
    transition: transform 0.4s ease !important;
    transform: translateX(100%) !important;
    opacity: 1 !important;
    pointer-events: none;
}

#upkyk-assistant-ai-container.upkyk-animation-slide-right #upkyk-chatbox.active {
    transform: translateX(0) !important;
    opacity: 1 !important;
    pointer-events: all;
}

/* Scale animation */
#upkyk-assistant-ai-container.upkyk-animation-scale #upkyk-chatbox {
    transition: transform 0.3s ease, opacity 0.3s ease !important;
    transform: scale(0.8) !important;
    opacity: 0 !important;
    pointer-events: none;
}

#upkyk-assistant-ai-container.upkyk-animation-scale #upkyk-chatbox.active {
    transform: scale(1) !important;
    opacity: 1 !important;
    pointer-events: all;
}

/* Bounce animation */
#upkyk-assistant-ai-container.upkyk-animation-bounce #upkyk-chatbox {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease !important;
    transform: scale(0.3) !important;
    opacity: 0 !important;
    pointer-events: none;
}

#upkyk-assistant-ai-container.upkyk-animation-bounce #upkyk-chatbox.active {
    transform: scale(1) !important;
    opacity: 1 !important;
    pointer-events: all;
}

.upkyk-animation-bounce #upkyk-chatbox:not(.active) {
    animation: upkyk-bounce-out 0.5s forwards;
}

/* Media query for mobile devices */
@media screen and (max-width: 768px) {
    /* Base styles for chat window on mobile */
    #upkyk-chatbox {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        width: 90% !important;
        height: 70vh !important;
        max-width: 400px !important;
        max-height: 70vh !important;
        margin: 0 !important;
        padding: 0 !important;
        transform: translate(-50%, -40%) scale(0.95) !important; /* Center with slight offset up and scaled down when inactive */
        border-radius: 16px !important;
        z-index: 999998 !important; /* Below the chat button */
        transition: transform 0.3s ease, opacity 0.3s ease !important;
        pointer-events: auto !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Active state for chat window on mobile */
    #upkyk-chatbox.active {
        transform: translate(-50%, -50%) scale(1) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Ensure the chat toggle button stays on top of the chat window */
    #upkyk-chat-toggle {
        z-index: 1000000 !important;
        position: fixed !important;
        bottom: 20px !important;
        right: 20px !important;
    }
    
    /* Ensure the chat header has proper border radius */
    #upkyk-chat-header {
        border-radius: 16px 16px 0 0 !important;
    }
}

/* Chat Header */
#upkyk-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background-color: var(--upkyk-primary-color);
    color: white;
    border-radius: 16px 16px 0 0;
}

.upkyk-header-title {
    display: flex;
    align-items: center;
}

/* Close button removed */

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

.upkyk-chat-title {
    font-size: 18px;
    font-weight: 600;
}

.upkyk-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chat Messages Container */
#upkyk-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Message Bubbles */
.upkyk-message {
    border-radius: 22px;
    padding: 10px 15px;
    max-width: 80%;
    word-wrap: break-word;
    position: relative;
    line-height: 1.5;
}

.upkyk-message.bot {
    align-self: flex-start;
    background-color: var(--upkyk-primary-color);
    color: white;
}

.upkyk-message.user {
    align-self: flex-end;
    background-color: var(--upkyk-user-color);
    color: #212529;
}

/* Typing Animation */
.upkyk-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 15px;
    background: #e0e0e0;
    border-radius: 18px;
    max-width: 70px;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.upkyk-typing-dot {
    width: 8px;
    height: 8px;
    background: #666;
    border-radius: 50%;
    animation: typing-animation 1.4s infinite;
}

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

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

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

/* Input Area */
#upkyk-chat-input-container {
    display: flex;
    padding: 10px;
    background: white;
    border-top: 1px solid #e9ecef;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

#upkyk-chat-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 25px;
    margin-right: 8px;
    font-size: 14px;
}

#upkyk-chat-submit {
    background-color: var(--upkyk-primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    position: relative;
}

/* Ensure SVG is perfectly centered */
#upkyk-chat-submit svg {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
}

/* Quick Replies */
.upkyk-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.upkyk-quick-reply {
    background: white;
    border: 1px solid var(--upkyk-primary-color);
    color: var(--upkyk-primary-color);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upkyk-quick-reply:hover {
    background: var(--upkyk-primary-color);
    color: white;
}

/* Chat Toggle Button */
#upkyk-chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #0084ff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    z-index: 99998;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

/* Chat icon animation - Base styles for all animation types */
#upkyk-chat-toggle .chat-icon,
#upkyk-chat-toggle .close-icon,
#upkyk-chat-toggle.animated-icon .chat-icon,
#upkyk-chat-toggle.animated-icon .close-icon {
    position: absolute;
    width: 24px;
    height: 24px;
    /* Optimize transition and make it take priority over hover effects */
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
}

/* Smooth transition for icon paths */
#upkyk-chat-toggle svg path {
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

/* Initial state - chat icon visible (applies to all icon types) */
#upkyk-chat-toggle:not(.active) .chat-icon,
#upkyk-chat-toggle.animated-icon:not(.active) .chat-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

#upkyk-chat-toggle:not(.active) .close-icon,
#upkyk-chat-toggle.animated-icon:not(.active) .close-icon {
    opacity: 0;
    transform: scale(0.8) rotate(-90deg);
}

/* Active state - close icon visible with animation (applies to all icon types) */
#upkyk-chat-toggle.active .chat-icon,
#upkyk-chat-toggle.animated-icon.active .chat-icon {
    opacity: 0;
    transform: scale(0.8) rotate(90deg);
}

#upkyk-chat-toggle.active .close-icon,
#upkyk-chat-toggle.animated-icon.active .close-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Ensure img elements with chat-icon class also animate properly */
#upkyk-chat-toggle img.chat-icon {
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Pulse animation on hover */
#upkyk-chat-toggle:not(.active):hover .chat-icon,
#upkyk-chat-toggle.active:hover .close-icon {
    animation: pulse 0.5s ease;
    /* Ensure the white color filter is preserved during animation */
    filter: brightness(0) invert(1) !important;
}

/* Stop the hover animation immediately when clicking (active state changes) */
#upkyk-chat-toggle.active:hover .chat-icon,
#upkyk-chat-toggle:not(.active):hover .close-icon {
    animation: none;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
    /* Ensure no color change during animation */
    0%, 50%, 100% { filter: brightness(0) invert(1); }
}

/* Custom icon rotation animation (for non-animated custom icons) */
#upkyk-chat-toggle.custom-icon:not(.animated-icon) {
    /* Optimize transition and make it take priority */
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
}

#upkyk-chat-toggle.custom-icon:not(.animated-icon):not(.active) {
    transform: rotate(0deg);
}

#upkyk-chat-toggle.custom-icon:not(.animated-icon).active {
    transform: rotate(180deg);
}

/* SVG icon styles for the toggle button */
#upkyk-chat-toggle svg, 
#upkyk-chat-toggle img {
    width: 45px;
    height: 45px;
    position: relative;
    z-index: 2;
    filter: brightness(0) invert(1);
}

/* Ensure chat-icon class also gets the larger size */
#upkyk-chat-toggle .chat-icon {
    width: 45px;
    height: 45px;
}

#upkyk-chat-toggle.bottom-right {
    right: 20px;
}

#upkyk-chat-toggle.bottom-left {
    left: 20px;
}

/* Modify hover effect to use filter or box-shadow instead of transform */
#upkyk-chat-toggle:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

#upkyk-chat-toggle:focus {
    outline: none;
}

/* Notification dot */
.upkyk-notification-dot {
    width: 10px;
    height: 10px;
    background-color: #ff3b30;
    border-radius: 50%;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10001;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    border: 2px solid white;
}

.upkyk-notification-dot.active {
    visibility: visible;
    opacity: 1;
}

/* Branding */
.upkyk-branding {
    text-align: center;
    padding: 5px;
    font-size: 11px;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
}

.upkyk-branding a {
    color: #6c757d;
    text-decoration: none;
}

.upkyk-branding a:hover {
    text-decoration: underline;
}

/* Button Shape Options */
#upkyk-chat-toggle.circle {
    border-radius: 50%;
}

#upkyk-chat-toggle.square {
    border-radius: 0;
}

#upkyk-chat-toggle.rounded {
    border-radius: 10px;
}

/* Button Size Options */
#upkyk-chat-toggle.small {
    width: 45px;
    height: 45px;
}

#upkyk-chat-toggle.small svg,
#upkyk-chat-toggle.small img,
#upkyk-chat-toggle.small .chat-icon {
    width: 25px;
    height: 25px;
}

#upkyk-chat-toggle.medium {
    width: 50px;
    height: 50px;
}

#upkyk-chat-toggle.medium svg,
#upkyk-chat-toggle.medium img,
#upkyk-chat-toggle.medium .chat-icon {
    width: 31px;
    height: 31px;
}

#upkyk-chat-toggle.large {
    width: 59px;
    height: 59px;
}

#upkyk-chat-toggle.large svg,
#upkyk-chat-toggle.large img,
#upkyk-chat-toggle.large .chat-icon {
    width: 45px;
    height: 45px;
}

/* Font Size Options */
.upkyk-message.small {
    font-size: 12px;
    line-height: 1.3;
}

.upkyk-message.medium {
    font-size: 14px;
    line-height: 1.5;
}

.upkyk-message.large {
    font-size: 16px;
    line-height: 1.7;
}

/* Message Padding Options */
.upkyk-message.compact {
    padding: 6px 10px;
}

.upkyk-message.normal {
    padding: 10px 15px;
}

.upkyk-message.spacious {
    padding: 14px 20px;
}

/* Font family setting */
#upkyk-assistant-ai-container {
    font-family: var(--assistant-ai-font, 'Roboto, sans-serif');
}

/* Add or update these CSS rules to support all the font families from your settings */

/* Base font family support using CSS variables */
#upkyk-assistant-ai-container {
    font-family: var(--assistant-ai-font, 'Roboto, sans-serif');
}

/* Specific font family rules for each option in your dropdown */
#upkyk-assistant-ai-container[data-font="Roboto, sans-serif"],
#upkyk-assistant-ai-container.font-arial {
    font-family: Roboto, sans-serif !important;
}

#upkyk-assistant-ai-container[data-font="Verdana, sans-serif"],
#upkyk-assistant-ai-container.font-verdana {
    font-family: Verdana, sans-serif !important;
}

#upkyk-assistant-ai-container[data-font="Helvetica, sans-serif"],
#upkyk-assistant-ai-container.font-helvetica {
    font-family: Helvetica, sans-serif !important;
}

#upkyk-assistant-ai-container[data-font="Tahoma, sans-serif"],
#upkyk-assistant-ai-container.font-tahoma {
    font-family: Tahoma, sans-serif !important;
}

#upkyk-assistant-ai-container[data-font="Trebuchet MS, sans-serif"],
#upkyk-assistant-ai-container.font-trebuchet {
    font-family: "Trebuchet MS", sans-serif !important;
}

#upkyk-assistant-ai-container[data-font="Times New Roman, serif"],
#upkyk-assistant-ai-container.font-times {
    font-family: "Times New Roman", serif !important;
}

#upkyk-assistant-ai-container[data-font="Georgia, serif"],
#upkyk-assistant-ai-container.font-georgia {
    font-family: Georgia, serif !important;
}

#upkyk-assistant-ai-container[data-font="Courier New, monospace"],
#upkyk-assistant-ai-container.font-courier {
    font-family: "Courier New", monospace !important;
}

#upkyk-assistant-ai-container[data-font="Segoe UI, sans-serif"],
#upkyk-assistant-ai-container.font-segoe {
    font-family: "Segoe UI", sans-serif !important;
}

#upkyk-assistant-ai-container[data-font="Roboto, sans-serif"],
#upkyk-assistant-ai-container.font-roboto {
    font-family: Roboto, sans-serif !important;
}

/* Make sure these CSS variables are used for the chat window */
:root {
    --upkyk-primary-color: #39CCCC;
    --upkyk-user-color: #e9ecef;
    --upkyk-font-size: 14px;
    --upkyk-message-padding: 10px 15px;
}

/* Chat toggle button */
.upkyk-assistant-ai-toggle {
    background-color: var(--upkyk-primary-color);
}

/* Chat window header */
.upkyk-assistant-ai-header {
    background-color: var(--upkyk-primary-color);
}

/* Bot messages */
.upkyk-assistant-ai-message.upkyk-bot {
    background-color: var(--upkyk-primary-color);
    color: white;
}

/* User messages */
.upkyk-assistant-ai-message.upkyk-user {
    background-color: var(--upkyk-user-color);
    color: #212529;
}

/* Send button */
.upkyk-assistant-ai-send {
    background-color: var(--upkyk-primary-color);
}

/* Update the typing indicator styles */
.upkyk-typing-indicator {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    background-color: #f1f1f1;
    border-radius: 18px;
    width: fit-content;
    max-width: 70%;
}

.upkyk-typing-indicator span {
    height: 8px;
    width: 8px;
    margin: 0 2px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    animation: upkyk-typing-animation 1.4s infinite ease-in-out both;
}

.upkyk-typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes upkyk-typing-animation {
    0%, 80%, 100% { transform: scale(0.7); }
    40% { transform: scale(1.2); }
}

/* Contact Form Styles - Fixed for proper display in chat */
.upkyk-inline-form-message {
    background-color: #fff;
    border-radius: 12px;
    padding: 18px;
    margin: 10px 0;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    border: 1px solid #e0e0e0;
    display: block !important;
}

/* Fix any potential nesting issues by targeting the form inside any container */
#upkyk-chat-messages .upkyk-inline-form-message,
.upkyk-message .upkyk-inline-form-message,
.upkyk-bot-message .upkyk-inline-form-message {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 15px 0 !important;
}

/* Ensure form fields are visible */
#upkyk-chat-messages .upkyk-form-field,
.upkyk-message .upkyk-form-field,
.upkyk-bot-message .upkyk-form-field {
    margin-bottom: 14px;
    display: block !important;
}

/* Additional styling for the updated form */
.upkyk-styled-form {
    transition: all 0.3s ease;
}

.upkyk-form-header {
    font-weight: 600;
    margin-bottom: 18px;
    color: #222;
    font-size: 18px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.upkyk-contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.upkyk-form-field {
    margin-bottom: 14px;
}

.upkyk-form-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #222;
    font-size: 14px;
}

.upkyk-form-field input,
.upkyk-form-field textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
    background-color: #fafafa;
    transition: all 0.2s ease;
}

/* Force visibility of form elements */
#upkyk-form-name, 
#upkyk-form-email, 
#upkyk-form-phone, 
#upkyk-form-submit {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Font size variations */
.upkyk-font-small .upkyk-form-header {
    font-size: 16px;
}

.upkyk-font-small .upkyk-form-field label {
    font-size: 12px;
}

.upkyk-font-small input,
.upkyk-font-small #upkyk-form-submit {
    font-size: 12px;
}

.upkyk-font-large .upkyk-form-header {
    font-size: 20px;
}

.upkyk-font-large .upkyk-form-field label {
    font-size: 16px;
}

.upkyk-font-large input,
.upkyk-font-large #upkyk-form-submit {
    font-size: 16px;
    padding: 12px;
}

/* Padding variations */
.upkyk-padding-compact .upkyk-form-field {
    margin-bottom: 8px;
}

.upkyk-padding-compact input {
    padding: 8px;
}

.upkyk-padding-spacious .upkyk-form-field {
    margin-bottom: 16px;
}

.upkyk-padding-spacious input {
    padding: 12px;
}

/* Responsive styles for mobile */
@media screen and (max-width: 480px) {
    .upkyk-inline-form-message {
        width: 100%;
        padding: 12px;
        margin: 8px 0;
    }
    
    .upkyk-form-field input,
    .upkyk-form-field textarea {
        padding: 8px;
        font-size: 14px;
    }
    
    #upkyk-form-submit {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    /* Ensure chat window takes full screen on mobile */
    
    /* Fix for mobile input field and send button */
    #upkyk-chat-input-container {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        width: 100% !important;
        padding: 10px !important;
        box-sizing: border-box !important;
        background: white !important;
        display: flex !important;
        align-items: center !important;
        border-top: 1px solid #e9ecef !important;
        border-radius: 0 0 16px 16px !important;
    }
    
    #upkyk-chat-input {
        flex: 1 !important;
        max-width: calc(100% - 50px) !important;
    }
    
    #upkyk-chat-messages {
        flex: 1 !important;
        overflow-y: auto !important;
        padding: 10px !important;
    }
}

.upkyk-form-field input:focus,
.upkyk-form-field textarea:focus {
    border-color: var(--upkyk-primary-color, #0084ff);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 132, 255, 0.2);
    background-color: #fff;
}

.upkyk-form-field textarea {
    min-height: 80px;
    resize: vertical;
}

.upkyk-form-submit {
    margin-top: 10px;
}

#upkyk-form-submit {
    background-color: var(--upkyk-primary-color, #0084ff);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 15px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#upkyk-form-submit:hover {
    background-color: var(--upkyk-hover-color, #0074e0);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#upkyk-form-submit:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.upkyk-form-success {
    color: #28a745;
    padding: 15px;
    text-align: center;
    font-weight: 500;
    background-color: rgba(40, 167, 69, 0.1);
    border-radius: 6px;
}

/* Active Hours Styling */
.upkyk-outside-hours #upkyk-chat-input-container {
    background-color: #f5f5f5 !important;
    border-top: 1px solid #ddd !important;
}

#upkyk-chat-input.upkyk-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f0f0f0;
    border-color: #ccc;
}

#upkyk-chat-submit.upkyk-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #888;
}

/* Enhanced Outside Active Hours Styling */
.upkyk-outside-hours {
    position: relative;
}

.upkyk-outside-hours:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #ffc107;
    z-index: 1;
}

.upkyk-outside-hours #upkyk-chat-messages {
    background-color: #fcfcfc;
}

/* Merged styles for outside hours message - fixed duplicate */
.upkyk-outside-hours-message {
    background-color: #fff8dc !important;
    border-left: 4px solid #ffc107;
    color: #856404 !important;
    font-weight: 500;
    padding: 10px 15px !important;
    margin: 10px 0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-size: 14px;
    line-height: 1.5;
    max-width: 90%;
    align-self: center;
    text-align: center;
}

/* Animated clock icon for outside hours message */
.upkyk-outside-hours-message:before {
    content: "⏱️";
    margin-right: 8px;
    animation: pulse 2s infinite;
    display: inline-block;
}

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

/* Style for disabled elements */
.upkyk-disabled {
    pointer-events: none !important;
}

#upkyk-chat-input.upkyk-disabled::placeholder {
    color: #999;
}

/* Styles for outside active hours */
.upkyk-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

.upkyk-outside-hours .upkyk-chat-footer {
    background-color: #f5f5f5;
    border-top: 1px solid #e0e0e0;
}

.upkyk-outside-hours-message {
    background-color: #fffde7 !important;
    border-left: 4px solid #ffc107 !important;
    color: #795548 !important;
    font-weight: 500;
    padding: 15px 20px !important;
    margin: 10px 0 !important;
}

/* Privacy consent banner */
#upkyk-privacy-consent {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    z-index: 10;
    text-align: center;
    font-size: 14px;
    border-radius: 0 0 20px 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

#upkyk-privacy-consent.visible {
    transform: translateY(0); /* Show when visible class is added */
}

#upkyk-privacy-accept {
    background-color: var(--upkyk-primary-color, #0082C8);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 8px;
    font-weight: bold;
}

#upkyk-privacy-accept:hover {
    opacity: 0.9;
}

@media screen and (max-width: 480px) {
    #upkyk-privacy-consent {
        padding: 10px;
        font-size: 12px;
    }
    
    #upkyk-privacy-accept {
        padding: 6px 12px;
    }
}

/* Add a class to specifically hide on mobile devices */
html.upkyk-disable-on-mobile #upkyk-assistant-ai-container,
html.upkyk-disable-on-mobile #upkyk-chat-toggle,
html.upkyk-disable-on-mobile #upkyk-chatbox {
    display: none !important;
}

@media screen and (max-width: 768px) {
    body.upkyk-disable-on-mobile #upkyk-assistant-ai-container,
    body.upkyk-disable-on-mobile #upkyk-chat-toggle,
    body.upkyk-disable-on-mobile #upkyk-chatbox {
        display: none !important;
    }
}

/* SVG Icon specific styles */
#upkyk-assistant-ai-container svg path,
#upkyk-chat-toggle svg path {
    fill: currentColor; /* Ensures SVG paths take the current text color */
}

/* For custom uploaded icons */
#upkyk-chat-toggle.custom-icon {
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: 45px !important;
}

#upkyk-chat-toggle.custom-icon.small {
    background-size: 35px !important;
}

#upkyk-chat-toggle.custom-icon.large {
    background-size: 55px !important;
}

/* Icon color style for invert/non-invert */
#upkyk-chat-toggle img.invert {
    filter: brightness(0) invert(1);
}

#upkyk-chat-toggle img.no-invert {
    filter: none;
}

/* Mobile adjustments with bigger icons for touch */
@media screen and (max-width: 768px) {
    #upkyk-chat-toggle {
        width: 55px;
        height: 55px;
    }
    
    #upkyk-chat-toggle svg,
    #upkyk-chat-toggle img {
        width: 40px;
        height: 40px;
    }
    
    #upkyk-chat-toggle.custom-icon {
        background-size: 40px !important;
    }
    
    .upkyk-notification-dot {
        width: 12px;
        height: 12px;
        top: 0;
        right: 0;
        border: 1px solid white;
    }
}

/* Disable hover animations during transition */
#upkyk-chat-toggle.animating:hover .chat-icon,
#upkyk-chat-toggle.animating:hover .close-icon {
    animation: none !important; /* Disable pulse animation during state transition */
}
