/**
 * ChatKit Widget Styles
 */

.chatkit-wrapper {
    margin: 20px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.chatkit-loading {
    padding: 40px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.chatkit-error {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
}

/* Make ChatKit widget responsive */
@media (max-width: 768px) {
    .chatkit-wrapper {
        margin: 10px 0;
    }
    
    openai-chatkit {
        min-height: 400px !important;
    }
}

/**
 * ChatKit Floating Widget Styles
 */

/* Floating Container */
.chatkit-floating-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Trigger Button */
.chatkit-trigger-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: #141a25;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatkit-trigger-button:hover {
    background: #1d4ed8;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    transform: translateY(-2px);
}

.chatkit-trigger-button:active {
    transform: translateY(0);
}

.chatkit-trigger-button svg {
    flex-shrink: 0;
}

.chatkit-button-text {
    white-space: nowrap;
}

/* Hide button when panel is open */
.chatkit-floating-container.chatkit-open .chatkit-trigger-button {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

/* Chat Panel */
.chatkit-panel {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 400px;
    height: 600px;
    max-height: calc(100vh - 100px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatkit-floating-container.chatkit-open .chatkit-panel {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

/* Panel Header */
.chatkit-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #d1d1d1;
    border-radius: 16px 16px 0 0;
}

.chatkit-panel-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.chatkit-close-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.chatkit-close-button:hover {
    background: #e5e7eb;
    color: #111827;
}

/* Panel Body */
.chatkit-panel-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Loading State */
.chatkit-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f9fafb;
}

.chatkit-loading p {
    color: #6b7280;
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatkit-floating-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }
    
    .chatkit-trigger-button {
        width: 100%;
        justify-content: center;
    }
    
    .chatkit-panel {
        width: 100%;
        height: calc(100vh - 80px);
        max-height: calc(100vh - 80px);
    }
}

@media (max-width: 480px) {
    .chatkit-trigger-button {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .chatkit-button-text {
        display: none;
    }
    
    .chatkit-trigger-button {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
    }
    
    .chatkit-floating-container {
        left: auto;
        right: 16px;
    }
}
