
:root {
    --accent: #ac8440;
    --accent-2: #760d17;
    --bg: #f4f7fb;
    --glass: rgba(255,255,255,0.55);
    --muted: #6b7280;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(11,22,45,0.12);
    --glass-shadow: 0 6px 20px rgba(8,18,40,0.06);
}

/* Reset */
* {
    box-sizing: border-box
}

#chatbot-icon {
    z-index: 1000;
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: linear-gradient(135deg, #ac8440, #760d17);
    color: white;
    font-size: 26px;
    border-radius: 50%;
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulseRing 2s infinite;
}

    /* Hover effect */
    #chatbot-icon:hover {
        transform: scale(1.12);
        box-shadow: 0 8px 24px rgba(172, 132, 64, 0.5);
    }

/* Tooltip */
#chatbot-tooltip {
    position: fixed;
    bottom: 88px;
    right: 24px;
    background: linear-gradient(90deg,var(--accent),var(--accent-2));
    color: #fff;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

/* Show tooltip on hover */
#chatbot-icon:hover + #chatbot-tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* Gentle floating ring animation */
@keyframes floatRing {
    0% {
        transform: scale(.95);
        opacity: .85
    }

    50% {
        transform: scale(1.05);
        opacity: .95
    }

    100% {
        transform: scale(.95);
        opacity: .85
    }
}

/* Chat Window - glassmorphism, animated open/close */
#chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 26px;
    width: 30%;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    border-radius: calc(var(--radius) + 6px);
    background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(248,250,255,0.9));
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    box-shadow: var(--shadow);
    overflow: hidden;
    transform-origin: bottom right;
    opacity: 0;
    transform: translateY(18px) scale(.98);
    pointer-events: none;
    transition: transform 320ms cubic-bezier(.2,.9,.2,1), opacity 260ms;
    z-index: 1000;
}

    /* When open */
    #chatbot-container.open {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

/* Header */
#chatbot-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(90deg,var(--accent),var(--accent-2));
    color: white;
    font-weight: 600;
    font-size: 15px;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(2,42,84,0.12);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: linear-gradient(135deg,#ffffff22,#ffffff11);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 18px;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: inset 0 -6px 10px rgba(255,255,255,0.03);
}

    .logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        border-radius: 9px;
    }

#chatbot-close {
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    opacity: 0.92;
    padding: 6px;
    border-radius: 8px;
    transition: background 160ms;
}

    #chatbot-close:hover {
        background: rgba(255,255,255,0.08);
    }

#chatbot-subtitle {
    font-size: 12px;
    opacity: .9;
    color: rgba(255,255,255,0.95);
    font-weight: 500
}

/* Messages Area */
#chatbot-messages {
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(180deg, rgba(250,252,255,0.6), transparent);
}

/* Message Bubbles */
.message {
    max-width: 78%;
    padding: 12px 14px;
    border-radius: 14px;
    position: relative;
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    transform: translateY(10px) scale(.98);
    opacity: 0;
    animation: msgIn 360ms forwards;
    box-shadow: 0 6px 18px rgba(8,18,40,0.04);
    line-height: 1.35;
}

@keyframes msgIn {
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Bot */
.message.bot {
    background: linear-gradient(90deg,#ffffff,#f0f6ff);
    color: #07204c;
    border: 1px solid rgba(11,32,84,0.04);
    align-self: flex-start;
    border-bottom-left-radius: 6px;
}

    .message.bot.welcome .text {
        /* font-style: italic; */
        opacity: 0.85;
    }

    .message.bot.welcome .avatar {
        display: none;
    }

/* User */
.message.user {
    background: linear-gradient(90deg,var(--accent),var(--accent-2));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
    box-shadow: 0 6px 20px rgba(44,110,200,0.12);
}

/* Avatars */
.message .meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 16px;
    background: rgba(255,255,255,0.6);
    color: #07305a;
    border: 1px solid rgba(0,0,0,0.04);
}



/* message text and time */
.message .text {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
}

.message-time {
    font-size: 11px;
    opacity: .6;
    align-self: flex-end;
    margin-top: 2px;
}

/* Typing indicator */
.typing {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(3,52,102,0.04);
    color: #07204c;
    width: auto;
}

    .typing .dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--accent);
        opacity: .9;
        animation: blink 1s infinite;
    }

        .typing .dot:nth-child(2) {
            animation-delay: 160ms
        }

        .typing .dot:nth-child(3) {
            animation-delay: 320ms
        }

@keyframes blink {
    0% {
        transform: translateY(0);
        opacity: .35
    }

    50% {
        transform: translateY(-6px);
        opacity: 1
    }

    100% {
        transform: translateY(0);
        opacity: .35
    }
}

/* Input area */
#chatbot-input {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(11,20,40,0.04);
    align-items: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(250,252,255,0.9));
}

.input-field {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    background: rgba(11,20,40,0.02);
    border-radius: 12px;
    padding: 8px 10px;
}

#chatbot-input input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
    color: #0b1220;
}

#chatbot-input button.send {
    border: none;
    background: linear-gradient(90deg,var(--accent),var(--accent-2));
    color: white;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(46,108,200,0.12);
    transition: transform 140ms, box-shadow 140ms;
}

    #chatbot-input button.send:active {
        transform: translateY(1px)
    }

a.send {
    border: none;
    background: linear-gradient(90deg,var(--accent),var(--accent-2));
    color: white;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(46,108,200,0.12);
    transition: transform 140ms, box-shadow 140ms;
}

    a.send:active {
        transform: translateY(1px)
    }

#chatbot-input .hint {
    font-size: 12px;
    color: var(--muted);
    padding-left: 6px;
}

/* Control buttons (close, expand, minimize) */
.chatbot-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

    .chatbot-controls div {
        cursor: pointer;
        font-size: 16px;
        font-weight: 600;
        opacity: 0.9;
        padding: 6px 8px;
        border-radius: 8px;
        transition: background 160ms, transform 160ms;
    }

        .chatbot-controls div:hover {
            background: rgba(255,255,255,0.12);
            transform: scale(1.1);
        }

/* Fullscreen mode layout */
#chatbot-container.fullscreen {
    width: 100vw;
    height: 100vh;
    max-height: none;
    bottom: 0;
    right: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.4s ease;
}

#startChatBtn {
    display: inline-block;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    border: none;
    box-shadow: 0 6px 18px rgba(44,110,200,0.12);
    transition: transform 140ms, box-shadow 140ms;
    padding: 4px 10px !important;
    font-size: 12px;
    width: auto !important;
}

/* Messages area in fullscreen */
#chatbot-container.fullscreen #chatbot-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Center messages vertically */
    align-items: center; /* Center messages horizontally */
    padding: 20px;
    margin: 0 auto;
}

#chatbot-container.fullscreen #user-info-form {
    flex: 0 0 auto;
    width: 100%;
    max-width: 600px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 20px;
    margin: 0 auto;
}
/* Input area stretched in fullscreen */
#chatbot-container.fullscreen #chatbot-input {
    width: 100%;
    padding: 12px 20px;
    border-top: 1px solid rgba(11,20,40,0.08);
}

#chatbot-container.fullscreen #chatbot-header {
    width: 100%;
}
/* small screens */
@media (max-width:420px) {
    #chatbot-container {
        right: 12px;
        left: 12px;
        width: auto;
        bottom: 86px;
    }

    #chatbot-messages {
        padding: 10px
    }
}
