﻿/*=========================================================
    SAM 3.0
    Stitch America Assistant
    Production Stylesheet
=========================================================*/

/*=========================================================
    ROOT VARIABLES
=========================================================*/

:root {
    --sam-primary: #1E73BE;
    --sam-primary-light: #2F86D6;
    --sam-primary-dark: #155A96;
    --sam-success: #2ECC71;
    --sam-bg: #FFFFFF;
    --sam-bg-light: #F7F9FB;
    --sam-text: #243746;
    --sam-text-light: #6B7280;
    --sam-border: #D9E2EC;
    --sam-radius: 18px;
    --sam-radius-small: 14px;
    --sam-radius-pill: 999px;
    --sam-shadow: 0 18px 48px rgba(0,0,0,.18);
    --sam-speed: .2s;
    --sam-transition: all .2s ease;
}

/*=========================================================
    GLOBAL
=========================================================*/

*,
*::before,
*::after {
    box-sizing: border-box;
}

.sam-window *,
.sam-launcher * {
    font-family: inherit;
}

/*=========================================================
    ORIGINAL SAM LAUNCHER
    Saved before launcher redesign
=========================================================

.sam-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 2147483646;
}

.sam-launch-button {
    width: 240px;
    height: 88px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 22px;
    border: none;
    border-radius: 44px;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(0,0,0,.16);
    transition: transform var(--sam-speed), box-shadow var(--sam-speed);
}

.sam-launch-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0,0,0,.18);
}

.sam-launch-icon {
    width: 62px;
    height: 62px;
    min-width: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sam-launch-logo {
    width: 58px;
    height: 58px;
    display: block;
}

.sam-launch-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.sam-launch-text strong {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    color: #0A2F5B;
}

.sam-launch-text span {
    font-size: 14px;
    color: #555;
}

*/

/*=========================================================
    SAM LAUNCHER
=========================================================*/

.sam-launcher {
    position: fixed;
    right: 24px;
    bottom: 36px;
    z-index: 2147483646;
}

.sam-launch-button {
    width: 315px;
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px 12px 14px;
    border: 1px solid rgba(10,47,91,.08);
    border-radius: 50px;
    background: #F8FBFF;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(10,47,91,.10), 0 18px 40px rgba(10,47,91,.08);
    transition: all .25s ease;
    transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease;
}

    .sam-launch-button:hover {
        transform: translateY(-2px);
        background: #EEF7FF;
        transform: translateY(-2px) scale(1.01);
        box-shadow: 0 16px 36px rgba(10,47,91,.18);
    }

.sam-launch-icon {
    position: relative;
    width: 64px;
    height: 64px;
    min-width: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #FFFFFF;
    border: 1px solid rgba(10,47,91,.05);
    box-shadow: 0 6px 18px rgba(10,47,91,.12);
}

.sam-launch-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.sam-launch-online {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 16px;
    height: 16px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #22C55E;
    box-shadow: 0 2px 6px rgba(34,197,94,.35);
}

.sam-launch-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    line-height: 1.2;
    padding-top: 2px;
}

    .sam-launch-text strong {
        margin: 0 0 4px;
        font-size: 21px;
        font-weight: 700;
        color: #0B1E3D;
    }

    .sam-launch-text span {
        font-size: 14px;
        font-weight: 400;
        color: #556274;
    }

@keyframes samOnlinePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(34,197,94,0.5);
    }

    50% {
        transform: scale(1.15);
        box-shadow: 0 0 8px rgba(34,197,94,0.6);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(34,197,94,0.5);
    }
}

.sam-launch-online {
    animation: samOnlinePulse 4s ease-in-out infinite;
}

/*=========================================================
    WINDOW
=========================================================*/

