/* Chat widget icon */
.chat-widget-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.2);
    z-index: 99;
    transition: transform 0.3s ease;
}

.chat-widget-icon:hover {
    transform: scale(1.1);
}

.chat-widget-icon img.chat-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

/* Chat container */
.chat-container {
    width: 400px;
    height: 550px;
    background-color: #1a1a1a;
    border-radius: 20px;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 98;
}

/* Chat header */
.chat-header {
    background-color: #202a33;
    color: white;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #444;
    border-radius: 20px 20px 0 0;
}

.chat-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chat-header .chat-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.chat-header .chat-title h2 {
    margin: 0;
    font-size: 16px;
}

.chat-header .chat-title p {
    margin: 0;
    font-size: 12px;
    color: #b3b3b3;
}

/* Chat controls */
.chat-controls {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.reload-chat, .close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0 5px;
}

.reload-chat:hover, .close-chat:hover {
    color: #ccc;
}

/* Chat messages area */
.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #1a1a1a;
    color: white;
}

.user, .bot {
    padding: 10px 15px;
    border-radius: 20px;
    margin: 10px 0;
    max-width: 70%;
    word-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.5;
}

.user {
    background-color: #007bff;
    color: white;
    margin-left: auto;
    text-align: right;
}

.bot {
    background-color: #444;
    color: white;
    margin-right: auto;
    text-align: left;
}

/* Chat input area */
.chat-input {
    display: flex;
    padding: 10px;
    background-color: #333;
    border-top: 1px solid #444;
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 20px;
    background-color: #222;
    color: white;
    font-size: 16px;
    outline: none;
    margin-right: 10px;
}

.chat-input input::placeholder {
    color: #666;
}

.chat-input button {
    padding: 10px 20px;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.chat-input button:hover {
    background-color: #0056b3;
}

.chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typing indicator */
.typing {
    display: flex;
    gap: 5px;
    margin: 5px 10px;
    padding: 5px 10px;
}

.typing div {
    width: 8px;
    height: 8px;
    background-color: #ccc;
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite;
}

.typing div:nth-child(2) {
    animation-delay: 0.2s;
}

.typing div:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 100% { transform: scale(0.8); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; }
}

/* Mobile responsiveness */
@media screen and (max-width: 480px) {
    .chat-container {
        width: 90%;
        right: 5%;
        left: 5%;
        bottom: 70px;
    }
    
    .chat-widget-icon {
        width: 50px;
        height: 50px;
        bottom: 10px;
        right: 10px;
    }
}

/* Links in bot messages */
.bot a {
    color: #007bff;
    text-decoration: underline;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.bot a:hover {
    color: #0056b3;
}

/* Footer styles */
.chat-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 8px;
    background-color: #202a33;
    border-top: 1px solid #444;
}

.chat-footer a {
    color: #b3b3b3;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.3s ease;
}

.chat-footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}