/*
========================================
        NEW CHATBOT STYLES
========================================
*/
.chat-toggle {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: var(--text-color-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--shadow);
    border: none;
    z-index: 998;
    transition: all 0.3s ease;
}

body.light .chat-toggle {
    color: #fff;
    box-shadow: var(--shadow);
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--shadow);
}

.chat-toggle .fa-xmark {
    display: none;
}

.chat-toggle.active .fa-comment-dots {
    display: none;
}

.chat-toggle.active .fa-xmark {
    display: block;
}

.chat-widget {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 370px;
    height: 500px;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 997;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

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

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.chat-header h3 {
    color: var(--accent);
    margin: 0;
    font-size: 1.1rem;
}

body.light .chat-header h3 {
    color: var(--secondary);
}

.chat-close-btn {
    background: transparent;
    border: none;
    color: var(--text-color-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

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

/* Scrollbar styles */
.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.chat-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.chat-message {
    max-width: 85%;
}

.chat-message p {
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    line-height: 1.5;
    font-size: 0.9rem;
    word-wrap: break-word;
}

.chat-message.bot p {
    background: var(--inner-card-bg);
    color: var(--text-color);
    border-top-left-radius: 0;
}

body.light .chat-message.bot p {
    background: #eee;
    color: var(--text-color-dark);
}

.chat-message.user {
    align-self: flex-end;
}

.chat-message.user p {
    background: var(--primary);
    color: var(--text-color-dark);
    border-top-right-radius: 0;
}

body.light .chat-message.user p {
    color: #fff;
}

.chat-message.typing p {
    color: var(--text-color-muted);
    font-style: italic;
    background: transparent;
    padding-left: 0;
}

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

.chat-footer input {
    flex-grow: 1;
    padding: 0.7rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--inner-card-bg);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.9rem;
}

body.light .chat-footer input {
    background: #fff;
    border-color: #ccc;
    color: var(--text-color-dark);
}

.chat-footer input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

body.light .chat-footer input:focus {
    box-shadow: 0 0 8px var(--primary);
}

.chat-footer button {
    background: var(--primary);
    color: var(--text-color-dark);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.light .chat-footer button {
    color: #fff;
}

.chat-footer button:hover {
    background: var(--secondary);
    transform: scale(1.1);
}

/* MOBILE RESPONSIVE STYLES */
@media (max-width: 900px) {
    .chat-widget {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        border: none;
        transform: translateY(100%);
    }
    .chat-widget.active {
        transform: translateY(0);
    }

    .chat-toggle {
        opacity: 1; transition: opacity 0.3s, transform 0.3s;
    }

    .chat-toggle.active {
        opacity: 0;
        transform: scale(0.5);
        pointer-events: none;
    }
}