.sam-window {
    position: fixed;
    right: 24px;
    bottom: 210px;
    width: 420px;
    height: 610px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    background: var(--sam-bg);
    border: 1px solid #E5EAF1;
    border-radius: var(--sam-radius);
    box-shadow: var(--sam-shadow);
    isolation: isolate;
    z-index: 2147483647;
}

    .sam-window.open {
        display: flex;
    }

/*=========================================================
    HEADER
=========================================================*/

.sam-header {
    height: 76px;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: var(--sam-primary);
    color: white;
}

.sam-header-logo {
    width: 42px;
    height: 42px;
    margin-right: 10px;
    object-fit: contain;
}

.sam-header-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sam-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}

.sam-subtitle {
    margin-top: 3px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,.92);
}

.sam-status {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,.90);
}

.sam-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sam-success);
    box-shadow: 0 0 6px rgba(46,204,113,.6);
    flex-shrink: 0;
}

.sam-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: white;
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    transition: all var(--sam-speed);
}

    .sam-close:hover {
        background: rgba(255,255,255,.18);
        transform: rotate(90deg);
    }

.sam-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sam-header-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.sam-chat-toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 7px 14px;
    border-bottom: 1px solid #e7edf5;
    background: #fafcff;
}

.sam-toolbar-button {
    background: none;
    border: none;
    color: #2d78c4;
    font-size: .78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 3px 6px;
    transition: color .2s ease;
}

.sam-toolbar-icon {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}

.sam-toolbar-button:hover {
    color: #1b5ea6;
    text-decoration: underline;
}

/*=========================================================
    BODY
=========================================================*/

.sam-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/*=========================================================
    WELCOME
=========================================================*/

.sam-welcome {
    flex: 0 0 auto;
    padding: 6px 22px 4px;
    background: #fff;
}

.sam-welcome-content {
    padding: 0 12px;
}

.sam-welcome-title {
    margin: 10px 0 4px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    color: #1F2937;
}

.sam-welcome-subtitle {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 500;
    color: #5F6F82;
}

.sam-welcome-text {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: #455468;
}

.sam-welcome-list {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
}

    .sam-welcome-list li {
        position: relative;
        margin-bottom: 6px;
        padding-left: 18px;
        font-size: 15px;
        line-height: 1.3;
        color: #455468;
    }

        .sam-welcome-list li::before {
            content: "";
            position: absolute;
            left: 2px;
            top: .55em;
            width: 4px;
            height: 4px;
            border-radius: 50%;
            background: #2F86D6;
        }

.sam-welcome-prompt {
    margin: 12px 0 16px;
    font-size: 15px;
    font-weight: 600;
    color: #0A66C2;
}
/*=========================================================
    QUICK ACTIONS
=========================================================*/

.sam-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 26px 10px;
    background: #fff;
}

.sam-quick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 16px;
    border: 1px solid #C7DCF8;
    border-radius: var(--sam-radius-pill);
    background: #F3F8FE;
    color: var(--sam-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--sam-speed);
}

    .sam-quick:hover {
        background: var(--sam-primary);
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(30,115,190,.25);
    }



/*=========================================================
    MESSAGES
=========================================================*/

.sam-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0 18px 18px;
    background: #fff;
}

    .sam-messages::-webkit-scrollbar {
        width: 8px;
    }

    .sam-messages::-webkit-scrollbar-thumb {
        background: #CCD7E4;
        border-radius: 999px;
    }

    .sam-messages::-webkit-scrollbar-track {
        background: transparent;
    }



/*=========================================================
    MESSAGE LAYOUT
=========================================================*/

.sam-message {
    display: flex;
    margin-bottom: 18px;
    opacity: 0;
    transform: translateY(8px);
    animation: samMessageIn .22s ease-out forwards;
}

    .sam-message.sam {
        justify-content: flex-start;
    }

    .sam-message.user {
        justify-content: flex-end;
    }

    .sam-message.agent {
        justify-content: flex-start;
    }

    .sam-message.system {
        justify-content: center;
    }

    .sam-message.no-animation {
        opacity: 1;
        transform: none;
        animation: none;
    }

