/* GEM Enterprise AI Support System Styles */

.gem-ai-support {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: 'Financial Pro', 'Aeonik Pro', 'GT America', 'Inter', sans-serif;
}

/* Support Trigger Button - GEM Enterprise Format */
.support-trigger {
    display: flex;
    align-items: center;
    background: linear-gradient(145deg, #0a0e1a 0%, #111827 50%, #1f2937 100%);
    color: var(--text-primary);
    padding: 18px 24px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(6, 102, 204, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    animation: gem-pulse 4s infinite;
    font-family: 'Financial Pro', 'Aeonik Pro', 'GT America', sans-serif;
    position: relative;
    overflow: hidden;
}

.support-trigger::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(6, 102, 204, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.support-trigger:hover::before {
    opacity: 1;
}

.support-trigger:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(6, 102, 204, 0.5);
    border-color: var(--primary-color);
}

.trigger-avatar {
    position: relative;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(6, 102, 204, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
}

.status-indicator.online {
    background: #10b981;
    animation: pulse-status 2s infinite;
}

.trigger-text {
    display: flex;
    flex-direction: column;
}

.trigger-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.trigger-status {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 400;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.trigger-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success-color);
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse-status 2s infinite;
}

/* Chat Widget - GEM Enterprise Format */
.support-chat {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 400px;
    height: 650px;
    background: var(--bg-card);
    border-radius: 20px 20px 12px 12px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--border-color);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-light);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
}

.support-chat.open {
    display: flex;
    transform: translateY(0) scale(1);
    opacity: 1;
}

.support-chat.minimized {
    transform: translateY(100%) scale(0.8);
    opacity: 0;
}

/* Chat Header - GEM Enterprise Format */
.chat-header {
    background: linear-gradient(145deg, #0a0e1a 0%, #111827 100%);
    color: var(--text-primary);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--primary-color) 50%, transparent 100%);
}

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

.ai-avatar {
    position: relative;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 18px;
    color: white;
    box-shadow: 0 4px 12px rgba(6, 102, 204, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid white;
    border-radius: 50%;
    animation: pulse-status 2s infinite;
}

.header-text {
    display: flex;
    flex-direction: column;
}

.agent-name {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.agent-status {
    font-size: 13px;
    opacity: 0.8;
    font-weight: 400;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.agent-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success-color);
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse-status 2s infinite;
}

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

.btn-minimize, .btn-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.btn-minimize:hover, .btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-darker);
    scroll-behavior: smooth;
    border-top: 1px solid var(--border-color);
}

.message {
    display: flex;
    margin-bottom: 16px;
    animation: slideInMessage 0.3s ease-out;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 4px;
}

.ai-message .message-avatar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 10px;
}

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

.user-message .message-avatar {
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    margin-right: 0;
    margin-left: 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.message-content {
    flex: 1;
    max-width: 70%;
}

.user-message .message-content {
    text-align: right;
}

.message-text {
    background: var(--bg-card);
    padding: 14px 18px;
    border-radius: 16px 16px 16px 6px;
    color: var(--text-primary);
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    font-size: 14px;
    font-family: 'Financial Pro', 'Aeonik Pro', sans-serif;
}

.user-message .message-text {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 16px 16px 6px 16px;
    border: 1px solid var(--primary-light);
}

.message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    padding: 0 4px;
}

.user-message .message-time {
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    margin-bottom: 16px;
    animation: slideInMessage 0.3s ease-out;
}

.typing-indicator .message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 14px;
}

.typing-dots {
    display: flex;
    align-items: center;
    background: white;
    padding: 12px 16px;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing-pulse 1.4s infinite;
}

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

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

/* Chat Input - GEM Enterprise Format */
.chat-input-area {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 20px 24px;
    position: relative;
}

.chat-input-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--primary-color) 50%, transparent 100%);
}

.input-container {
    display: flex;
    align-items: center;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px 10px 6px 18px;
    margin-bottom: 16px;
    transition: border-color 0.3s ease;
}

.input-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

#chatInput {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 10px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    font-family: 'Financial Pro', 'Aeonik Pro', sans-serif;
}

#chatInput::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(6, 102, 204, 0.3);
}

.send-btn:hover {
    transform: scale(1.05);
}

.send-btn:active {
    transform: scale(0.95);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.quick-btn {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quick-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Agent Transfer */
.agent-transfer {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 16px;
    margin-top: 8px;
}

.transfer-info {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    color: #1e40af;
    font-size: 14px;
    font-weight: 500;
}

.transfer-info i {
    margin-right: 8px;
}

.transfer-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.transfer-form input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.transfer-form input:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 1px #0066cc;
}

#confirmTransfer {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#confirmTransfer:hover {
    transform: translateY(-1px);
}

/* Animations */
@keyframes gem-pulse {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(6, 102, 204, 0.3);
    }
    50% {
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(6, 102, 204, 0.6);
    }
}

@keyframes pulse-status {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes slideInMessage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typing-pulse {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .support-chat {
        width: calc(100vw - 20px);
        height: calc(100vh - 40px);
        bottom: 10px;
        right: 10px;
        border-radius: 16px;
    }
    
    .support-trigger {
        padding: 12px 16px;
        border-radius: 40px;
    }
    
    .trigger-avatar {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .trigger-title {
        font-size: 14px;
    }
    
    .trigger-status {
        font-size: 11px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .support-trigger,
    .support-chat,
    .message,
    .typing-indicator {
        animation: none;
        transition: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .support-trigger {
        border: 2px solid white;
    }
    
    .message-text {
        border: 2px solid #374151;
    }
    
    .user-message .message-text {
        border: 2px solid white;
    }
}

/* Dark mode compatibility */
@media (prefers-color-scheme: dark) {
    .support-chat {
        background: #1f2937;
        border-color: #374151;
    }
    
    .chat-messages {
        background: #111827;
    }
    
    .message-text {
        background: #374151;
        color: #f9fafb;
        border-color: #4b5563;
    }
    
    .chat-input-area {
        background: #1f2937;
        border-color: #374151;
    }
    
    .input-container {
        background: #374151;
        border-color: #4b5563;
    }
    
    #chatInput {
        color: #f9fafb;
    }
    
    #chatInput::placeholder {
        color: #9ca3af;
    }
    
    .quick-btn {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }
    
    .quick-btn:hover {
        background: #4b5563;
        color: #f9fafb;
    }
}