:root {
    --primary-color: #00a651;
    --primary-light: #e6f6ed;
    --bg-blur: rgba(255, 255, 255, 0.85);
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-radius: 20px;
    --shadow-premium: 0 12px 40px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f0f2f5;
    height: 100vh;
    overflow: hidden;
}

/* Launcher Button */
.chat-launcher {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 166, 81, 0.4);
    z-index: 1001;
    transition: var(--transition);
}

.chat-launcher:hover {
    transform: scale(1.1) rotate(5deg);
}

.chat-launcher .pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary-color);
    opacity: 0.6;
    z-index: -1;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.85);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Main Container */
.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background: var(--bg-blur);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    transition: var(--transition);
    transform-origin: bottom right;
}

.chatbot-container.hidden {
    opacity: 0;
    transform: scale(0.8) translateY(40px);
    pointer-events: none;
}

/* Header Overhaul */
.chat-header {
    background: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-avatar {
    position: relative;
    width: 40px;
    height: 40px;
}

.agent-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #4caf50;
    border: 2px solid white;
    border-radius: 50%;
}

.agent-details h3 {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

.agent-details p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    gap: 14px;
    align-items: center;
}

.header-icon {
    font-size: 1rem;
    color: #999;
    cursor: pointer;
    padding: 5px;
    transition: var(--transition);
}

.header-icon:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

/* Chat Window */
.chat-window {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: none;
}

.chat-window::-webkit-scrollbar {
    display: none;
}

.welcome-message {
    background: white;
    padding: 16px;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.action-chip {
    background: white;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.action-chip:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 166, 81, 0.2);
}

/* Messages */
.user-msg {
    align-self: flex-end;
    max-width: 80%;
    padding: 12px 16px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px 20px 4px 20px;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0, 166, 81, 0.2);
}

.ai-msg,
.ai-msg *,
.ai-msg p,
.ai-msg li,
.ai-msg div,
.ai-msg span {
    color: #000000 !important;
    font-weight: bold !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
}

.ai-msg strong {
    color: #000000 !important;
}

/* — Styled AI list — */
.ai-msg .ai-list {
    list-style: none;
    margin: 10px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-msg .ai-list li {
    background: #f7faf8 !important;
    border-left: 4px solid var(--primary-color) !important;
    border-radius: 0 12px 12px 0 !important;
    padding: 12px 15px !important;
}

.ai-msg a {
    color: var(--primary-color) !important;
    text-decoration: underline !important;
    word-break: break-all;
}

.contact-item {
    background: #f1f8f4 !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    margin: 6px 0 !important;
    border-left: 4px solid var(--primary-color) !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
}

.contact-item strong {
    color: var(--primary-color) !important;
    min-width: 80px;
}

/* Typing Indicator */
.typing-indicator {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    gap: 4px;
    width: fit-content;
    margin-left: 20px;
    margin-bottom: 10px;
    border-radius: 15px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typing-dots 1s infinite alternate;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-dots {
    from {
        opacity: 0.3;
        transform: translateY(0);
    }

    to {
        opacity: 1;
        transform: translateY(-4px);
    }
}

.typing-indicator.hidden {
    display: none;
}

/* Footer & Input Styling */
.chat-footer {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.input-container {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 25px;
    padding: 6px 15px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.input-container:focus-within {
    background: white;
    border-color: #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#userInput {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 5px;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-family: inherit;
}

#userInput:focus {
    outline: none;
}

#userInput::placeholder {
    color: #999;
}

.action-icons {
    display: flex;
    gap: 8px;
    margin-left: 10px;
}

.icon-btn {
    border: none;
    background: transparent;
    color: #5f6368;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.icon-btn:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Emoji Picker Styling */
.emoji-picker {
    position: absolute;
    bottom: 70px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 10px;
    gap: 8px;
    z-index: 1000;
    width: 200px;
    border: 1px solid #eee;
    transition: var(--transition);
}

.emoji-picker.hidden {
    display: none;
    opacity: 0;
    transform: translateY(10px);
}

.emoji-item {
    font-size: 1.5rem;
    cursor: pointer;
    text-align: center;
    padding: 5px;
    border-radius: 8px;
    transition: var(--transition);
}

.emoji-item:hover {
    background: #f0f0f0;
    transform: scale(1.2);
}

/* Follow-up Quick Chips (after each AI reply) */
.follow-up-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

/* Booking form Modal */
.booking-modal {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    transition: var(--transition);
}

.booking-modal.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

.booking-modal-content {
    background: white;
    width: 90%;
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--shadow-premium);
    border: 1px solid #eee;
}

.booking-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.booking-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.booking-form input {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.booking-form input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 166, 81, 0.1);
}

.btn-submit-booking {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 5px;
}

.btn-submit-booking:hover {
    background: #008a43;
    transform: translateY(-2px);
}

/* Interactive Booking Management Cards */
.booking-card {
    background: #f8fbfa;
    border: 1px solid #e0e5e3;
    border-radius: 12px;
    padding: 15px;
    margin: 10px 0;
    font-size: 0.95em;
    color: var(--text-color);
}

.booking-card p {
    margin: 5px 0;
}

.booking-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-cancel,
.btn-reschedule {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cancel {
    background: #ffebee;
    color: #d32f2f;
}

.btn-cancel:hover {
    background: #ffcdd2;
}

.btn-reschedule {
    background: #e3f2fd;
    color: #1976d2;
}

.btn-reschedule:hover {
    background: #bbdefb;
}