/*=========================================================
    BUBBLES
=========================================================*/

.sam-bubble {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.55;
    word-break: break-word;
}

    .sam-bubble pre {
        margin: 12px 0;
        padding: 14px;
        overflow-x: auto;
        border-radius: 10px;
        background: #1E293B;
        color: white;
        font-size: 13px;
    }

    .sam-bubble code {
        font-family: Consolas, monospace;
    }

    .sam-bubble a {
        color: var(--sam-primary);
        font-weight: 600;
        text-decoration: underline;
        text-underline-offset: 2px;
        cursor: pointer;
    }

        .sam-bubble a:hover {
            text-decoration-thickness: 2px;
        }

    .sam-bubble ul,
    .sam-bubble ol {
        margin: 10px 0 10px 22px;
    }

    .sam-bubble li {
        margin-bottom: 6px;
    }

    .sam-bubble img {
        max-width: 100%;
        border-radius: 12px;
    }

/*---------------------------------------------------------
    SAM
---------------------------------------------------------*/

.sam-message.sam .sam-bubble {
    background: #F3F5F8;
    color: var(--sam-text);
}

/*---------------------------------------------------------
    USER
---------------------------------------------------------*/

.sam-message.user .sam-bubble {
    background: var(--sam-primary);
    color: white;
}

/*---------------------------------------------------------
    AGENT
---------------------------------------------------------*/

.sam-message.agent .sam-bubble {
    background: #E8F7EE;
    border-left: 4px solid var(--sam-success);
    color: var(--sam-text);
}

/*---------------------------------------------------------
    SYSTEM
---------------------------------------------------------*/

.sam-message.system .sam-bubble {
    background: transparent;
    color: #7A8694;
    font-size: 13px;
    font-style: italic;
    text-align: center;
    box-shadow: none;
}

/*=========================================================
    MESSAGE ANIMATION
=========================================================*/

@keyframes samMessageIn {

    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/*=========================================================
    SUGGESTED ACTIONS
=========================================================*/

.sam-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #DCE5EF;
}

.sam-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 12px;
    border: none;
    border-radius: var(--sam-radius-pill);
    background: #EEF6FF;
    color: var(--sam-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--sam-speed);
}

    .sam-action-button:hover {
        background: #DCEEFF;
        color: var(--sam-primary-dark);
        transform: translateY(-1px);
    }

/*=========================================================
    TYPING INDICATOR
=========================================================*/

.sam-typing {
    display: none;
    align-items: center;
    gap: 6px;
    margin: 0 0 16px 18px;
    padding: 12px 16px;
    background: #F3F5F8;
    border: 1px solid #E3E8EF;
    border-radius: 18px;
    width: fit-content;
}

    .sam-typing span:not(.sam-typing-text) {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #7A8A9A;
        animation: samTyping 1.4s infinite;
    }

    .sam-typing span:nth-child(2) {
        animation-delay: .2s;
    }

    .sam-typing span:nth-child(3) {
        animation-delay: .4s;
    }

.sam-typing-text {
    margin-left: 6px;
    font-size: 14px;
    color: #6B7280;
}

