/* ============================================================
   SKF ASSISTANT — PREMIUM CHATBOT UI
   Sumit Knowledge Foundation
   Version: 1.0.0
   ============================================================ */

.skf-chatbot,
.skf-chatbot * {
    box-sizing: border-box;
}

.skf-chatbot {
    --skf-bg: #07111f;
    --skf-panel: rgba(10, 23, 42, 0.94);
    --skf-panel-soft: rgba(18, 36, 61, 0.78);
    --skf-border: rgba(148, 198, 255, 0.16);
    --skf-text: #f4f8ff;
    --skf-muted: #9fb0c8;
    --skf-cyan: #22d3ee;
    --skf-blue: #3b82f6;
    --skf-purple: #8b5cf6;
    --skf-green: #34d399;

    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 999999;

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 15px;
    line-height: 1.5;
    color: var(--skf-text);
}


/* ============================================================
   ACCESSIBILITY
   ============================================================ */

.skf-chatbot__sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skf-chatbot button,
.skf-chatbot textarea,
.skf-chatbot a {
    font: inherit;
}

.skf-chatbot button:focus-visible,
.skf-chatbot textarea:focus-visible,
.skf-chatbot a:focus-visible {
    outline: 2px solid var(--skf-cyan);
    outline-offset: 3px;
}


/* ============================================================
   FLOATING LAUNCHER
   ============================================================ */

.skf-chatbot__launcher {
    position: relative;

    width: 62px;
    height: 62px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 21px;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            rgba(34, 211, 238, 0.96),
            rgba(59, 130, 246, 0.98) 48%,
            rgba(139, 92, 246, 0.98)
        );

    box-shadow:
        0 18px 50px rgba(2, 12, 27, 0.42),
        0 8px 24px rgba(59, 130, 246, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);

    cursor: pointer;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;

    isolation: isolate;
}

.skf-chatbot__launcher::before {
    content: "";

    position: absolute;
    inset: -6px;
    z-index: -1;

    border-radius: 26px;

    background:
        linear-gradient(
            135deg,
            rgba(34, 211, 238, 0.24),
            rgba(139, 92, 246, 0.18)
        );

    filter: blur(9px);
    opacity: 0.8;
}

.skf-chatbot__launcher:hover {
    transform: translateY(-3px) scale(1.02);

    box-shadow:
        0 22px 60px rgba(2, 12, 27, 0.5),
        0 10px 30px rgba(59, 130, 246, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.skf-chatbot__launcher-icon,
.skf-chatbot__launcher-close {
    display: flex;
    align-items: center;
    justify-content: center;
}

.skf-chatbot__launcher-close {
    display: none;
    font-size: 34px;
    font-weight: 300;
    line-height: 1;
}

.skf-chatbot__launcher-status {
    position: absolute;

    width: 13px;
    height: 13px;

    right: -1px;
    top: -1px;

    border: 3px solid #0b1729;
    border-radius: 50%;

    background: var(--skf-green);

    box-shadow: 0 0 12px rgba(52, 211, 153, 0.7);
}

.skf-chatbot.is-open .skf-chatbot__launcher-icon {
    display: none;
}

.skf-chatbot.is-open .skf-chatbot__launcher-close {
    display: flex;
}


/* ============================================================
   CHAT WINDOW
   ============================================================ */

.skf-chatbot__window {
    position: absolute;

    right: 0;
    bottom: 78px;

    width: min(390px, calc(100vw - 32px));
    height: min(650px, calc(100vh - 120px));

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border: 1px solid var(--skf-border);
    border-radius: 26px;

    background:
        linear-gradient(
            160deg,
            rgba(12, 27, 48, 0.97),
            rgba(5, 15, 29, 0.98)
        );

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.48),
        0 12px 34px rgba(8, 24, 48, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);

    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);

    opacity: 0;
    visibility: hidden;

    transform:
        translateY(18px)
        scale(0.97);

    transform-origin: bottom right;

    pointer-events: none;

    transition:
        opacity 0.24s ease,
        visibility 0.24s ease,
        transform 0.24s ease;
}

