/* =====================================================
   SOLARWALA AI CHATBOT
===================================================== */

.ai-chatbot {
    position: fixed;
    right: 24px;
    bottom: 85px;
    z-index: 9999;
    font-family: 'DM Sans', sans-serif;
}


/* =====================================================
   AI BUTTON
===================================================== */

.ai-chat-button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;

    border: 0;
    padding: 10px 17px 10px 10px;

    border-radius: 50px;

    background: linear-gradient(
        135deg,
        #0f8b4c,
        #19b968
    );

    color: #fff;

    box-shadow:
        0 10px 30px rgba(15, 139, 76, 0.30),
        0 0 0 0 rgba(25, 185, 104, 0.45);

    cursor: pointer;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.ai-chat-button:hover {
    transform: translateY(-3px);

    box-shadow:
        0 14px 35px rgba(15, 139, 76, 0.35);
}


/* AI Icon */

.ai-chat-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: rgba(255,255,255,0.18);

    font-size: 18px;
}


/* Label */

.ai-chat-label {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.2px;
}


/* Pulse */

.ai-pulse {
    position: absolute;

    width: 100%;
    height: 100%;

    left: 0;
    top: 0;

    border-radius: 50px;

    border: 2px solid rgba(25, 185, 104, 0.5);

    animation: aiPulse 2.2s infinite;

    pointer-events: none;
}

@keyframes aiPulse {

    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }

    70% {
        transform: scale(1.08);
        opacity: 0;
    }

    100% {
        transform: scale(1.08);
        opacity: 0;
    }
}


/* =====================================================
   CHAT WINDOW
===================================================== */

.ai-chat-window {
    position: absolute;

    right: 0;
    bottom: 65px;

    width: 370px;
    max-width: calc(100vw - 30px);

    background: #fff;

    border-radius: 22px;

    overflow: hidden;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.18);

    border: 1px solid rgba(0,0,0,0.06);

    opacity: 0;
    visibility: hidden;

    transform:
        translateY(20px)
        scale(0.96);

    transform-origin: bottom right;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        visibility 0.25s ease;
}


/* Open */

.ai-chat-window.active {
    opacity: 1;
    visibility: visible;

    transform:
        translateY(0)
        scale(1);
}


/* =====================================================
   HEADER
===================================================== */

.ai-chat-header {
    padding: 15px 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background:
        linear-gradient(
            135deg,
            #087f45,
            #16a85d
        );

    color: #fff;
}


.ai-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
}


.ai-avatar {
    width: 40px;
    height: 40px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255,255,255,0.18);

    font-size: 17px;
}


.ai-chat-title strong {
    display: block;

    font-family: 'Manrope', sans-serif;

    font-size: 14px;
}


.ai-chat-title small {
    display: flex;
    align-items: center;
    gap: 5px;

    margin-top: 2px;

    font-size: 11px;

    opacity: 0.85;
}


.ai-online-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #8cffbc;
}


.ai-close-btn {
    border: 0;
    background: transparent;

    color: #fff;

    width: 34px;
    height: 34px;

    border-radius: 50%;

    cursor: pointer;

    transition: background 0.2s ease;
}

.ai-close-btn:hover {
    background: rgba(255,255,255,0.15);
}


/* =====================================================
   MESSAGES
===================================================== */

.ai-chat-messages {
    height: 330px;

    overflow-y: auto;

    padding: 18px 15px;

    background: #f7faf8;
}


.ai-message {
    display: flex;
    gap: 8px;

    margin-bottom: 15px;
}


.ai-message-avatar {
    flex: 0 0 30px;

    width: 30px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #e2f5ea;

    color: #0c8b4c;

    font-size: 12px;
}


.ai-message-content {
    max-width: 82%;

    padding: 10px 13px;

    border-radius: 14px 14px 14px 4px;

    background: #fff;

    color: #26352e;

    font-size: 13px;
    line-height: 1.5;

    box-shadow: 0 3px 12px rgba(0,0,0,0.04);
}


/* User Message */

.ai-message.user {
    justify-content: flex-end;
}


.ai-message.user .ai-message-content {
    background: #0c8b4c;

    color: #fff;

    border-radius: 14px 14px 4px 14px;
}


/* =====================================================
   QUICK ACTIONS
===================================================== */

.ai-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;

    margin-left: 38px;
    margin-bottom: 10px;
}


.ai-quick-actions button {
    border: 1px solid #dcece3;

    background: #fff;

    color: #167847;

    border-radius: 50px;

    padding: 7px 10px;

    font-size: 11px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}