@keyframes samTyping {

    0%,80%,100% {
        transform: scale(.6);
        opacity: .5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/*=========================================================
    FOOTER
=========================================================*/

.sam-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: white;
    border-top: 1px solid #E6EBF2;
}

/*=========================================================
    ATTACH
=========================================================*/

.sam-attach {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #D7E1EC;
    border-radius: 8px;
    background: white;
    color: #8B98A7;
    cursor: not-allowed;
    transition: all var(--sam-speed);
}

    .sam-attach i {
        font-size: 22px;
    }

    .sam-attach:hover {
        background: #F8FAFC;
    }

/*=========================================================
    INPUT
=========================================================*/

.sam-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    min-height: 44px;
    max-height: 120px;
    padding: 11px 14px;
    border: 1px solid #C8D4E5;
    border-radius: 14px;
    background: #fff;
    resize: none;
    overflow-y: hidden;
    outline: none;
    font: inherit;
    font-size: 15px;
    line-height: 1.4;
    box-sizing: border-box;
    transition: border-color var(--sam-speed), box-shadow var(--sam-speed);
}

    .sam-input:focus {
        border-color: var(--sam-primary);
        box-shadow: 0 0 0 3px rgba(30,115,190,.15);
    }

    .sam-input::placeholder {
        color: #8A97AB;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sam-input::-webkit-scrollbar {
        width: 6px;
    }

    .sam-input::-webkit-scrollbar-thumb {
        background: #C8D4E5;
        border-radius: 3px;
    }

/*=========================================================
    SEND
=========================================================*/

.sam-send {
    width: 88px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 14px;
    background: var(--sam-primary);
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--sam-speed);
}

    .sam-send:hover {
        background: var(--sam-primary-light);
        transform: translateY(-1px);
    }

.sam-hidden {
    max-height: 0 !important;
    opacity: 0;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    transition: max-height .35s ease, opacity .25s ease, margin .25s ease, padding .25s ease;
}

.sam-send:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

.sam-input:disabled {
    background: #F5F7FA;
    cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {

    .sam-message,
    .sam-typing span,
    .sam-launch-button,
    .sam-close,
    .sam-quick,
    .sam-send {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

/*=========================================================
    MOBILE
=========================================================*/

@media screen and (max-width: 768px) {

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .sam-window {
        position: fixed;
        inset: 0;
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: none;
        margin: 0;
        border: 0;
        border-radius: 0;
        overflow: hidden;
    }

        .sam-window.open {
            display: flex;
        }

    .sam-header {
        flex: 0 0 auto;
        height: auto;
        min-height: 76px;
        padding-top: env(safe-area-inset-top);
        padding-right: max(16px, env(safe-area-inset-right));
        padding-left: max(16px, env(safe-area-inset-left));
    }

    .sam-chat-toolbar {
        flex: 0 0 auto;
    }

    .sam-body {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        overflow: hidden;
    }

    .sam-welcome,
    .sam-welcome-content,
    .sam-quick-actions,
    .sam-messages {
        max-width: 100%;
    }

    .sam-welcome {
        padding-right: 14px;
        padding-left: 14px;
    }

    .sam-welcome-content {
        padding-right: 6px;
        padding-left: 6px;
    }

    .sam-quick-actions {
        padding-right: 20px;
        padding-left: 20px;
    }

    .sam-messages {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .sam-bubble {
        max-width: 88%;
    }

    .sam-footer {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        gap: 8px;
        padding-top: 10px;
        padding-right: max(10px, env(safe-area-inset-right));
        padding-bottom: max(10px, env(safe-area-inset-bottom));
        padding-left: max(10px, env(safe-area-inset-left));
    }

    .sam-input {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        max-width: 100%;
        font-size: 16px;
    }

    .sam-send {
        flex: 0 0 64px;
        width: 64px;
    }

    .sam-attach {
        flex: 0 0 36px;
    }

    .sam-launcher {
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
        max-width: calc(100vw - 24px);
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        border-radius: 999px;
    }

    .sam-launch-button {
        width: min(230px, calc(100vw - 24px));
        min-height: 76px;
        height: auto;
    }

    .sam-launch-icon {
        width: 56px;
        height: 56px;
        min-width: 56px;
    }

    .sam-launch-logo {
        width: 48px;
        height: 48px;
    }

    .sam-launch-text {
        min-width: 0;
    }

        .sam-launch-text strong {
            font-size: 16px;
        }

        .sam-launch-text span {
            font-size: 14px;
        }
}

.sam-launcher,
.sam-launcher:hover,
.sam-launcher:focus,
.sam-launcher:active {
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}