/* Chatbot Styles */
:root {
    --chat-bg: #0f172a;
    --chat-header-bg: #1e293b;
    --chat-accent: #fbbf24;
    /* Gold */
    --chat-text: #f8fafc;
    --chat-user-msg: #3b82f6;
    /* Blue */
    --chat-bot-msg: #334155;
}

/* Floating Action Button (FAB) */
.chat-fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.chat-fab {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--chat-accent), #d97706);
    border-radius: 50%;
    box-shadow:
        0 4px 0 #b45309,
        /* 3D bottom edge */
        0 10px 20px rgba(0, 0, 0, 0.4),
        /* Drop shadow */
        inset 0 2px 5px rgba(255, 255, 255, 0.5);
    /* Inner highlight */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: float-fab 3s infinite ease-in-out;
    border: 3px solid rgba(255, 255, 255, 0.3);
    position: relative;
}

.chat-fab:active {
    transform: translateY(4px);
    box-shadow:
        0 0 0 #b45309,
        inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.chat-fab:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow:
        0 6px 0 #b45309,
        0 15px 30px rgba(251, 191, 36, 0.5),
        inset 0 2px 5px rgba(255, 255, 255, 0.5);
}

.chat-fab i {
    font-size: 32px;
    color: #1a1a1a;
}

.chat-fab-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Tooltip/Label */
.chat-label {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
    /* Re-enabled margin */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateX(20px) scale(0.8);
    transition: all 0.4s ease;
    pointer-events: none;
    position: absolute;
    /* Absolute positioning */
    bottom: 70px;
    /* Position above button */
    right: 0;
    white-space: nowrap;
}

.chat-fab-container:hover .chat-label {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: var(--chat-bg);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 99998;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-window.active {
    transform: scale(1);
    opacity: 1;
}

/* Header */
.chat-header {
    background: var(--chat-header-bg);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--chat-accent);
}

.bot-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.bot-info h3 {
    color: var(--chat-text);
    font-size: 1.1rem;
    margin: 0;
    font-weight: 600;
}

.bot-info span {
    color: var(--chat-accent);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bot-info span::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    display: block;
}

.close-chat {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-chat:hover {
    color: white;
}

/* Body */
.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(15, 23, 42, 0.95);
}

/* Messages */
.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    animation: msg-slide-in 0.3s ease-out forwards;
}

.message.bot {
    align-self: flex-start;
    background: var(--chat-bot-msg);
    color: #e2e8f0;
    border-bottom-left-radius: 2px;
}

.message.user {
    align-self: flex-end;
    background: var(--chat-user-msg);
    color: white;
    border-bottom-right-radius: 2px;
}

/* Input Area */
.chat-input-area {
    padding: 15px;
    background: var(--chat-header-bg);
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 10px 15px;
    color: white;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--chat-accent);
}

.send-btn {
    width: 40px;
    height: 40px;
    background: var(--chat-accent);
    border: none;
    border-radius: 50%;
    color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.send-btn:hover {
    transform: scale(1.1);
}

/* Animations */
@keyframes float-fab {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes msg-slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar */
.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.chat-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}

/* -------------------------------------------
   Mascot Image Animation
   ------------------------------------------- */
.mascot-animation {
    animation: mascot-float 3s ease-in-out infinite, mascot-breathe 4s ease-in-out infinite alternate;
    transform-origin: bottom center;
}

@keyframes mascot-float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-3px) rotate(2deg);
    }
}

@keyframes mascot-breathe {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.03);
    }
}


/* -------------------------------------------
   Animated Robot Face
   ------------------------------------------- */
.robot-face {
    width: 100%;
    height: 100%;
    background: #0f172a;
    /* Dark face */
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Eyes */
.robot-eye {
    width: 8px;
    height: 8px;
    background: #00e5ff;
    /* Cyan glowing eyes */
    border-radius: 50%;
    position: absolute;
    top: 35%;
    box-shadow: 0 0 5px #00e5ff, 0 0 10px #00e5ff;
    animation: blink 4s infinite ease-in-out;
}

.robot-eye.left {
    left: 25%;
}

.robot-eye.right {
    right: 25%;
}

/* Mouth */
.robot-mouth {
    width: 16px;
    height: 8px;
    border-bottom: 2px solid #00e5ff;
    border-radius: 0 0 16px 16px;
    /* Smile */
    position: absolute;
    bottom: 25%;
    transition: all 0.3s ease;
    animation: smile-talk 4s infinite ease-in-out;
    box-shadow: 0 2px 5px rgba(0, 229, 255, 0.3);
}

/* Blinking Animation */
@keyframes blink {

    0%,
    45%,
    55%,
    100% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(0.1);
    }
}

/* Smiling / Talking Animation Subtle */
@keyframes smile-talk {

    0%,
    100% {
        height: 8px;
        border-radius: 0 0 16px 16px;
        /* Normal Smile */
        width: 16px;
    }

    50% {
        height: 4px;
        /* Slightly closed */
        border-radius: 0 0 20px 20px;
        /* Big Grin */
        width: 18px;
    }
}