.skf-chatbot.is-open .skf-chatbot__window {
    opacity: 1;
    visibility: visible;

    transform:
        translateY(0)
        scale(1);

    pointer-events: auto;
}


/* ============================================================
   HEADER
   ============================================================ */

.skf-chatbot__header {
    min-height: 76px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    padding: 14px 15px 14px 17px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);

    background:
        linear-gradient(
            135deg,
            rgba(18, 39, 67, 0.96),
            rgba(11, 25, 46, 0.92)
        );
}

.skf-chatbot__identity {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 11px;
}

.skf-chatbot__avatar {
    width: 43px;
    height: 43px;

    flex: 0 0 43px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;

    color: #ffffff;

    font-size: 19px;
    font-weight: 800;

    background:
        linear-gradient(
            135deg,
            var(--skf-cyan),
            var(--skf-blue) 52%,
            var(--skf-purple)
        );

    box-shadow:
        0 8px 20px rgba(59, 130, 246, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.skf-chatbot__identity-text {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 2px;
}

.skf-chatbot__title {
    overflow: hidden;

    color: #ffffff;

    font-size: 15.5px;
    font-weight: 750;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.skf-chatbot__status {
    display: flex;
    align-items: center;

    gap: 6px;

    color: var(--skf-muted);

    font-size: 11.5px;
    font-weight: 500;
}

.skf-chatbot__status-dot {
    width: 7px;
    height: 7px;

    flex: 0 0 7px;

    border-radius: 50%;

    background: var(--skf-green);

    box-shadow: 0 0 8px rgba(52, 211, 153, 0.65);
}


/* ============================================================
   HEADER BUTTONS
   ============================================================ */

.skf-chatbot__header-actions {
    display: flex;
    align-items: center;

    gap: 5px;
}

.skf-chatbot__header-btn {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 11px;

    color: #cbd9eb;

    background: rgba(255, 255, 255, 0.045);

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.skf-chatbot__header-btn:hover {
    color: #ffffff;

    border-color: rgba(34, 211, 238, 0.22);

    background: rgba(34, 211, 238, 0.09);

    transform: translateY(-1px);
}


/* ============================================================
   CHAT BODY
   ============================================================ */

.skf-chatbot__body {
    position: relative;

    flex: 1 1 auto;
    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: thin;
    scrollbar-color:
        rgba(148, 163, 184, 0.26)
        transparent;
}

.skf-chatbot__body::-webkit-scrollbar {
    width: 5px;
}

.skf-chatbot__body::-webkit-scrollbar-track {
    background: transparent;
}

.skf-chatbot__body::-webkit-scrollbar-thumb {
    border-radius: 20px;

    background: rgba(148, 163, 184, 0.24);
}

.skf-chatbot__messages {
    min-height: 100%;

    display: flex;
    flex-direction: column;

    gap: 12px;

    padding: 20px 16px 16px;
}


/* ============================================================
   MESSAGE ROWS
   ============================================================ */

.skf-chatbot__message {
    width: 100%;

    display: flex;

    animation: skfMessageIn 0.25s ease both;
}

.skf-chatbot__message--assistant {
    justify-content: flex-start;
}

.skf-chatbot__message--user {
    justify-content: flex-end;
}

.skf-chatbot__bubble {
    max-width: 84%;

    padding: 11px 13px;

    border-radius: 16px;

    font-size: 13.5px;
    line-height: 1.55;

    overflow-wrap: anywhere;
}

.skf-chatbot__message--assistant .skf-chatbot__bubble {
    color: #eaf2ff;

    border: 1px solid rgba(148, 198, 255, 0.12);
    border-bottom-left-radius: 5px;

    background:
        linear-gradient(
            135deg,
            rgba(30, 52, 82, 0.88),
            rgba(20, 39, 65, 0.86)
        );

    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.skf-chatbot__message--user .skf-chatbot__bubble {
    color: #ffffff;

    border: 1px solid rgba(255, 255, 255, 0.13);
    border-bottom-right-radius: 5px;

    background:
        linear-gradient(
            135deg,
            rgba(37, 99, 235, 0.96),
            rgba(99, 102, 241, 0.96)
        );

    box-shadow:
        0 8px 20px rgba(37, 99, 235, 0.18);
}

.skf-chatbot__bubble p {
    margin: 0 0 7px;
}

.skf-chatbot__bubble p:last-child {
    margin-bottom: 0;
}

.skf-chatbot__bubble strong {
    color: inherit;
}


/* ============================================================
   LINKS / ACTIONS INSIDE MESSAGES
   ============================================================ */

.skf-chatbot__bubble a {
    color: #79e8ff;

    font-weight: 650;
    text-decoration: none;
}

.skf-chatbot__bubble a:hover {
    text-decoration: underline;
}


/* ============================================================
   QUICK REPLY AREA
   ============================================================ */

.skf-chatbot__quick-replies {
    flex: 0 0 auto;

    max-height: 150px;

    overflow-y: auto;

    padding: 10px 14px 12px;

    border-top: 1px solid rgba(255, 255, 255, 0.055);

    background: rgba(7, 18, 34, 0.76);

    scrollbar-width: thin;
}

.skf-chatbot__quick-replies:not([hidden]) {
    display: flex;

    flex-wrap: wrap;

    gap: 7px;
}

.skf-chatbot__chip {
    min-height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 7px 11px;

    border: 1px solid rgba(96, 165, 250, 0.22);
    border-radius: 999px;

    color: #dceaff;

    background:
        linear-gradient(
            135deg,
            rgba(30, 64, 175, 0.15),
            rgba(109, 40, 217, 0.11)
        );

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        color 0.18s ease;
}

.skf-chatbot__chip:hover {
    color: #ffffff;

    border-color: rgba(34, 211, 238, 0.4);

    background:
        linear-gradient(
            135deg,
            rgba(37, 99, 235, 0.28),
            rgba(124, 58, 237, 0.22)
        );

    transform: translateY(-1px);
}

.skf-chatbot__chip--primary {
    color: #ffffff;

    border-color: rgba(34, 211, 238, 0.28);

    background:
        linear-gradient(
            135deg,
            rgba(8, 145, 178, 0.38),
            rgba(37, 99, 235, 0.38)
        );
}


/* ============================================================
   TYPING INDICATOR
   ============================================================ */

.skf-chatbot__typing {
    width: fit-content;

    align-items: center;

    gap: 4px;

    margin: 0 16px 16px;

    padding: 11px 14px;

    border: 1px solid rgba(148, 198, 255, 0.1);
    border-radius: 15px 15px 15px 5px;

    background: rgba(26, 46, 73, 0.82);
}

.skf-chatbot__typing:not([hidden]) {
    display: flex;
}

.skf-chatbot__typing span {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #9eb0c8;

    animation: skfTyping 1.15s infinite ease-in-out;
}

.skf-chatbot__typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.skf-chatbot__typing span:nth-child(3) {
    animation-delay: 0.3s;
}


/* ============================================================
   COMPOSER
   ============================================================ */

.skf-chatbot__composer {
    flex: 0 0 auto;

    padding: 11px 13px 9px;

    border-top: 1px solid rgba(255, 255, 255, 0.07);

    background:
        linear-gradient(
            180deg,
            rgba(8, 20, 37, 0.96),
            rgba(5, 15, 29, 0.98)
        );
}

.skf-chatbot__form {
    display: flex;
    align-items: flex-end;

    gap: 8px;

    padding: 6px 6px 6px 12px;

    border: 1px solid rgba(148, 198, 255, 0.13);
    border-radius: 17px;

    background: rgba(255, 255, 255, 0.045);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.skf-chatbot__form:focus-within {
    border-color: rgba(34, 211, 238, 0.35);

    background: rgba(255, 255, 255, 0.06);

    box-shadow:
        0 0 0 3px rgba(34, 211, 238, 0.06);
}

.skf-chatbot__input {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    max-height: 110px;

    resize: none;

    padding: 8px 2px;

    overflow-y: auto;

    border: 0 !important;
    outline: 0 !important;

    color: #eef5ff !important;

    background: transparent !important;

    box-shadow: none !important;

    font-size: 13.5px;
    line-height: 1.45;
}

.skf-chatbot__input::placeholder {
    color: #71839c;
    opacity: 1;
}

.skf-chatbot__send {
    width: 39px;
    height: 39px;

    flex: 0 0 39px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 13px;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            var(--skf-cyan),
            var(--skf-blue) 55%,
            var(--skf-purple)
        );

    box-shadow:
        0 7px 18px rgba(59, 130, 246, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);

    cursor: pointer;

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.skf-chatbot__send:hover {
    transform: translateY(-1px);

    box-shadow:
        0 9px 22px rgba(59, 130, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.skf-chatbot__send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}


/* ============================================================
   FOOTER NOTE
   ============================================================ */

.skf-chatbot__footer-note {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 5px;

    padding-top: 7px;

    color: #63758e;

    font-size: 9.5px;
    font-weight: 500;
}


/* ============================================================
   OPTIONAL SUMMARY CARD
   Used later by the JavaScript lead flow
   ============================================================ */

.skf-chatbot__summary {
    width: 100%;

    padding: 12px;

    border: 1px solid rgba(96, 165, 250, 0.14);
    border-radius: 15px;

    background:
        linear-gradient(
            145deg,
            rgba(21, 42, 69, 0.78),
            rgba(13, 29, 51, 0.82)
        );
}

.skf-chatbot__summary-row {
    display: grid;

    grid-template-columns: 86px minmax(0, 1fr);

    gap: 8px;

    padding: 5px 0;

    border-bottom: 1px solid rgba(255, 255, 255, 0.055);

    font-size: 12px;
}

.skf-chatbot__summary-row:last-child {
    border-bottom: 0;
}

.skf-chatbot__summary-label {
    color: #8fa3bc;
}

.skf-chatbot__summary-value {
    color: #edf5ff;

    overflow-wrap: anywhere;
}


/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes skfMessageIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes skfTyping {
    0%,
    60%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-3px);
    }
}


/* ============================================================
   TABLET / SMALL LAPTOP
   ============================================================ */

@media (max-width: 782px) {

    .skf-chatbot {
        right: 16px;
        bottom: 16px;
    }

    .skf-chatbot__window {
        bottom: 74px;

        height: min(620px, calc(100vh - 105px));
    }

}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 520px) {

    .skf-chatbot {
        right: 12px;
        bottom: 12px;
    }

    .skf-chatbot__launcher {
        width: 57px;
        height: 57px;

        border-radius: 19px;
    }

    .skf-chatbot__window {
        position: fixed;

        left: 8px;
        right: 8px;
        top: 8px;
        bottom: 8px;

        width: auto;
        height: auto;
        max-width: none;

        border-radius: 22px;

        transform-origin: bottom right;
    }

    .skf-chatbot__header {
        min-height: 70px;

        padding:
            max(12px, env(safe-area-inset-top))
            12px
            12px;
    }

    .skf-chatbot__messages {
        padding: 17px 13px 14px;
    }

    .skf-chatbot__bubble {
        max-width: 88%;

        font-size: 13.5px;
    }

    .skf-chatbot__quick-replies {
        max-height: 145px;

        padding: 9px 11px 10px;
    }

    .skf-chatbot__composer {
        padding:
            10px
            10px
            max(8px, env(safe-area-inset-bottom));
    }

}


/* ============================================================
   VERY SMALL MOBILE
   ============================================================ */

@media (max-width: 360px) {

    .skf-chatbot__avatar {
        width: 39px;
        height: 39px;

        flex-basis: 39px;

        border-radius: 12px;
    }

    .skf-chatbot__title {
        font-size: 14px;
    }

    .skf-chatbot__status {
        font-size: 10.5px;
    }

    .skf-chatbot__header-actions {
        gap: 3px;
    }

    .skf-chatbot__header-btn {
        width: 31px;
        height: 31px;
    }

}


/* ============================================================
   REDUCED MOTION ACCESSIBILITY
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    .skf-chatbot *,
    .skf-chatbot *::before,
    .skf-chatbot *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

}