@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap";

:root {
    --primary-orange: rgb(240, 82, 35);
    --primary-orange-dark: rgb(200, 60, 25);
    --bg-light: #ffffff;
    --bg-chat: #f8f8f8;
    --text-dark: #1a1a1a;
    --text-light: #ffffff;
    --border-light: #e5e5e5;
    --shadow: 0 5px 40px rgba(0, 0, 0, .16)
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

body {
    font-family: Inter, Segoe UI, system-ui, sans-serif;
    background: #f0f0f0;
    min-height: 100vh
}

.chat-toggle-btn {
    position: fixed;
    bottom: 110px;
    right: 10px;
    width: 70px;
    height: 70px;
    background: #ffffff url('../images/chatbot-icon.png') no-repeat center center;
    background-size: 100%;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 5px 24px rgba(0, 0, 0, 0.1)
}

.chat-toggle-btn:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 8px 25px rgba(240, 82, 35, 0.6))
}

.chat-toggle-btn svg {
    width: 0;
    height: 0;
    display: none
}

.chat-container {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    height: 520px;
    max-height: calc(100vh - 130px);
    background: var(--bg-light);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow);
    z-index: 99998;
    animation: slideUp .25s ease
}

@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translateY(20px)
    }

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

.chat-header {
    background: var(--bg-light);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-orange);
    display: flex;
    align-items: center;
    gap: 10px
}

.brand-title .scalify-text {
    display: inline-flex;
    color: var(--primary-orange);
    font-weight: 700
}

.scalify-text .letter {
    display: inline-block;
    animation: letterWave 2s ease-in-out infinite
}

.scalify-text .letter:nth-child(1) {
    animation-delay: 0s
}

.scalify-text .letter:nth-child(2) {
    animation-delay: .1s
}

.scalify-text .letter:nth-child(3) {
    animation-delay: .2s
}

.scalify-text .letter:nth-child(4) {
    animation-delay: .3s
}

.scalify-text .letter:nth-child(5) {
    animation-delay: .4s
}

.scalify-text .letter:nth-child(6) {
    animation-delay: .5s
}

.scalify-text .letter:nth-child(7) {
    animation-delay: .6s
}

@keyframes letterWave {

    0%,
    to {
        transform: translateY(0);
        color: var(--primary-orange)
    }

    25% {
        transform: translateY(-4px);
        color: #ff6b3d
    }

    50% {
        transform: translateY(0);
        color: var(--primary-orange)
    }
}

.scalify-cursor {
    animation: blink 1s infinite;
    color: var(--primary-orange);
    font-weight: 300;
    margin-left: 1px
}

@keyframes blink {

    0%,
    50% {
        opacity: 1
    }

    51%,
    to {
        opacity: 0
    }
}

.close-btn {
    background: var(--primary-orange);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    font-size: 1rem;
    font-weight: 700
}

.close-btn:hover {
    background: var(--primary-orange-dark);
    transform: scale(1.05)
}

.online-dot {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    position: relative
}

.online-dot:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse-dot 2s infinite
}

@keyframes pulse-dot {
    0% {
        transform: scale(1);
        opacity: 1
    }

    50% {
        transform: scale(1.8);
        opacity: 0
    }

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

.reset-btn {
    background: var(--bg-chat);
    border: 1px solid var(--border-light);
    color: var(--text-dark);
    padding: 6px 14px;
    border-radius: 16px;
    cursor: pointer;
    font-size: .75rem;
    font-weight: 500;
    transition: all .2s
}

.reset-btn:hover {
    background: var(--primary-orange);
    color: var(--text-light);
    border-color: var(--primary-orange)
}

.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-chat)
}

.messages-area::-webkit-scrollbar {
    width: 5px
}

.messages-area::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: .88rem;
    word-wrap: break-word;
    animation: messageSlideIn .3s ease-out;
    transform-origin: left center
}

@keyframes messageSlideIn {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(.95)
    }

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

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--primary-orange-dark) 100%);
    color: var(--text-light);
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px #f052234d;
    transform-origin: right center
}

.message.bot {
    align-self: flex-start;
    background: var(--bg-light);
    color: var(--text-dark);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px #0000001a;
    border: 1px solid rgba(240, 82, 35, .1)
}

.message.bot .scalify-highlight {
    color: var(--primary-orange);
    font-weight: 600
}

.message.bot strong,
.message.bot a {
    color: var(--primary-orange)
}

.scalify-text-inline {
    display: inline-flex;
    color: var(--primary-orange);
    font-weight: 700
}

.scalify-text-inline .letter {
    display: inline-block;
    opacity: 0;
    animation: typewriterLetter 3.5s ease-in-out infinite
}

.scalify-text-inline .letter:nth-child(1) {
    animation-delay: 0s
}

.scalify-text-inline .letter:nth-child(2) {
    animation-delay: .15s
}

.scalify-text-inline .letter:nth-child(3) {
    animation-delay: .3s
}

.scalify-text-inline .letter:nth-child(4) {
    animation-delay: .45s
}

