/**
 * Floating Chat Widget Styles
 */

/* Floating Button */
.floating-chat-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10a37f 0%, #0d8a6c 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 9998;
    animation: slideInUp 0.4s ease;
}

.floating-chat-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.floating-chat-button:active {
    transform: scale(0.95);
}

.floating-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid white;
}

/* Chat Modal */
.floating-chat-modal {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 48px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    animation: slideInUp 0.3s ease;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .floating-chat-modal {
        background: #1e1e1e;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    }
}

/* Chat Header */
.floating-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px 16px 0 0;
    background: linear-gradient(135deg, #10a37f 0%, #0d8a6c 100%);
    color: white;
}

.floating-chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.floating-chat-title {
    font-weight: 600;
    font-size: 16px;
}

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

.floating-chat-header-actions button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.floating-chat-header-actions button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Body */
.floating-chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.floating-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Welcome Message */
.floating-chat-welcome {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.floating-chat-welcome h3 {
    margin: 16px 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.floating-chat-welcome p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Messages */
.floating-chat-message {
    display: block;
    animation: fadeIn 0.3s ease;
    margin-bottom: 16px;
}

.floating-message-content {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
}

.floating-chat-message-user .floating-message-content {
    background: transparent;
    color: inherit;
    text-align: right;
}

.floating-chat-message-ai .floating-message-content {
    background: #f0f0f0;
    color: #333;
    text-align: left;
}

/* Dark mode message colors */
@media (prefers-color-scheme: dark) {
    .floating-chat-message-ai .floating-message-content {
        background: #2a2a2a;
        color: #e0e0e0;
    }
}

/* Typing Indicator */
.typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 4px 0;
}

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

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

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

/* Input Container */
.floating-chat-input-container {
    padding: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.floating-chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.floating-chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0;
    font-size: 14px;
    resize: none;
    outline: none;
    font-family: inherit;
    max-height: 120px;
    transition: border-color 0.2s ease;
}

.floating-chat-input:focus {
    border-color: #10a37f;
}

.floating-chat-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #10a37f;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.floating-chat-send:hover:not(:disabled) {
    background: #0d8a6c;
    transform: scale(1.05);
}

.floating-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .floating-chat-modal {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        right: 16px;
        bottom: 16px;
    }
    
    .floating-chat-button {
        right: 16px;
        bottom: 16px;
    }
}

@media (max-width: 480px) {
    .floating-chat-modal {
        width: 100vw;
        height: 100vh;
        right: 0;
        bottom: 0;
        border-radius: 0;
        max-height: 100vh;
    }
}