/* Georg Fischer WMS Chatbot Button Styles */

/* Floating Button */
.gf-chatbot-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #1965a3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(25, 101, 163, 0.3);
    transition: all 0.3s ease;
    z-index: 9998;
}

.gf-chatbot-button:hover {
    background: #124876;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(25, 101, 163, 0.4);
}

.gf-chatbot-button.active {
    background: #124876;
    transform: scale(0.95);
}

.gf-chatbot-button.pulse {
    animation: pulse 1s ease-out;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(25, 101, 163, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(25, 101, 163, 0); }
    100% { box-shadow: 0 0 0 0 rgba(25, 101, 163, 0); }
}

.chatbot-button-icon {
    position: relative;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
}

.chatbot-button-tooltip {
    position: absolute;
    right: 70px;
    background: #1a1e2a;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.gf-chatbot-button:hover .chatbot-button-tooltip {
    opacity: 1;
}

/* Chat Widget */
.gf-chatbot-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    animation: slideUp 0.3s ease-out;
}

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

.gf-chatbot-widget.fullscreen {
    width: 100%;
    height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
}

/* Widget Header */
.chatbot-widget-header {
    background: #1965a3;
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-widget-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-widget-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-status-indicator {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

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

.chatbot-widget-actions button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-widget-actions button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Widget Messages */
.chatbot-widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f7fafc;
}

.widget-welcome-message {
    text-align: center;
    padding: 40px 20px;
}

.welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.widget-welcome-message h4 {
    color: #1965a3;
    margin: 0 0 8px;
    font-size: 20px;
}

.widget-welcome-message p {
    color: #718096;
    margin: 0 0 24px;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 280px;
    margin: 0 auto;
}

.quick-action {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    color: #1965a3;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-action:hover {
    background: #1965a3;
    color: white;
    border-color: #1965a3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(25, 101, 163, 0.2);
}

/* Chat Messages */
.widget-message {
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

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

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

.message-bubble {
    display: inline-block;
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    background: white;
    color: #2d3748;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    text-align: left;
    line-height: 1.5;
    font-size: 14px;
}

.user-message .message-bubble {
    background: #1965a3;
    color: white;
}

.message-time {
    font-size: 11px;
    color: #a0aec0;
    margin-top: 4px;
}

/* Typing Indicator */
.typing-indicator .message-bubble {
    padding: 12px 20px;
}

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

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #a0aec0;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Widget Input */
.chatbot-widget-input {
    border-top: 1px solid #e2e8f0;
    background: white;
    padding: 16px;
}

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

#widget-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    line-height: 1.5;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

#widget-input:focus {
    outline: none;
    border-color: #1965a3;
}

.widget-send-btn {
    width: 40px;
    height: 40px;
    background: #1965a3;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.widget-send-btn:hover:not(:disabled) {
    background: #124876;
    transform: scale(1.05);
}

.widget-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.widget-input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.widget-action {
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
}

.widget-action:hover {
    color: #1965a3;
}

.widget-action.recording {
    color: #ef4444;
    animation: pulse-red 1s infinite;
}

@keyframes pulse-red {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.widget-char-count {
    margin-left: auto;
    font-size: 12px;
    color: #a0aec0;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .gf-chatbot-button {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
    
    .gf-chatbot-widget {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        right: 20px;
        bottom: 90px;
    }
    
    .chatbot-button-tooltip {
        display: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .gf-chatbot-widget {
        background: #1a1e2a;
        color: #e2e8f0;
    }
    
    .chatbot-widget-messages {
        background: #2d3748;
    }
    
    .message-bubble {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .chatbot-widget-input {
        background: #1a1e2a;
        border-top-color: #4a5568;
    }
    
    #widget-input {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .quick-action {
        background: #2d3748;
        border-color: #4a5568;
        color: #4aa6e5;
    }
}