/* Chat Widget Styles */

/* Chat Bubble */
.chat-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #007ACC;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.chat-bubble:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}



.chat-bubble.open i.fa-comments {
    display: none;
}

.chat-bubble:not(.open) i.fa-times {
    display: none;
}

/* Chat Container */
.chat-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

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

.chat-header {
    background-color: #007ACC;
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.chat-header .close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f5f8fb;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.4;
    word-wrap: break-word;
}

.user-message {
    background-color: #007ACC;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

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

.chat-input-container {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    resize: none;
    height: 40px;
    max-height: 80px;
    overflow-y: auto;
}

.chat-submit {
    margin-left: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #2ECC71;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.chat-submit:hover {
    background-color: #27ae60;
}

.chat-submit:disabled {
    background-color: #95e2b8;
    cursor: not-allowed;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    background-color: #e9e9eb;
    border-radius: 18px;
    border-bottom-left-radius: 5px;
    max-width: 80px;
    align-self: flex-start;
}

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

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

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

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

@keyframes typing-animation {
    0%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

/* Welcome message */
.welcome-message {
    align-self: center;
    text-align: center;
    color: #666;
    margin: 10px 0;
    font-style: italic;
    font-size: 14px;
}

/* Responsive styles for mobile */
@media (max-width: 768px) {
    .chat-container {
        width: calc(100% - 30px);
        height: 70vh;
        bottom: 80px;
        right: 15px;
        max-height: 500px;
    }

    .chat-bubble {
        width: 55px;
        height: 55px;
        font-size: 22px;
        bottom: 15px;
        right: 15px;
    }

    .message {
        max-width: 85%;
        font-size: 14px;
    }

    .chat-header h3 {
        font-size: 15px;
    }

    .chat-input {
        font-size: 14px;
        padding: 8px 12px;
    }

    .chat-submit {
        width: 36px;
        height: 36px;
    }
}

/* Small phones optimization */
@media (max-width: 375px) {
    .chat-container {
        width: 100%;
        height: 80vh;
        bottom: 70px;
        right: 0;
        border-radius: 15px 15px 0 0;
    }

    .chat-bubble {
        width: 50px;
        height: 50px;
        bottom: 12px;
        right: 12px;
    }

    .chat-input-container {
        padding: 10px;
    }
}

/* Fix for iOS Safari viewport height issue */
@supports (-webkit-touch-callout: none) {
    .chat-container {
        max-height: 70vh;
        height: 70vh;
    }
}