/* ========================================
   CHATBOT WIDGET STYLES - Premium Dark Glass
   ======================================== */

/* Import Main Font if not already available */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap');

/* Chat Widget Container */
.chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 9999;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Floating Chat Button */
/* Floating Chat Button */
.chat-widget-button {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    z-index: 9999;
    padding: 0;
}

.chat-widget-button:hover {
    transform: translateY(-8px) scale(1.08);
}

/* ===================================
   PREMIUM AI ROBOT WIDGET
   =================================== */

.ai-robot-widget {
    width: 100px;
    height: 110px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

/* Container for Head + Body to Float Together */
.robot-inner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: premiumFloat 4s ease-in-out infinite;
    transform-origin: center center;
}

@keyframes premiumFloat {

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

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

/* Aura/Glow Behind */
.robot-aura {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85px;
    height: 85px;
    background: radial-gradient(circle, rgba(68, 214, 44, 0.35) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    animation: auraPulse 3s infinite;
}

@keyframes auraPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: 0.2;
    }
}

/* Robot Head Container */
.robot-head {
    width: 60px;
    height: 48px;
    background: #ffffff;
    border-radius: 18px;
    position: relative;
    z-index: 3;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 -3px 5px rgba(0, 0, 0, 0.1),
        inset 0 3px 5px rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-widget-button:hover .robot-head {
    transform: scale(1.05) translateY(-2px);
}

/* Dark Glass Visor */
.robot-face-visor {
    width: 48px;
    height: 36px;
    background: #0a0a0a;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Reflection on Visor */
.robot-face-visor::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

/* Neon Eyes */
.robot-eye {
    width: 10px;
    height: 14px;
    background: #44D62C;
    border-radius: 6px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 10px rgba(68, 214, 44, 0.8);
    animation: roboBlink 4.5s infinite;
}

.robot-eye.left {
    left: 9px;
}

.robot-eye.right {
    right: 9px;
}

@keyframes roboBlink {

    0%,
    48%,
    52%,
    100% {
        height: 14px;
        transform: translateY(-50%);
    }

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

/* Mouth / Speaking Indicator */
.robot-mouth-indicator {
    position: absolute;
    bottom: 6px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.3s;
}

.chat-widget-button:hover .robot-mouth-indicator {
    opacity: 1;
}

.robot-mouth-indicator span {
    width: 2px;
    height: 2px;
    background: #44D62C;
    border-radius: 2px;
    animation: voiceWave 1s ease-in-out infinite;
}

.robot-mouth-indicator span:nth-child(2) {
    animation-delay: 0.1s;
    height: 4px;
}

.robot-mouth-indicator span:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes voiceWave {

    0%,
    100% {
        height: 2px;
        opacity: 0.5;
    }

    50% {
        height: 6px;
        opacity: 1;
    }
}

/* Robot Ears / Headphones */
.robot-ear {
    width: 7px;
    height: 22px;
    background: #d0d0d0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 2px;
    box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
}

.robot-ear.left {
    left: -5px;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.robot-ear.right {
    right: -5px;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

/* New: Robot Neck */
/* New: Robot Neck */
.robot-neck {
    width: 20px;
    height: 8px;
    background: #333;
    margin-top: -2px;
    margin-bottom: -3px;
    position: relative;
    z-index: 2;
    background: linear-gradient(90deg, #1a1a1a, #444, #1a1a1a);
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.8);
}

/* New: Robot Body (Chest + Shoulders) */
.robot-body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.robot-chest {
    width: 52px;
    height: 34px;
    background: #ffffff;
    border-radius: 0 0 18px 18px;
    position: relative;
    display: flex;
    justify-content: center;
    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.2),
        inset 0 -3px 5px rgba(0, 0, 0, 0.1);
}

/* Shoulders */
.robot-shoulder {
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    position: absolute;
    top: 0px;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.robot-shoulder.left {
    left: -10px;
}

.robot-shoulder.right {
    right: -10px;
}

/* Glowing Core in Chest */
.chest-glowing-core {
    width: 16px;
    height: 16px;
    background: #1a1a1a;
    border-radius: 50%;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 5px rgba(68, 214, 44, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chest-glowing-core::after {
    content: '';
    width: 8px;
    height: 8px;
    background: #44D62C;
    border-radius: 50%;
    box-shadow: 0 0 10px #44D62C;
    animation: coreHeartbeat 2s infinite;
}

@keyframes coreHeartbeat {
    0% {
        transform: scale(0.9);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
        box-shadow: 0 0 12px #44D62C;
    }

    100% {
        transform: scale(0.9);
        opacity: 0.8;
    }
}

/* Notification Badge */
.chat-notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #44D62C;
    color: #000;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    border: 2px solid #000;
    box-shadow: 0 0 10px rgba(68, 214, 44, 0.6);
    animation: pulse-notification 2s infinite;
}

@keyframes pulse-notification {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(68, 214, 44, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(68, 214, 44, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(68, 214, 44, 0);
    }
}

/* Chat Widget Window */
.chat-widget-window {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 650px;
    max-height: calc(100vh - 140px);
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: none;
}

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

/* Header */
.chat-widget-header {
    padding: 24px;
    background: linear-gradient(180deg, rgba(30, 30, 30, 0.8) 0%, rgba(20, 20, 20, 0.4) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.chat-avatar {
    width: 48px;
    height: 48px;
    position: relative;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #44D62C20 0%, #44D62C80 100%);
}

.chat-avatar-placeholder {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #44D62C;
    font-weight: 700;
    font-size: 20px;
    position: relative;
    z-index: 1;
}

.chat-status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background: #44D62C;
    border: 2px solid #000;
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 10px #44D62C;
}

.chat-header-title h3 {
    margin: 0;
    font-size: 18px;
    color: #fff;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.chat-header-title p {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-header-title p::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: #44D62C;
    border-radius: 50%;
    box-shadow: 0 0 8px #44D62C;
}

.chat-minimize-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.chat-minimize-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.chat-minimize-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Messages Area */
.chat-widget-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(68, 214, 44, 0.3) transparent;
}

/* Scrollbar styling */
.chat-widget-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-widget-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-widget-messages::-webkit-scrollbar-thumb {
    background: rgba(68, 214, 44, 0.3);
    border-radius: 4px;
}

/* Message Bubbles */
.chat-message {
    display: flex;
    gap: 12px;
    animation: messageSlideIn 0.3s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

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

.chat-message.bot {
    align-items: flex-end;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.chat-message.user .chat-message-avatar {
    background: #44D62C;
    color: #000;
    font-weight: 700;
    border: none;
}

.chat-message-content {
    max-width: 75%;
}

.chat-message-bubble {
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}

.chat-message.bot .chat-message-bubble {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 4px;
}

.chat-message.user .chat-message-bubble {
    background: linear-gradient(135deg, #44D62C 0%, #35a822 100%);
    color: #000;
    font-weight: 500;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(68, 214, 44, 0.2);
}

.chat-message-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 6px;
    text-align: right;
}

.chat-welcome-message {
    background: rgba(68, 214, 44, 0.1);
    border: 1px solid rgba(68, 214, 44, 0.2);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.chat-welcome-content p {
    margin: 0;
    color: #fff;
    font-size: 14px;
    line-height: 1.6;
}

.chat-welcome-time {
    margin-top: 8px;
    font-size: 11px;
    color: #44D62C;
    opacity: 0.8;
}

/* Typing Indicator */
.chat-typing-indicator {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border-bottom-left-radius: 4px;
    display: flex;
    gap: 6px;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #44D62C;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

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

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

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* Input Area */
.chat-widget-input {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-input-wrapper {
    flex: 1;
    position: relative;
}

.chat-input-field {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 14px 45px 14px 20px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input-field::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.chat-input-field:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(68, 214, 44, 0.5);
    box-shadow: 0 0 15px rgba(68, 214, 44, 0.1);
}

.chat-attach-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.chat-attach-btn:hover {
    opacity: 1;
}

.chat-attach-btn svg {
    stroke: #fff;
    width: 20px;
    height: 20px;
}

.chat-send-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #44D62C;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 10px rgba(68, 214, 44, 0.2);
}

.chat-send-btn svg {
    width: 20px;
    height: 20px;
    fill: #000;
    transform: translateX(2px);
    transition: transform 0.2s;
}

.chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(68, 214, 44, 0.4);
}

.chat-send-btn:hover svg {
    transform: translateX(4px);
}

/* Powered By */
.chat-powered-by {
    text-align: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.2);
    padding: 8px 0 12px;
    background: rgba(0, 0, 0, 0.2);
}

.chat-powered-by a {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: color 0.2s;
}

.chat-powered-by a:hover {
    color: #44D62C;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .chat-widget-window {
        width: calc(100vw - 32px);
        right: 16px;
        bottom: 100px;
        height: 60vh;
    }

    /* Resize Chatbot Button */
    .chat-widget-button {
        width: 70px;
        height: 70px;
    }

    .ai-robot-widget {
        transform: scale(0.65);
        margin-top: 5px;
    }

    .robot-aura {
        width: 60px;
        height: 60px;
    }
}