/* Base styles */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background: transparent;
}

/* Chat container */
#chat-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Chat widget container */
#chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}
/* Welcome Message Popup */
.welcome-popup {
    position: absolute;
    right: 0;
    background: var(--theme-color);
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 280px;
    font-size: 14px;
    line-height: 1.5;
    color: white;
    width: 50vh;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateY(10px);
}

.welcome-popup.show {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.welcome-popup:hover {
    transform: translateY(-5px);
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.close-button{
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    position: absolute;
    top: 5px;
    right: 5px;
    color: #666;
    transition: color 0.2s ease;
}

.close-button:hover {
    color: #000;
}

.welcome-popup::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 24px;
    width: 0;
    height: 0;
    /* border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white; */
}

.welcome-popup.hidden {
    display: none;
}

.welcome-popup-content {
    padding-right: 20px;
}

#chat-container {
    width: 380px;
    height: 600px;
    position: relative;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    /* box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16); */
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    transform-origin: bottom right;
}

/* Position-specific minimized states */
#chat-container.minimized-bottom-right {
    transform-origin: bottom right;
}

#chat-container.minimized-bottom-left {
    transform-origin: bottom left;
}

#chat-container.minimized-top-right {
    transform-origin: top right;
}

#chat-container.minimized-top-left {
    transform-origin: top left;
}

#chat-container.minimized {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* Header styles */
.chat-header {
    background: var(--theme-color, #6C47FF);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    border-radius: 12px 12px 0 0 !important;
    /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 8px 12px -4px rgba(0, 0, 0, 0.2); */
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.end-chat-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
    border-radius: 6px;
}

.end-chat-button:hover {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.1);
}

.minimize-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.minimize-button:hover {
    transform: scale(1.1);
}

/* Chat widget button (shown when minimized) */
.chat-widget-button {
    width: 100px;
    height: 100px;
    border-radius: 80%;
    background: var(--theme-color, #6C47FF);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.chat-widget-button:hover {
    transform: scale(1.1);
}

.chat-widget-button-avatar {
    width: 90%;
    height: 90%;
    border-radius: 50%;
    overflow: hidden;
    background: white;
}

.chat-widget-button-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    overflow: hidden;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-status {
    display: flex;
    flex-direction: column;
}

.chat-status-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 2px;
}

.chat-status-indicator {
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
}

/* Messages container */
.chat-messages {
    /* flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #F8F9FB;
    display: flex;
    flex-direction: column;
    gap: 16px; */
}

/* Message bubbles */
.message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 100%;
}

.message.user {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    max-width: 77%;
    word-wrap: break-word;
    color: #fff;
}

/* Markdown content styling */
.message-content strong {
    font-weight: 600;
    color: inherit;
}

.message-content em {
    font-style: italic;
    color: inherit;
}

.message-content code {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: inherit;
}

.message-content br {
    margin-bottom: 4px;
}

/* Ensure proper spacing for markdown content */
.message-content p {
    margin: 0 0 8px 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message.assistant .message-content {
    background: rgb(174, 117, 218);
    color: rgb(255, 255, 255);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    /* Use mix-blend-mode to automatically handle light/dark text */
    mix-blend-mode: multiply;
    font-size: 14px;
}

.message.user .message-content {
    background: var(--theme-color);
    color: white;
}

/* Typing indicator */
.typing-indicator {
    display: none;
    padding: 8px 20px;
    background: #F8F9FB;
    align-items: center;
    gap: 8px;
}

.typing-indicator.active {
    display: flex;
    background: #F8F9FB;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #D1D1D1;
    color: var(--theme-color);
    animation: typing 1s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Input area */
.chat-input {
    padding: 12px;
    background: white;
    border: 1px solid rgb(153, 172, 194);
    display: flex;
    align-items: flex-end;
    gap: 12px;
    border-radius: 40px;
    margin-right:  12px;
}

.chat-input textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    padding: 8px 0;
    font-size: 14px;
    line-height: 1.4;
    max-height: 100px;
    font-family: inherit;
}

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

.send-button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--theme-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.send-button:hover {
    transform: scale(1.1);
}

.send-button svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

.voice-button {
    background-color: var(--theme-color);
    color: white;
    border-radius: 50%;
    padding: 8px;
    transition: transform 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.voice-button:hover {
    transform: scale(1.1);
}

.voice-button svg {
    width: 30px;
    height: 30px;
    stroke: currentColor;
}

.role-assistant .voice-button {
    background-color: var(--theme-color);
    color: white;
}

.role-user .voice-button {
    background-color: lightgray;
    color: black;
}


/* Mobile responsiveness */
@media (max-width: 480px) {
    #chat-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .chat-header {
        border-radius: 12px;
    }

    .chat-widget-button {
        bottom: 20px;
        right: 20px;
    }
}

/* Position-specific welcome popup styles */
#chat-widget[style*="bottom-left"] .welcome-popup {
    left: 0;
    right: auto;
}