.scalify-text-inline .letter:nth-child(5) {
    animation-delay: .6s
}

.scalify-text-inline .letter:nth-child(6) {
    animation-delay: .75s
}

.scalify-text-inline .letter:nth-child(7) {
    animation-delay: .9s
}

@keyframes typewriterLetter {
    0% {
        opacity: 0;
        transform: translateY(10px)
    }

    10% {
        opacity: 1;
        transform: translateY(0)
    }

    80% {
        opacity: 1;
        transform: translateY(0)
    }

    90% {
        opacity: 0;
        transform: translateY(-10px)
    }

    to {
        opacity: 0;
        transform: translateY(10px)
    }
}

.typing-indicator {
    display: flex;
    align-items: center;
    padding: 12px 16px !important;
    font-size: .88rem;
    color: #666
}

.typing-text {
    color: var(--primary-orange);
    font-weight: 500;
    font-style: italic
}

.typing-dots {
    display: inline-flex;
    margin-left: 2px
}

.typing-dots span {
    width: auto;
    height: auto;
    background: none;
    color: var(--primary-orange);
    font-weight: 700;
    font-size: 1.2rem;
    animation: dotBlink 1.4s infinite
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s
}

.typing-dots span:nth-child(2) {
    animation-delay: .2s
}

.typing-dots span:nth-child(3) {
    animation-delay: .4s
}

@keyframes dotBlink {

    0%,
    20% {
        opacity: 0
    }

    40% {
        opacity: 1
    }

    60%,
    to {
        opacity: 0
    }
}

.quick-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    padding: 8px 0;
    animation: fadeIn .4s ease-out
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px)
    }

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

.quick-btn {
    background: var(--bg-light);
    border: 1.5px solid var(--primary-orange);
    color: var(--primary-orange);
    padding: 12px 16px;
    border-radius: 24px;
    cursor: pointer;
    font-size: .8rem;
    font-weight: 500;
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 2px 4px #0000000d;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center
}

.quick-btn:hover {
    background: var(--primary-orange);
    color: var(--text-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px #f052234d
}

.quick-btn:active {
    transform: translateY(0)
}

.input-area {
    padding: 14px 16px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0
}

.chat-input {
    flex: 1;
    background: var(--bg-chat);
    border: 1px solid var(--border-light);
    color: var(--text-dark);
    padding: 12px 16px;
    border-radius: 24px;
    font-size: .88rem;
    outline: none;
    transition: border-color .2s;
    position: relative;
    z-index: 10
}

.chat-input:focus {
    border-color: var(--primary-orange)
}

.send-btn {
    width: 42px;
    height: 42px;
    background: var(--primary-orange);
    border: none;
    border-radius: 50%;
    color: var(--text-light);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    flex-shrink: 0
}

.send-btn:hover:not(:disabled) {
    background: var(--primary-orange-dark)
}

.send-btn:disabled {
    opacity: .5;
    cursor: not-allowed
}

@media(max-width:768px) {
    .chat-toggle-btn {
        bottom: 110px;
        right: 10px;
        width: 56px;
        height: 56px
    }

    .chat-container {
        right: 16px;
        left: 16px;
        width: auto;
        bottom: 90px;
        height: calc(100vh - 120px);
        max-height: 600px
    }

    .brand-title {
        font-size: 1rem
    }

    .scalify-logo {
        width: 70px !important;
        height: 24px !important
    }

    .quick-options-grid {
        grid-template-columns: 1fr
    }
}

@media(max-width:480px) {
    .chat-toggle-btn {
        bottom: 110px;
        right: 10px;
        width: 56px;
        height: 56px
    }

    .chat-toggle-btn svg {
        width: 26px;
        height: 26px
    }

    .chat-container {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0
    }

    .chat-header {
        padding: 16px;
        box-shadow: 0 2px 8px #0000001a
    }

    .brand-title {
        font-size: .95rem
    }

    .scalify-logo {
        width: 65px !important;
        height: 22px !important
    }

    .messages-area {
        padding: 16px 12px
    }

    .message {
        max-width: 90%;
        font-size: .88rem;
        padding: 12px 16px
    }

    .quick-btn {
        padding: 14px 16px;
        font-size: .85rem;
        min-height: 48px
    }

    .quick-options-grid {
        gap: 12px
    }

    .input-area {
        padding: 14px 12px;
        gap: 8px
    }

    .chat-input {
        padding: 12px 16px;
        font-size: .9rem
    }

    .send-btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem
    }

    .reset-btn,
    .close-btn {
        min-width: 36px;
        min-height: 36px
    }
}

.scalify-logo {
    color: var(--primary-orange);
    fill: var(--primary-orange)
}

.logo-animate {
    animation: letterWave 2s ease-in-out infinite
}

.logo-animate-1 {
    animation-delay: .4s
}

.logo-animate-2 {
    animation-delay: .6s
}

.logo-animate-3 {
    animation-delay: .2s
}

.logo-animate-4 {
    animation-delay: .1s
}

.logo-animate-5 {
    animation-delay: 0s
}