
/**
 * Chat Widget Style Sheet
 * assets\css\chat-widget.css

 */


/* --- Premium "Ask Expert" Style Button --- */
#that-ai-bot-trigger-button {
    position: fixed;
    bottom: 30px; 
    right: 25px;
    
    padding: 12px 16px;
    
    background-color: #2962FF; 
    color: white;
    border: none;
    border-radius: 50px; 
    cursor: pointer;
    z-index: 9998;
    
    font-size: 15px; 
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0.3px;
    white-space: nowrap;
    
    /* Using drop-shadow filter allows the glow to wrap around the tail */
    filter: drop-shadow(0 8px 10px rgba(41, 98, 255, 0.35));
    
    /* Transition for hover effects */
    transition: transform 0.2s ease, background-color 0.3s ease, filter 0.3s ease;
    
    /* Smooth breathing animation */
    animation: botGlow 3s infinite ease-in-out;
}

/* The Tail Design and Direction */
#that-ai-bot-trigger-button::before {
    content: '';
    position: absolute;
    
    right: 8px; 
    bottom: -6px; 
    
    width: 30px;
    height: 18px;
    
    background-color: inherit; 
    
    transform: rotate(45deg) skewX(45deg);
    
    border-radius: 3px;
    z-index: -1; 
}

/* Hover State */
#that-ai-bot-trigger-button:hover {
    background-color: #1c4bd6; 
    transform: translateY(-4px); 
    
    /* Stronger, tighter shadow on hover to simulate lifting */
    filter: drop-shadow(0 12px 12px rgba(41, 98, 255, 0.5));
    
    animation: none;
}

/* Unified Glow Animation */
@keyframes botGlow {
    0% { 
        /* Resting state: Standard soft shadow for depth */
        transform: scale(1);
        filter: drop-shadow(0 8px 10px rgba(41, 98, 255, 0.35));
    }
    50% { 
        /* Glowing state: Offset becomes 0 to center the light, blur increases significantly */
        transform: scale(1);
        filter: drop-shadow(0 0 15px rgba(41, 98, 255, 0.8));
    }
    100% { 
        /* Return to resting state */
        transform: scale(1);
        filter: drop-shadow(0 8px 10px rgba(41, 98, 255, 0.35));
    }
}

/* --- CORE WIDGET LAYOUT  --- */

/* Widget container - Uses Flexbox for robust layout */
#that-ai-bot-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 640px; /* Increased height to accommodate taller header */
    max-height: 80vh; /* Safety: Ensure it doesn't go off-screen on short laptops */
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: none; /* JS toggles this to 'flex' */
    flex-direction: column; /* Main axis is vertical */
    overflow: hidden;
}

/* Header styles - Stays at the top */
#that-ai-bot-header {
    padding: 18px 20px; /* Increased vertical padding for taller header */
    background-color: #0073aa;
    color: white;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* Prevents header from shrinking */
}

#that-ai-bot-header-text-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
    gap: 2px; /* Adds breathing room between lines */
}

#that-ai-bot-title-line-1 {
    font-size: 18px; /* Larger, more prominent */
    font-weight: 700;
}

#that-ai-bot-title-line-2 {
    font-size: 14px; /* More readable */
    font-weight: 400;
    opacity: 0.9;
}

#that-ai-bot-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 32px;
    font-weight: 400;
    cursor: pointer;
    line-height: 0.8;
    padding: 0 10px;
    opacity: 0.9;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#that-ai-bot-close-btn:hover {
    opacity: 1;             /* <--- Full brightness on hover */
    transform: scale(1.1);  /* <--- Subtle pop effect */
}

/* Messages area */
#that-ai-bot-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f9f9f9;
}

/* Input area container - Flexbox for side-by-side layout */
.that-ai-bot-input-container {
    position: relative;
    padding: 12px 12px 32px 12px; 
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap; /* Force send button to stay on the same line */
    gap: 8px;
    align-items: flex-end;
}

/* --- Branding Footer Styles --- */
.that-ai-bot-branding {
    position: absolute;
    bottom: 6px;
    left: 16px;
    width: auto;
    text-align: left;
    font-size: 11px;
    color: #9ea0a2;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    transition: opacity 0.2s ease;
}

.that-ai-bot-branding strong {
    color: #646970;
    font-weight: 600;
}

.that-ai-bot-branding:hover strong {
    color: #0073aa;
}

.that-ai-bot-textarea-wrapper {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
}

#that-ai-bot-input {
    display: block; /* Removes inline descender gap */
    margin: 0 !important; /* Forces WP theme margins to zero */
    width: 100%;
    box-sizing: border-box;
    padding: 10px 15px;
    border: 1px solid #dbdbdb;
    border-radius: 12px;
    resize: none;
    min-height: 55px;
    max-height: 120px;
    overflow-y: hidden;
    font-size: 0.95em;
    line-height: 1.4;
    transition: border-color 0.2s ease;
}

#that-ai-bot-input:focus {
    outline: none;
    border-color: #0073aa;
}

.that-ai-bot-send-button-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px; 
}

