/* Azure OpenAI Chatbot Styles */

:root {
    --azure-chatbot-primary-color: #4F46E5;
    --azure-chatbot-secondary-color: #818CF8;
    --azure-chatbot-text-color: #111827;
    --azure-chatbot-bg-color: #ffffff;
    --azure-chatbot-border-color: #E5E7EB;
    --azure-chatbot-hover-color: #F3F4F6;
    --azure-chatbot-message-user-bg: #F3F4F6;
    --azure-chatbot-message-assistant-bg: #ffffff;
    --azure-chatbot-shadow-color: rgba(0, 0, 0, 0.1);
    --azure-chatbot-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Dark Theme */
.azure-chatbot-container.theme-dark {
    --azure-chatbot-text-color: #E5E7EB;
    --azure-chatbot-bg-color: #1F2937;
    --azure-chatbot-border-color: #374151;
    --azure-chatbot-hover-color: #374151;
    --azure-chatbot-message-user-bg: #374151;
    --azure-chatbot-message-assistant-bg: #1F2937;
    --azure-chatbot-shadow-color: rgba(0, 0, 0, 0.5);
}

.azure-chatbot-container {
    font-family: var(--azure-chatbot-font-family);
    color: var(--azure-chatbot-text-color);
    line-height: 1.5;
    font-size: 16px;
    position: fixed;
    z-index: 999999;
}

/* Chat Button */
.azure-chatbot-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background-color: var(--azure-chatbot-primary-color);
    border: none;
    box-shadow: 0 4px 6px var(--azure-chatbot-shadow-color);
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    padding: 0;
}

.azure-chatbot-button:hover {
    transform: scale(1.05);
}

.azure-chatbot-button-logo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

/* Chat Dialog */
.azure-chatbot-dialog {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background-color: var(--azure-chatbot-bg-color);
    border-radius: 10px;
    box-shadow: 0 4px 12px var(--azure-chatbot-shadow-color);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    border: 1px solid var(--azure-chatbot-border-color);
    visibility: hidden;
}

.azure-chatbot-dialog.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

.azure-chatbot-dialog.is-fullscreen {
    width: 80vw;
    height: 80vh;
    top: 10vh;
    left: 10vw;
    right: auto;
    bottom: auto;
}

/* Chat Header */
.azure-chatbot-header {
    padding: 12px 16px;
    background-color: var(--azure-chatbot-primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.azure-chatbot-header-info {
    display: flex;
    align-items: center;
}

.azure-chatbot-header-logo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
    object-fit: cover;
}

.azure-chatbot-header-title {
    font-weight: 600;
    font-size: 16px;
}

.azure-chatbot-header-actions {
    display: flex;
    gap: 8px;
}

.azure-chatbot-icon-button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.azure-chatbot-icon-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Fullscreen icons */
.azure-chatbot-fullscreen-minimize-icon {
    display: none;
}

.azure-chatbot-dialog.is-fullscreen .azure-chatbot-fullscreen-maximize-icon {
    display: none;
}

.azure-chatbot-dialog.is-fullscreen .azure-chatbot-fullscreen-minimize-icon {
    display: block;
}

/* Theme icons */
.theme-light .azure-chatbot-theme-light-icon {
    display: none;
}

.theme-light .azure-chatbot-theme-dark-icon {
    display: block;
}

.theme-dark .azure-chatbot-theme-light-icon {
    display: block;
}

.theme-dark .azure-chatbot-theme-dark-icon {
    display: none;
}

/* Messages Container */
.azure-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Message Bubbles */
.azure-chatbot-message {
    display: flex;
    max-width: 85%;
}

.azure-chatbot-message-assistant {
    align-self: flex-start;
}

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

.azure-chatbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--azure-chatbot-primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
    margin: 0 8px;
}

.azure-chatbot-message-user .azure-chatbot-message-avatar {
    background-color: var(--azure-chatbot-secondary-color);
}

.azure-chatbot-message-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.azure-chatbot-message-content {
    background-color: var(--azure-chatbot-message-assistant-bg);
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--azure-chatbot-border-color);
    box-shadow: 0 1px 2px var(--azure-chatbot-shadow-color);
}

.azure-chatbot-message-user .azure-chatbot-message-content {
    background-color: var(--azure-chatbot-message-user-bg);
}

.azure-chatbot-message-content p {
    margin: 0 0 8px;
}

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

/* Chat Footer */
.azure-chatbot-footer {
    border-top: 1px solid var(--azure-chatbot-border-color);
    padding: 12px 16px;
    background-color: var(--azure-chatbot-bg-color);
}

.azure-chatbot-form {
    width: 100%;
}