#chat-widget[style*="top-right"] .welcome-popup {
    top: 80px;
    bottom: auto;
    right: 0;
    left: auto;
}

#chat-widget[style*="top-left"] .welcome-popup {
    top: 80px;
    bottom: auto;
    left: 0;
    right: auto;
}

#chat-widget[style*="bottom-right"] .welcome-popup {
    bottom: 120px;
    right: 0;
    left: auto;
    top: auto;
}

/* Chat container with modal open */
#chat-container.modal-open .chat-messages,
#chat-container.modal-open .chat-input,
#chat-container.modal-open .typing-indicator,
#chat-container.modal-open .voice-chat-container {
    filter: blur(2px);
    pointer-events: none;
}

#chat-container.modal-open .welcome-popup {
    display: none;
}

/* Registration Form Styles */
.registration-form {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    padding: 24px;
    transition: all 0.3s ease;
    width: 78% !important;
    max-width: 320px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

/* Semi-transparent overlay behind the form */
.registration-form::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: white;
    z-index: -1;
    border-radius: 12px;
}

.error-message {
    color: red;
    font-size: 14px;
    margin-bottom: 16px;
}

.error-message::before {
    content: '⚠️';
    margin-right: 4px;
}

.error-message::after {
    content: 'Please enter a valid name and email address.';
    margin-left: 4px;
}



@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.registration-form h3 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.registration-form input {
    background-color: #f8f9fb;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    color: #333;
    font-size: 14px;
    margin-bottom: 16px;
    padding: 12px 16px;
    transition: all 0.3s ease;
    /* width: 90%; */
}

.registration-form input:focus {
    border-color: var(--theme-color);
    box-shadow: 0 0 0 2px rgba(108, 71, 255, 0.1);
    outline: none;
}

.registration-form input::placeholder {
    color: #aaa;
}

.registration-form button {
    background-color: var(--theme-color);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    padding: 12px 20px;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.registration-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.registration-form button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.registration-form button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.registration-form button:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
} 

/* Rating Modal Styles */
.rating-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.rating-modal.show {
    opacity: 1;
    visibility: visible;
}

.rating-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.rating-modal.show .rating-content {
    transform: scale(1);
}

.rating-content h3 {
    color: #333;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.rating-content p {
    color: #666;
    font-size: 14px;
    margin-bottom: 24px;
}

.rating-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.star {
    font-size: 32px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.star:hover,
.star.active {
    color: #ffd700;
    transform: scale(1.1);
}

.star.active {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.rating-text {
    margin-bottom: 24px;
    min-height: 20px;
}

.rating-text p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.rating-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.skip-button,
.submit-button {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.skip-button {
    background-color: #f5f5f5;
    color: #666;
}

.skip-button:hover {
    background-color: #e0e0e0;
}

.submit-button {
    background-color: var(--theme-color, #6C47FF);
    color: white;
}

.submit-button:hover:not(:disabled) {
    background-color: #5a3de6;
    transform: translateY(-1px);
}

.submit-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Animation for rating submission */
.rating-submitted {
    animation: fadeOutScale 0.5s ease forwards;
}

@keyframes fadeOutScale {
    to {
        opacity: 0;
        transform: scale(0.8);
    }
} 
.powered-by{
    font-size: 12px;
    text-align: center;
    color: purple;
    margin-top: 12px;
}