/* Graffignano Chatbot Styles */

/* Container */
#graffignano-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Toggle Button */
#graffignano-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #4d0b11;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#graffignano-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Chat Window */
#graffignano-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    max-width: calc(100vw - 40px);
    height: 500px;
    max-height: calc(100vh - 120px);
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#graffignano-chat-window.graffignano-hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* Header */
#graffignano-chat-header {
    background-color: #4d0b11;
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
}

#graffignano-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#graffignano-chat-close:hover {
    opacity: 0.8;
}

/* Messages Container */
#graffignano-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f5f5f5;
}

/* Logo */
.graffignano-logo-container {
    text-align: center;
    margin-bottom: 20px;
}

#graffignano-logo {
    max-width: 180px;
    height: auto;
}

/* Messages */
.graffignano-message {
    margin-bottom: 16px;
    display: flex;
}

.graffignano-bot-message {
    justify-content: flex-start;
}

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

.graffignano-message-content {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.graffignano-bot-message .graffignano-message-content {
    background-color: #ffffff;
    color: #333333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.graffignano-bot-message .graffignano-message-content a {
    color: #4d0b11;
    text-decoration: underline;
    word-break: break-all;
}

.graffignano-bot-message .graffignano-message-content a:hover {
    color: #7a1119;
    text-decoration: none;
}

.graffignano-user-message .graffignano-message-content {
    background-color: #4d0b11;
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.graffignano-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 14px 18px;
    background-color: #ffffff;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.graffignano-typing-dot {
    width: 8px;
    height: 8px;
    background-color: #999;
    border-radius: 50%;
    animation: graffignano-typing-animation 1.4s infinite ease-in-out both;
}

.graffignano-typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.graffignano-typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes graffignano-typing-animation {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Input Area */
#graffignano-chat-input-area {
    display: flex;
    padding: 12px 16px;
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    gap: 10px;
}

#graffignano-chat-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 12px 18px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

#graffignano-chat-input:focus {
    border-color: #4d0b11;
}

#graffignano-chat-input::placeholder {
    color: #999;
}

#graffignano-chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #f5f5f5;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

#graffignano-chat-send:hover {
    background-color: #e8e8e8;
}

#graffignano-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #graffignano-chatbot-container {
        bottom: 10px;
        right: 10px;
    }
    
    #graffignano-chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 70px;
        right: -10px;
        border-radius: 12px;
    }
    
    #graffignano-chat-toggle {
        width: 56px;
        height: 56px;
    }
}