.azure-chatbot-input-container {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.azure-chatbot-input {
    flex: 1;
    border: 1px solid var(--azure-chatbot-border-color);
    border-radius: 20px;
    padding: 12px 16px;
    resize: none;
    background-color: var(--azure-chatbot-bg-color);
    color: var(--azure-chatbot-text-color);
    outline: none;
    font-family: inherit;
    font-size: inherit;
    max-height: 120px;
    transition: border-color 0.3s ease;
}

.azure-chatbot-input:focus {
    border-color: var(--azure-chatbot-primary-color);
}

.azure-chatbot-send-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--azure-chatbot-primary-color);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.azure-chatbot-send-button:hover {
    background-color: var(--azure-chatbot-secondary-color);
}

/* Loading indicator */
.azure-chatbot-loading {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    color: var(--azure-chatbot-text-color);
    opacity: 0.7;
}

.azure-chatbot-loading-dots {
    display: flex;
}

.azure-chatbot-loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    margin: 0 2px;
    animation: azure-chatbot-loading-dot 1.4s infinite ease-in-out both;
}

.azure-chatbot-loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

/* Conversation State Management */
.azure-chatbot-conversation-state {
    width: 100%;
}

.azure-chatbot-conversation-actions {
    margin-top: 12px;
    display: flex;
    justify-content: center;
}

.azure-chatbot-end-button {
    background-color: var(--azure-chatbot-secondary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.azure-chatbot-end-button:hover {
    background-color: var(--azure-chatbot-primary-color);
}

/* Feedback Container */
.azure-chatbot-feedback-container {
    padding: 16px;
    text-align: center;
}

.azure-chatbot-feedback-header h4 {
    margin: 0 0 8px 0;
    color: var(--azure-chatbot-text-color);
    font-size: 18px;
}

.azure-chatbot-feedback-header p {
    margin: 0 0 16px 0;
    color: var(--azure-chatbot-text-color);
    opacity: 0.8;
    font-size: 14px;
}

.azure-chatbot-feedback-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 16px;
}

.azure-chatbot-feedback-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    border: 2px solid var(--azure-chatbot-border-color);
    border-radius: 12px;
    background-color: var(--azure-chatbot-bg-color);
    color: var(--azure-chatbot-text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.azure-chatbot-feedback-button:hover {
    border-color: var(--azure-chatbot-primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.azure-chatbot-feedback-positive:hover {
    border-color: #10B981;
    color: #10B981;
}

.azure-chatbot-feedback-negative:hover {
    border-color: #EF4444;
    color: #EF4444;
}

.azure-chatbot-feedback-button.selected {
    border-color: var(--azure-chatbot-primary-color);
    background-color: var(--azure-chatbot-primary-color);
    color: white;
}

.azure-chatbot-feedback-positive.selected {
    border-color: #10B981;
    background-color: #10B981;
}

.azure-chatbot-feedback-negative.selected {
    border-color: #EF4444;
    background-color: #EF4444;
}

.azure-chatbot-feedback-button span {
    font-size: 14px;
    font-weight: 500;
}

/* Feedback Detail */
.azure-chatbot-feedback-detail {
    margin-top: 16px;
}

.azure-chatbot-feedback-detail textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--azure-chatbot-border-color);
    border-radius: 8px;
    background-color: var(--azure-chatbot-bg-color);
    color: var(--azure-chatbot-text-color);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s ease;
}

.azure-chatbot-feedback-detail textarea:focus {
    border-color: var(--azure-chatbot-primary-color);
}

.azure-chatbot-feedback-actions {
    margin-top: 12px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.azure-chatbot-button-primary {
    background-color: var(--azure-chatbot-primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.azure-chatbot-button-primary:hover {
    background-color: var(--azure-chatbot-secondary-color);
}

.azure-chatbot-button-secondary {
    background-color: transparent;
    color: var(--azure-chatbot-text-color);
    border: 1px solid var(--azure-chatbot-border-color);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.azure-chatbot-button-secondary:hover {
    background-color: var(--azure-chatbot-hover-color);
}

/* Feedback Thanks */
.azure-chatbot-feedback-thanks {
    padding: 20px;
    text-align: center;
}

.azure-chatbot-feedback-thanks p {
    margin: 0 0 16px 0;
    color: var(--azure-chatbot-text-color);
    font-size: 16px;
}

.azure-chatbot-loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes azure-chatbot-loading-dot {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Scrollbar styles */
.azure-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.azure-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.azure-chatbot-messages::-webkit-scrollbar-thumb {
    background-color: var(--azure-chatbot-border-color);
    border-radius: 3px;
}

.azure-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background-color: var(--azure-chatbot-secondary-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .azure-chatbot-dialog {
        width: calc(100% - 40px);
        height: 60vh;
    }

    .azure-chatbot-dialog.is-fullscreen {
        width: 100vw;
        height: 100vh;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }
}