/* Chatbot Styles */
:root {
    --chat-primary: #1a2a44;
    /* Dark blue from brand */
    --chat-secondary: #004a8c;
    --chat-bg: rgba(255, 255, 255, 0.85);
    --chat-text: #333;
    --chat-glass: blur(10px);
    --chat-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Chatbot Invitation & Tooltip */
@keyframes inviteWiggle {

    0%,
    100% {
        transform: scale(1);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: scale(1.1) rotate(-5deg);
    }

    20%,
    40%,
    60%,
    80% {
        transform: scale(1.1) rotate(5deg);
    }
}

.invite-wiggle {
    animation: inviteWiggle 1.5s ease-in-out;
}

.chatbot-tooltip {
    position: fixed;
    bottom: 95px;
    right: 30px;
    background: var(--white);
    color: var(--text-color);
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 10001;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.chatbot-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.chatbot-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 25px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--white);
}


/* Floating Button */
.chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--chat-primary);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-button:hover {
    transform: scale(1.1);
    background: var(--chat-secondary);
}

.chatbot-button i {
    transition: transform 0.3s ease;
}

.chatbot-button.active i {
    transform: rotate(90deg);
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: var(--chat-bg);
    backdrop-filter: var(--chat-glass);
    -webkit-backdrop-filter: var(--chat-glass);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: var(--chat-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.chat-window.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, var(--chat-primary), var(--chat-secondary));
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.chat-avatar {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--chat-primary);
    font-size: 22px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transform: rotate(-5deg);
}


.chat-header-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-header-info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    animation: messageIn 0.3s ease forwards;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    align-self: flex-start;
    background: white;
    color: var(--chat-text);
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.user-message {
    align-self: flex-end;
    background: var(--chat-primary);
    color: white;
    border-bottom-right-radius: 2px;
}

.success-card {
    text-align: center;
    padding: 10px;
    background: rgba(46, 204, 113, 0.1);
    border-radius: 8px;
    border: 1px solid #2ecc71;
    margin-bottom: 10px;
    color: var(--chat-text);
}

.success-card i {
    font-size: 24px;
    color: #2ecc71;
    margin-bottom: 8px;
    display: block;
}

.success-card p {
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: #27ae60;
}

.success-card span {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    width: fit-content;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: #bbb;
    border-radius: 50%;
    display: inline-block;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}

/* Quick Replies */
.quick-replies {
    padding: 10px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.quick-reply-btn {
    background: rgba(26, 42, 68, 0.05);
    border: 1px solid rgba(26, 42, 68, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--chat-primary);
}

.quick-reply-btn:hover {
    background: var(--chat-primary);
    color: white;
}

/* Input Area */
.chat-input-area {
    padding: 15px 20px;
    background: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 8px 0;
}

.send-btn {
    background: none;
    border: none;
    color: var(--chat-primary);
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.2s ease;
}

.send-btn:hover {
    transform: scale(1.1);
}

/* Link Style in Chat */
.chat-link {
    color: var(--chat-primary);
    font-weight: 600;
    text-decoration: underline;
}

/* Tablet Adjustments */
@media (max-width: 1024px) {
    .chat-window {
        width: 320px;
        height: 500px;
    }
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 70px;
        right: 0;
    }

    .chatbot-widget {
        bottom: 20px;
        right: 20px;
    }

    .chat-header {
        padding: 15px;
    }
}