/* 🔲 Chat container */
#ranger-bot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 400px;
    height: 700px;
    max-height: fit-content;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    font-family: 'Segoe UI', sans-serif;
    z-index: 9999;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#ranger-bot.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

/* 👣 Floating avatar button */
#ranger-avatar {
    position: fixed;
    bottom: 140px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #aee3b0;
    color: #fff;
    font-size: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: float 3s ease-in-out infinite;
    transition: transform 0.2s ease;
}

#ranger-avatar:hover {
    transform: scale(1.08);
}

/* 🗨️ Tooltip */
#ranger-avatar::after {
    content: "Need help?";
    position: absolute;
    bottom: 70px;
    right: 0;
    background: #ffffff;
    color: #333;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#ranger-avatar:hover::after {
    opacity: 1;
    transform: translateY(0px);
}

/* 🧢 Header */
#ranger-header {
    background-color: #2e7d32;
    color: white;
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

#ranger-close {
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
}

/* 💬 Chat body */
#ranger-chatbox {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 12px;
    overflow-y: auto;
    background: #fefefe;
}

/* 📩 Messages */
#ranger-messages {
    flex-grow: 1;
    overflow-y: auto;
    max-height: fit-content;
    margin-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

/* ✨ Chat bubbles */
.chat-bubble {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 0.95rem;
    white-space: pre-wrap;
    max-width: 90%;
    word-wrap: break-word;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.chat-bubble.user {
    background-color: #e0e0e0;
    align-self: flex-end;
    border-left: 4px solid #757575;
}

.chat-bubble.bot {
    background-color: #e8f5e9;
    border-left: 4px solid #2e7d32;
    align-self: flex-start;
}

/* 🧾 Input area */
#ranger-input-area {
    display: flex;
    padding: 10px;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
}

#ranger-input {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 0.9rem;
}

#ranger-input-area button {
    padding: 0 16px;
    margin-left: 6px;
    background-color: #2e7d32;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* 🔗 Linkified parks */
.ranger-link {
    color: #1565c0;
    font-weight: bold;
    text-decoration: underline;
}

#ranger-summary-box {
    margin-top: 30px;
    background: #f1f8e9;
    border-left: 6px solid #2e7d32;
    padding: 16px 20px;
    border-radius: 12px;
    font-family: 'Segoe UI', sans-serif;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#ranger-avatar-static {
    font-size: 1.1rem;
    font-weight: bold;
    color: #2e7d32;
    margin-bottom: 10px;
}

#ranger-summary-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
}

/* ✨ Animations */
@keyframes float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }

    100% {
        transform: translateY(0);
    }
}