#that-ai-bot-send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    background-color: transparent; 
    color: #0073aa;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.1s ease;
}

/* Send button icon alignment */
#that-ai-bot-send-btn svg {
    width: 29px;
    height: 29px;
    transform: rotate(45deg);
    margin-left: -4px;
    margin-top: 0;
}

#that-ai-bot-send-btn:hover {
    background-color: transparent;
    color: #005177; /* Darker blue on hover */
    transform: scale(1.1);
}

/* --- SPEECH BUBBLE STYLES --- */

.that-ai-bot-message-bubble,
.that-ai-bot-bot-response-block {
    margin-bottom: 8px;
}

.that-ai-bot-message-bubble {
    display: flex;
    width: 100%;
}

.that-ai-bot-wrapper-user {
    justify-content: flex-end;
}

.that-ai-bot-wrapper-bot {
    justify-content: flex-start;
}

.that-ai-bot-user-message, .that-ai-bot-bot-message {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 0.9em;
}

.that-ai-bot-user-message {
    background-color: #22b96e;
    color: #ffffff;
    border-bottom-right-radius: 5px;
}

.that-ai-bot-bot-message {
    background-color: #408de6;
    color: #ffffff;
    border-bottom-left-radius: 5px;
}

/* --- Product Card Styles --- */

.that-ai-bot-products-container {
    display: flex;
    flex-grow: 1;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
}

.that-ai-bot-product-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.that-ai-bot-product-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.that-ai-bot-product-card .that-ai-bot-product-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 10px;
}

.that-ai-bot-product-card .that-ai-bot-product-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    margin-right: 12px;
    aspect-ratio: 1 / 1;
    background-color: #f4f4f4;
}

.that-ai-bot-product-card .that-ai-bot-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.that-ai-bot-product-card .that-ai-bot-product-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.that-ai-bot-product-card .that-ai-bot-product-title {
    font-weight: bold;
    font-size: 0.9em;
    line-height: 1.3;
    margin-bottom: 4px;
    color: #1d2327;
}

.that-ai-bot-product-card .that-ai-bot-product-price {
    font-size: 0.85em;
    color: #555;
    margin-bottom: 4px;
}

.that-ai-bot-product-card .that-ai-bot-product-stock {
    font-size: 0.8em;
    font-weight: 500;
}

.that-ai-bot-product-card .that-ai-bot-product-stock.that-ai-bot-in-stock {
    color: #28a745;
}

.that-ai-bot-product-card .that-ai-bot-product-stock.that-ai-bot-out-of-stock {
    color: #dc3545;
}

/* --- Modern Rating Button Styles --- */

/* The container that holds the rating buttons */
.that-ai-bot-rating-container {
    display: flex;
    justify-content: center; /* Center the buttons */
    gap: 15px; /* Add space between the buttons */
    margin-top: 10px;
    padding: 5px 0;
}

/* Base style for both thumbs up and thumbs down buttons */
.that-ai-bot-rating-btn {
    width: 50px;           
    height: 50px;          
    border-radius: 50%;    
    border: 1px solid #eaeaea; /* Cleaner, lighter border */
    background-color: #ffffff; /* Crisp white background */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Bouncier modern transition */
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); /* Softer, wider shadow */
}

/* Style for hovering over any rating button */
.that-ai-bot-rating-btn:hover {
    transform: scale(1.15); /* Slightly more pop */
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* Specific hover color for Thumbs Up */
.that-ai-bot-rating-btn.that-ai-bot-thumbs-up:hover {
    background-color: #e8f5e9;
    border-color: #a5d6a7;
}

/* Specific hover color for Thumbs Down */
.that-ai-bot-rating-btn.that-ai-bot-thumbs-down:hover {
    background-color: #ffebee;
    border-color: #ef9a9a;
}

/* Force SVG Size and Prevent Flex Collapse (Overrides Theme Conflicts) */
.that-ai-bot-rating-svg {
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0 !important;
    transition: fill 0.2s ease, transform 0.2s ease;
    display: block;
}

/* Friendly default colored icons */
.that-ai-bot-thumbs-up .that-ai-bot-rating-svg {
    fill: #4caf50 !important; /* Friendly Green */
}

.that-ai-bot-thumbs-down .that-ai-bot-rating-svg {
    fill: #e57373 !important; /* Soft Coral/Red */
}

/* Dynamic SVG colors and playful tilt on hover */
.that-ai-bot-rating-btn.that-ai-bot-thumbs-up:hover .that-ai-bot-rating-svg {
    fill: #2e7d32 !important; /* Deeper Green */
    transform: rotate(-10deg); /* Playful tilt back */
}

.that-ai-bot-rating-btn.that-ai-bot-thumbs-down:hover .that-ai-bot-rating-svg {
    fill: #c62828 !important; /* Deeper Red */
    transform: rotate(10deg); /* Playful tilt forward */
}

/* Style for the "Thank you" feedback message after a rating is given */
.that-ai-bot-feedback-thanks {
    text-align: center;
    color: #888;
    font-style: italic;
    font-size: 0.9em;
    padding: 15px 0;
}

/* --- Dynamic Form Styles --- */

.that-ai-bot-form-container {
    background-color: #F5F7F9;
    border: 1px solid #E1E4E8;
    color: #37474F;
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
    width: 100%;
    box-sizing: border-box;
}

.that-ai-bot-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.that-ai-bot-form-prompt {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #24292e;
    text-align: left;
}

.that-ai-bot-form-field {
    display: flex;
    flex-direction: column;
}

.that-ai-bot-form-field label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px !important;
    color: #586069;
}

