/* Chat Button and Area Styles */
.chat-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background-color: #2196F3;  /* Changed to blue to match received messages */
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background-color 0.2s ease;
    z-index: 1000;
}

.chat-button:hover {
    transform: scale(1.05);
    background-color: #1976D2;  /* Darker blue on hover */
}

.chat-button i {
    font-size: 1.5rem;
    color: white;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.notification-badge.active {
    opacity: 1;
    transform: scale(1);
}

.chat-area {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    width: 350px;
    height: 500px;
    background-color: var(--background-color);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 999;
}

.chat-area.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chat-header {
    padding: 1rem;
    background-color: var(--primary-color);
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    color: white;
    margin: 0;
    font-size: 1.1rem;
}

.chat-header .close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
}

.chat-header .close-btn:hover {
    transform: rotate(90deg);
    transition: transform 0.3s ease;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    line-height: 1.4;
    font-size: 0.95rem;
    animation: messageAppear 0.3s ease;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    background-color: #4CAF50;  /* Green for sent messages */
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-message.support {
    background-color: #2196F3;  /* Blue for received messages */
    color: white;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-input {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
}

.chat-input input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 0.95rem;
}

.chat-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.chat-input button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    width: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.chat-input button:hover {
    background-color: var(--primary-color-dark);
}

/* Dark mode adjustments */
[data-theme="dark"] .chat-area {
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .chat-message.user {
    background-color: #43a047;  /* Slightly darker green for dark mode */
}

[data-theme="dark"] .chat-message.support {
    background-color: #1976D2;  /* Slightly darker blue for dark mode */
}

[data-theme="dark"] .chat-input input {
    background-color: var(--dark-card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .chat-area {
        width: calc(100% - 2rem);
        height: calc(100vh - 8rem);
        right: 1rem;
        bottom: 5rem;
    }
}

