/* Chatbot Premium Styling */
:root {
    --chat-primary: #0078D4;
    --chat-bg: #111827;
    --chat-text: #f3f4f6;
    --chat-secondary-bg: #1f2937;
    --chat-accent: #50E6FF;
    --chat-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    font-family: 'Inter', sans-serif;
}

.chatbot-toggle {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chat-primary), var(--chat-accent));
    box-shadow: var(--chat-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    outline: none;
}

.chatbot-toggle:hover {
    transform: scale(1.1) rotate(5deg);
}

.chatbot-toggle svg {
    width: 32px;
    height: 32px;
    fill: white;
}

.chatbot-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 400px;
    max-width: calc(100vw - 60px);
    height: 600px;
    max-height: calc(100vh - 150px);
    background: var(--chat-bg);
    border-radius: 24px;
    box-shadow: var(--chat-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-window.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.chatbot-header {
    padding: 20px 24px;
    background: linear-gradient(90deg, var(--chat-primary), #005697);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.chat-refresh {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.chat-refresh:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(45deg);
}

.chat-refresh svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.chatbot-header p {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.8;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
    animation: messageIn 0.3s ease-out;
    word-wrap: break-word;
    white-space: pre-line;
}

.message ul,
.message ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message li {
    margin-bottom: 4px;
}

.message p {
    margin-bottom: 8px;
}

.message strong {
    color: var(--chat-accent);
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    align-self: flex-start;
    background: var(--chat-secondary-bg);
    color: var(--chat-text);
    border-bottom-left-radius: 4px;
}

.message.user {
    align-self: flex-end;
    background: var(--chat-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-input-area {
    padding: 16px;
    background: var(--chat-secondary-bg);
    display: flex;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chatbot-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    outline: none;
    transition: border-color 0.3s;
}

.chatbot-input:focus {
    border-color: var(--chat-accent);
}

.chatbot-send {
    background: var(--chat-primary);
    border: none;
    border-radius: 12px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
}

.chatbot-send:hover {
    background: #0084e6;
}

.chatbot-send svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Typing indicator */
.typing-indicator {
    padding: 8px 16px;
    background: var(--chat-secondary-bg);
    border-radius: 18px;
    display: flex;
    gap: 4px;
    align-self: flex-start;
    align-items: center;
    font-size: 0.8rem;
    color: #9ca3af;
}

.dot {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        bottom: 0px;
        right: -30px;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
}