.that-ai-bot-form-field input {
    width: 100%;
    height: 34px !important; 
    padding: 0 8px !important; 
    min-height: 0 !important; 
    border: 1px solid #D1D5DA;
    border-radius: 4px;
    background-color: #ffffff;
    font-size: 14px;
    line-height: 34px !important;
    color: #24292e;
    box-sizing: border-box;
    transition: border-color 0.2s cubic-bezier(0.3, 0, 0.5, 1);
}

.that-ai-bot-form-field input:focus {
    outline: none;
    border-color: #0366d6;
    box-shadow: 0 0 0 2px rgba(3, 102, 214, 0.15);
}

.that-ai-bot-form-submit-btn {
    width: 100%;
    padding: 5px 10px !important;
    line-height: 1.2 !important; 
    height: auto !important;
    min-height: 0 !important;
    background-color: #0073aa; 
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px !important; 
    font-weight: 600 !important; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
    transition: background-color 0.2s ease;
}

.that-ai-bot-form-submit-btn:hover {
    background-color: #005177;
}

.that-ai-bot-form-submit-btn:active {
    transform: translateY(1px);
}

.that-ai-bot-form-submit-btn:disabled {
    background-color: #949494;
    cursor: not-allowed;
    opacity: 0.8;
}

.that-ai-bot-form-error {
    background-color: #ffeef0;
    color: #b31d28;
    padding: 8px;
    border-radius: 6px;
    font-size: 12px;
    text-align: center;
    border: 1px solid #f97583;
    margin-bottom: 8px;
}

/* Data Privacy Note under the form */
.that-ai-bot-privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.that-ai-bot-privacy-note svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.that-ai-bot-privacy-note span {
    color: #444;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
}

/* --- Conversation Lifecycle Styles --- */

.that-ai-bot-restart-btn {
    display: none;
}

.that-ai-bot-restart-container {
    padding: 10px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.that-ai-bot-restart-btn-main {
    width: auto;
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.that-ai-bot-restart-btn-main:hover {
    background-color: #0056b3;
}

/* --- Service Card Styles --- */
.that-ai-bot-services-container {
    display: flex;
    flex-grow: 1;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
}

.that-ai-bot-service-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.that-ai-bot-service-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.that-ai-bot-service-card .that-ai-bot-service-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 10px;
}

.that-ai-bot-service-card .that-ai-bot-service-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    margin-right: 12px;
    aspect-ratio: 1 / 1;
    background-color: #f4f4f4;
}

.that-ai-bot-service-card .that-ai-bot-service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.that-ai-bot-service-card .that-ai-bot-service-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.that-ai-bot-service-card .that-ai-bot-service-title {
    font-weight: bold;
    font-size: 0.9em;
    line-height: 1.3;
    margin-bottom: 4px;
    color: #1d2327;
}

.that-ai-bot-service-card .that-ai-bot-service-description {
    font-size: 0.85em;
    color: #555;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.that-ai-bot-service-card .that-ai-bot-service-price {
    font-size: 0.85em;
    color: #555;
    margin-top: auto;
}

/* --- Typing Indicator Animation --- */

/* Adjust the specific bubble that holds the dots */
.that-ai-bot-loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center; /* Center the dots */
    min-width: 60px;         /* Give it a little minimum width */
    min-height: 24px;        /* Ensure height consistency */
    gap: 5px;                /* Space between dots */
    padding: 12px 20px;      /* Slightly more padding than text */
}

/* Style the dots */
.that-ai-bot-loading-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #ffffff; /* White dots to contrast with blue bot bubble */
    border-radius: 50%;        /* Make them perfect circles */
    opacity: 0.6;              /* Start slightly faded */
    /* Animation: Name | Duration | Loop | Easing */
    animation: that-ai-bot-typing-bounce 1.4s infinite ease-in-out both;
}

/* Stagger the animation for the wave effect */
.that-ai-bot-loading-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.that-ai-bot-loading-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.that-ai-bot-loading-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Define the Bounce + Fade Keyframes */
@keyframes that-ai-bot-typing-bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    40% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* --- Mobile Responsiveness --- */
@media screen and (max-width: 480px) {
    #that-ai-bot-widget-container {
        width: 100% !important;
        height: 100% !important;
        max-height: none !important;
        right: 0;
        bottom: 0;
        left: 0;
        top: 0;
        border-radius: 0;
        border: none;
    }

/* Optional: Adjust input container padding for touch targets if needed */
    .that-ai-bot-input-container {
        padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    }

    .that-ai-bot-branding {
        bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    }
}

