/**
 * Chat Bridge v2 Styles
 */

.chat-bridge-wrapper {
    max-width: 800px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Auth Container */
.cb-auth-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.cb-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.cb-tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.cb-tab-btn:hover {
    color: #333;
}

.cb-tab-btn.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
    font-weight: 600;
}

.cb-tab-content {
    display: none;
}

.cb-tab-content.active {
    display: block;
}

/* Forms */
.cb-form {
    padding: 20px 0;
}

.cb-form-group {
    margin-bottom: 20px;
}

.cb-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.cb-form-group input,
.cb-form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.cb-form-group input:focus,
.cb-form-group select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* Buttons */
.cb-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.cb-btn-primary {
    background: #0073aa;
    color: #fff;
}

.cb-btn-primary:hover {
    background: #005a87;
}

.cb-btn-small {
    padding: 6px 12px;
    font-size: 12px;
    background: #dc3232;
    color: #fff;
}

.cb-btn-small:hover {
    background: #a00;
}

.cb-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Messages */
.cb-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
}

.cb-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cb-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Chat Container */
.cb-chat-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 600px;
}

.cb-chat-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cb-chat-header h3 {
    margin: 0;
    color: #333;
}

.cb-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cb-user-info span {
    color: #666;
    font-size: 14px;
}

/* Chat Messages */
.cb-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
}

.cb-message-item {
    margin-bottom: 15px;
    display: flex;
}

.cb-user-message {
    justify-content: flex-end;
}

.cb-ai-message {
    justify-content: flex-start;
}

.cb-message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

.cb-user-message .cb-message-bubble {
    background: #0073aa;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.cb-ai-message .cb-message-bubble {
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.cb-message-bubble p {
    margin: 0 0 5px 0;
    word-wrap: break-word;
}

.cb-message-time {
    font-size: 11px;
    opacity: 0.7;
    display: block;
    text-align: right;
}

.cb-ai-message .cb-message-time {
    text-align: left;
}

.cb-empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Chat Input */
.cb-chat-input-container {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
}

.cb-chat-form {
    display: flex;
    gap: 10px;
}

.cb-chat-form input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.cb-chat-form input:focus {
    outline: none;
    border-color: #0073aa;
}

/* Loading */
.cb-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.cb-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .chat-bridge-wrapper {
        margin: 10px;
    }
    
    .cb-chat-container {
        height: 500px;
    }
    
    .cb-message-bubble {
        max-width: 85%;
    }
    
    .cb-tabs {
        flex-wrap: wrap;
    }
}