.ai-quick-actions button:hover {
    background: #eaf8f0;
    border-color: #a9dabb;
}


/* =====================================================
   TYPING
===================================================== */

.ai-typing {
    display: flex;
    align-items: center;

    gap: 4px;

    padding: 0 18px 8px;
}


.ai-typing span {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #1a9a59;

    animation: typingBounce 1.2s infinite;
}

.ai-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.ai-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-5px);
    }
}


/* =====================================================
   INPUT
===================================================== */

.ai-chat-input {
    display: flex;

    gap: 8px;

    padding: 11px;

    background: #fff;

    border-top: 1px solid #edf1ee;
}


.ai-chat-input input {
    flex: 1;

    min-width: 0;

    border: 1px solid #e0e6e2;

    border-radius: 50px;

    padding: 10px 14px;

    outline: none;

    font-size: 13px;

    transition: border-color 0.2s ease;
}


.ai-chat-input input:focus {
    border-color: #18a65c;
}


.ai-chat-input button {
    width: 42px;
    height: 42px;

    border: 0;

    border-radius: 50%;

    background: #0c8b4c;

    color: #fff;

    cursor: pointer;

    transition: transform 0.2s ease;
}


.ai-chat-input button:hover {
    transform: scale(1.05);
}


/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 576px) {

    .ai-chatbot {
        right: 15px;
        bottom: 75px;
    }

    .ai-chat-window {
        width: calc(100vw - 30px);

        right: 0;

        bottom: 60px;
    }

    .ai-chat-label {
        display: none;
    }

    .ai-chat-button {
        padding: 8px;
    }

    .ai-chat-icon {
        width: 44px;
        height: 44px;
    }
}



.ai-chat-label {
    position: relative;

    display: inline-flex;
    align-items: center;
    gap: 5px;

    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.2px;

    white-space: nowrap;

    animation:
        aiAttention 1.2s ease-out 0.8s 2,
        aiFloat 3s ease-in-out 3.5s infinite;
}


/* Sparkle */

.ai-sparkle {
    display: inline-block;

    font-size: 15px;

    animation:
        aiSparkle 1.5s ease-in-out 1s 3;
}


/* Small waving hand */

.ai-wave {
    display: inline-block;

    transform-origin: 70% 70%;

    animation:
        aiWave 1.2s ease-in-out 1.2s 2;
}


/* =========================================
   ATTENTION ANIMATION
   Happens when page first loads
========================================= */

@keyframes aiAttention {

    0% {
        opacity: 0;
        transform: translateX(35px) scale(0.85);
        filter: blur(3px);
    }

    45% {
        opacity: 1;
        transform: translateX(-5px) scale(1.08);
        filter: blur(0);
    }

    65% {
        transform: translateX(3px) scale(1);
    }

    80% {
        transform: translateX(-2px);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}


/* =========================================
   FLOATING
========================================= */

@keyframes aiFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}


/* =========================================
   SPARKLE
========================================= */

@keyframes aiSparkle {

    0% {
        transform: scale(0.7) rotate(0deg);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.35) rotate(25deg);
        opacity: 1;
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}


/* =========================================
   WAVE
========================================= */

@keyframes aiWave {

    0% {
        transform: rotate(0deg);
    }

    15% {
        transform: rotate(15deg);
    }

    30% {
        transform: rotate(-10deg);
    }

    45% {
        transform: rotate(15deg);
    }

    60% {
        transform: rotate(-5deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

.ai-chat-button {
    position: relative;

    display: flex;
    align-items: center;
    gap: 10px;

    border: 0;
    padding: 10px 17px 10px 10px;

    border-radius: 50px;

    background: linear-gradient(
        135deg,
        #0f8b4c,
        #19b968
    );

    color: #fff;

    box-shadow:
        0 10px 30px rgba(15, 139, 76, 0.30);

    cursor: pointer;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;

    /* Attention when website opens */
    animation: aiEntrance 1s ease-out 0.5s both;
}

@keyframes aiEntrance {

    0% {
        opacity: 0;
        transform: translateY(25px) scale(0.75);
    }

    50% {
        opacity: 1;
        transform: translateY(-6px) scale(1.05);
    }

    70% {
        transform: translateY(2px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ai-chat-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: rgba(255,255,255,0.18);

    font-size: 18px;

    animation: aiIconFloat 2.5s ease-in-out 2s infinite;
}

@keyframes aiIconFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-3px) rotate(-4deg);
    }
}