/* chatboat.css - FIXED version (chat window opens properly) */

/* Root variables */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --radius: 16px;
    --shadow: 0 10px 25px rgba(99, 102, 241, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Floating chat toggle button (visible when chat is closed) */
.chat-toggle {
    position: fixed;
    bottom: 4px;
    right: 4px;
    width: 20%;
    /*width: 66px;
    height: 66px;
    */
    background: var(--primary);
    color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 10000;
    /*Highprioritysoit'salwaysontop*/
    transition: all 0.3s ease;
    border: none;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    -ms-border-radius: 8px;
    -o-border-radius: 8px;
    padding: .2rem .5rem;
}

.chat-toggle:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

/* Chat window – hidden by default */
.chat-window {
    position: fixed;
    bottom: 2px;
    /* Above the toggle button */
    right: 2px;
    width: 380px;
    height: 520px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 9999;
    display: none;
    /* Hidden until .open is added */
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#icon {
    font-size: 1.5rem;
}

/* When chat is open */
.chat-window.open {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Chat header */
.chat-header {
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    color: white;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    opacity: 0.8;
}

/* Messages area */
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 12px;
    line-height: 1.4;
    font-size: 0.96rem;
}

.user-message {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message {
    align-self: flex-start;
    background: #e2e8f0;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}

/* Input area */
.input-area {
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    background: white;
}

#message-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    -ms-border-radius: 8px;
    -o-border-radius: 8px;
}

#message-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

#send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#send-btn:hover {
    background: var(--primary-dark);
}

/* Typing indicator */
#typing-indicator {
    padding: 12px 16px;
    color: #64748b;
    font-style: italic;
    font-size: 0.9rem;
}

/* Responsive - Mobile & Tablet */
@media (max-width: 800px) {
    .chat-toggle {
        bottom: 4px;
        right: 4px;
        /* width: 60px;
        height: 60px; */
        font-size: 1.1rem;
        width: 40%;
         min-width: 200px;
         padding: .5rem;

    }

    .chat-window {
        width: 60%;
        height: 70vh;
        bottom: 4px;

        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .chat-toggle {

        width: 65%;
        min-width: 200px;
        font-size: 1.1rem;
    }

    .chat-window {
        width: 85%;
        height: 75vh;
       
    }
}