/**
 * Frontend styles for Thai Garden Chatbot
 */

/* Chat container */
.tgcb-chat-container {
    position: fixed;
    bottom: 30px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Chat button */
.tgcb-chat-button {
    width: 60px;
    height: 75px;
    border-radius: 15px;
    background-color: #4CAF50;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    padding: 5px;
}

.tgcb-chat-button:hover {
    transform: scale(1.05);
}

.tgcb-chat-icon {
    display: flex;
    justify-content: center;
    align-items: center;
}

.tgcb-chat-button svg {
    width: 30px;
    height: 30px;
}

.tgcb-chat-label {
    font-size: 12px;
    margin-top: 5px;
    font-weight: bold;
    text-align: center;
}

/* Chat box */
.tgcb-chat-box {
    display: none;
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 350px;
    height: 450px;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    flex-direction: column;
}

.tgcb-chat-box.active {
    display: flex;
}

/* Chat header */
.tgcb-chat-header {
    background-color: #4CAF50;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.tgcb-chat-header h3 {
    margin: 0;
    font-size: 16px;
}

.tgcb-chat-close {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.tgcb-chat-close svg {
    width: 20px;
    height: 20px;
}

/* Chat messages */
.tgcb-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.tgcb-chat-message {
    max-width: 80%;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
}

.tgcb-chat-message-user {
    background-color: #e6f7ff;
    color: #333;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.tgcb-chat-message-bot {
    background-color: #f1f1f1;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

/* Links in chat messages */
.tgcb-chat-message-bot a,
.tgcb-link {
    color: #0066cc;
    text-decoration: underline;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 1000;
}

.tgcb-chat-message-bot a:hover,
.tgcb-link:hover {
    color: #004c99;
    text-decoration: none;
}

.tgcb-chat-message-bot a:active,
.tgcb-link:active {
    color: #003366;
}

/* Text formatting in chat messages */
.tgcb-chat-message-bot strong {
    font-weight: bold;
}

.tgcb-chat-message-bot em {
    font-style: italic;
}

/* Typing indicator */
.tgcb-typing-indicator {
    padding: 10px 15px;
    font-size: 14px;
    animation: typingAnimation 1s infinite;
}

@keyframes typingAnimation {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Chat input */
.tgcb-chat-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ddd;
    background-color: #f9f9f9;
}

.tgcb-chat-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

.tgcb-chat-input input:focus {
    border-color: #4CAF50;
}

.tgcb-chat-send {
    background-color: #4CAF50;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.tgcb-chat-send:hover {
    background-color: #45a049;
}

.tgcb-chat-send svg {
    width: 20px;
    height: 20px;
}

/* Responsive */
@media (max-width: 480px) {
    .tgcb-chat-box {
        width: 300px;
        height: 400px;
        right: 0;
    }
}

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

.tgcb-chat-message {
    animation: fadeIn 0.3s ease-out;
} 