/* Floyd Chatbot Styles */
#floyd-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: 'Source Sans Pro', Arial, sans-serif;
}

/* Chat Toggle Button */
.floyd-chat-toggle {
    background: white;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 200px;
    animation: floydBounce 2s ease-in-out infinite;
}

.floyd-chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.floyd-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.floyd-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.floyd-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #28a745;
    border: 2px solid white;
    border-radius: 50%;
    animation: floydPulse 2s ease-in-out infinite;
}

.floyd-preview {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: #183247;
    min-width: 0;
}

.floyd-preview strong {
    font-weight: 600;
    font-size: 14px;
}

.floyd-preview span {
    font-size: 12px;
    color: #6c757d;
}

/* Chat Window */
.floyd-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.floyd-chat-open .floyd-chat-window {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.floyd-chat-closed .floyd-chat-toggle {
    animation: floydBounce 2s ease-in-out infinite;
}

.floyd-chat-open .floyd-chat-toggle {
    animation: none;
}

/* Chat Header */
.floyd-chat-header {
    background: linear-gradient(135deg, #02b875, #028a60);
    color: white;
    padding: 16px 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.floyd-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.floyd-avatar-small {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
}

.floyd-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.floyd-avatar-small .floyd-status-dot {
    width: 10px;
    height: 10px;
    bottom: 1px;
    right: 1px;
}

.floyd-header-text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.floyd-header-text span {
    font-size: 12px;
    opacity: 0.9;
}

.floyd-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.floyd-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Messages Area */
.floyd-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fa;
}

.floyd-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.floyd-message-user {
    align-items: flex-end;
    align-self: flex-end;
}

.floyd-message-bot {
    align-items: flex-start;
    align-self: flex-start;
}

.floyd-message-content {
    padding: 10px 14px;
    border-radius: 16px;
    line-height: 1.4;
    word-wrap: break-word;
}

.floyd-message-user .floyd-message-content {
    background: #02b875;
    color: white;
    border-bottom-right-radius: 4px;
}

.floyd-message-bot .floyd-message-content {
    background: white;
    color: #183247;
    border: 1px solid #e1e8ed;
    border-bottom-left-radius: 4px;
}

.floyd-message-time {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
    padding: 0 4px;
}

.floyd-message-content a {
    color: inherit;
    text-decoration: underline;
}

.floyd-message-user .floyd-message-content a {
    color: #e0f8f0;
}

/* Better message formatting */
.floyd-message-content p {
    margin: 8px 0;
}

.floyd-message-content p:first-child {
    margin-top: 0;
}

.floyd-message-content p:last-child {
    margin-bottom: 0;
}

.floyd-message-content strong {
    font-weight: 600;
}

/* Support Form */
.floyd-support-form {
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    padding: 20px;
    margin: 10px 0;
    max-width: 300px;
}

.floyd-support-form h4 {
    margin: 0 0 15px 0;
    color: #183247;
    font-size: 16px;
    font-weight: 600;
}

.floyd-support-form .form-group {
    margin-bottom: 15px;
}

.floyd-support-form label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 500;
    color: #183247;
}

.floyd-support-form input,
.floyd-support-form textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}

.floyd-support-form input:focus,
.floyd-support-form textarea:focus {
    outline: none;
    border-color: #02b875;
}

.floyd-support-submit,
.floyd-support-cancel {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-right: 8px;
    transition: all 0.2s ease;
}

.floyd-support-submit {
    background: #02b875;
    color: white;
}

.floyd-support-submit:hover {
    background: #028a60;
}

.floyd-support-cancel {
    background: #6c757d;
    color: white;
}

.floyd-support-cancel:hover {
    background: #5a6268;
}

/* Typing Indicator */
.floyd-typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px 8px;
    background: #f8f9fa;
}

.floyd-typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: white;
    border-radius: 16px;
    border: 1px solid #e1e8ed;
}

.floyd-typing-dots span {
    width: 6px;
    height: 6px;
    background: #6c757d;
    border-radius: 50%;
    animation: floydTypingDot 1.4s ease-in-out infinite both;
}

.floyd-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.floyd-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

.floyd-typing-text {
    font-size: 12px;
    color: #6c757d;
}

/* Input Area */
.floyd-chat-input-area {
    border-top: 1px solid #e1e8ed;
    background: white;
    border-radius: 0 0 16px 16px;
}

.floyd-quick-actions {
    padding: 12px 16px 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.floyd-quick-btn {
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 16px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6c757d;
}

.floyd-quick-btn:hover {
    background: #02b875;
    color: white;
    border-color: #02b875;
}

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

#floyd-chat-input {
    flex: 1;
    border: 1px solid #e1e8ed;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s ease;
    min-height: 20px;
    max-height: 80px;
}

#floyd-chat-input:focus {
    border-color: #02b875;
}

.floyd-chat-send {
    background: #02b875;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.floyd-chat-send:hover {
    background: #028a60;
}

.floyd-chat-send:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Animations */
@keyframes floydBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-4px);
    }
    60% {
        transform: translateY(-2px);
    }
}

@keyframes floydPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes floydTypingDot {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #floyd-chat-widget {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .floyd-chat-window {
        width: 100%;
        height: 70vh;
        max-height: 500px;
        bottom: 70px;
        right: 0;
        left: 0;
        margin: 0 10px;
        width: calc(100% - 20px);
    }

    .floyd-chat-toggle {
        max-width: none;
        padding: 10px 16px;
    }

    .floyd-preview {
        display: none;
    }

    .floyd-avatar {
        width: 44px;
        height: 44px;
    }

    .floyd-quick-actions {
        flex-direction: column;
    }

    .floyd-quick-btn {
        align-self: flex-start;
    }
}

@media (max-width: 380px) {
    .floyd-chat-window {
        border-radius: 12px;
    }

    .floyd-chat-header {
        border-radius: 12px 12px 0 0;
    }

    .floyd-chat-input-area {
        border-radius: 0 0 12px 12px;
    }
}