/* =========================================================
   LYGS ELITE BASKETBALL — CHATBOT
========================================================= */

:root {
    --chat-red: #d71920;
    --chat-red-dark: #b51219;
    --chat-black: #111111;
    --chat-white: #ffffff;
    --chat-muted: #737373;
    --chat-border: #e9e9e9;
    --chat-background: #f8f8f8;
}

/* ROOT */

.lygs-chatbot {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    font-family: "Montserrat", "Roboto", sans-serif;
}

/* =========================================================
   FLOATING LAUNCHER
========================================================= */

.lygs-chat-launcher {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    min-height: 58px;
    padding: 0 22px;

    border: none;
    border-radius: 999px;

    background: var(--chat-red);
    color: white;

    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;

    cursor: pointer;

    box-shadow:
        0 8px 28px rgba(215, 25, 32, 0.28),
        0 3px 10px rgba(0, 0, 0, 0.1);

    transition:
        transform 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

.lygs-chat-launcher:hover {
    background: var(--chat-red-dark);
    transform: translateY(-3px);

    box-shadow:
        0 12px 34px rgba(215, 25, 32, 0.35);
}

.lygs-launcher-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
}

.lygs-launcher-notification {
    position: absolute;
    top: 2px;
    right: 3px;

    width: 11px;
    height: 11px;

    background: #35c66b;
    border: 2px solid white;
    border-radius: 50%;
}

/* =========================================================
   CHAT WINDOW
========================================================= */

.lygs-chat-window {
    position: absolute;
    right: 0;
    bottom: 76px;

    width: 390px;
    height: min(610px, calc(100dvh - 125px));

    display: flex;
    flex-direction: column;

    overflow: hidden;

    background: white;
    border: 1px solid var(--chat-border);
    border-radius: 18px;

    box-shadow:
        0 25px 75px rgba(0, 0, 0, 0.18),
        0 5px 20px rgba(0, 0, 0, 0.06);

    opacity: 0;
    visibility: hidden;

    transform: translateY(16px) scale(0.96);
    transform-origin: bottom right;

    pointer-events: none;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        visibility 0.25s ease;
}

.lygs-chatbot.is-open .lygs-chat-window {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.lygs-chatbot.is-open .lygs-chat-launcher {
    display: none;
}

/* =========================================================
   HEADER
========================================================= */

.lygs-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    flex-shrink: 0;

    padding: 17px 18px;
    background: var(--chat-black);
    color: white;
}

.lygs-chat-avatar {
    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    background: var(--chat-red);
    border-radius: 12px;

    font-size: 21px;
    color: white;
}

.lygs-chat-title {
    font-size: 14px;
    line-height: 1.4;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.lygs-chat-status {
    display: flex;
    align-items: center;
    gap: 7px;

    margin-top: 4px;

    font-size: 10px;
    font-weight: 500;
    color: #c9c9c9;
}

.lygs-status-dot {
    width: 7px;
    height: 7px;

    background: #36d276;
    border-radius: 50%;
}

.lygs-chat-header-btn {
    width: 33px;
    height: 33px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 8px;

    color: white;
    font-size: 12px;
    cursor: pointer;

    transition: background 0.2s ease;
}

.lygs-chat-header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* =========================================================
   MESSAGES
========================================================= */

.lygs-chat-messages {
    flex: 1;
    min-height: 0;

    overflow-y: auto;
    overscroll-behavior: contain;

    padding: 22px 18px;

    background: var(--chat-background);

    display: flex;
    flex-direction: column;
    gap: 17px;

    scrollbar-width: thin;
    scrollbar-color: #dddddd transparent;
}

.lygs-chat-message {
    display: flex;
    gap: 9px;
    align-items: flex-end;

    max-width: 94%;

    animation: lygsMessageIn 0.3s ease both;
}

.lygs-chat-message.bot {
    align-self: flex-start;
}

.lygs-chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.lygs-message-avatar {
    width: 28px;
    height: 28px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: var(--chat-black);
    color: white;

    font-size: 12px;
}

.lygs-message-content {
    display: flex;
    flex-direction: column;
    gap: 5px;

    min-width: 0;
}

.lygs-message-bubble {
    padding: 12px 14px;

    font-family: "Roboto", sans-serif;
    font-size: 12.5px;
    line-height: 1.75;

    white-space: pre-wrap;
    overflow-wrap: anywhere;

    background: white;
    color: #303030;

    border: 1px solid #ededed;
    border-radius: 14px 14px 14px 3px;
}

.lygs-chat-message.user .lygs-message-bubble {
    background: var(--chat-red);
    color: white;

    border-color: var(--chat-red);
    border-radius: 14px 14px 3px 14px;
}

.lygs-message-time {
    font-size: 9px;
    color: #999999;
    padding: 0 3px;
}

.lygs-chat-message.user .lygs-message-time {
    text-align: right;
}

@keyframes lygsMessageIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

/* =========================================================
   SUGGESTED QUESTIONS
========================================================= */

.lygs-chat-suggestions {
    padding: 14px 16px 12px;

    background: white;
    border-top: 1px solid var(--chat-border);
}

.lygs-suggestions-label {
    margin-bottom: 11px;

    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #999999;
}

.lygs-suggestions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.lygs-suggestion {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;

    min-height: 38px;
    padding: 9px 11px;

    background: #fafafa;
    border: 1px solid #ededed;
    border-radius: 8px;

    color: #292929;

    font-size: 10px;
    font-weight: 700;
    text-align: left;

    cursor: pointer;

    transition: all 0.2s ease;
}

.lygs-suggestion i {
    color: var(--chat-red);
    font-size: 12px;
}

.lygs-suggestion:hover {
    border-color: var(--chat-red);
    background: #fff6f6;
}

/* =========================================================
   TYPING INDICATOR
========================================================= */

.lygs-chat-typing {
    display: flex;
    align-items: center;
    gap: 5px;

    padding: 10px 20px;

    background: var(--chat-background);
}

.lygs-chat-typing[hidden] {
    display: none;
}

.lygs-chat-typing span {
    width: 6px;
    height: 6px;

    border-radius: 50%;
    background: #999999;

    animation: lygsTyping 1.2s infinite ease-in-out;
}

.lygs-chat-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.lygs-chat-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

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

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

/* =========================================================
   MESSAGE COMPOSER
========================================================= */

.lygs-chat-composer {
    display: flex;
    align-items: flex-end;
    gap: 10px;

    flex-shrink: 0;

    padding: 12px 14px;

    background: white;
    border-top: 1px solid var(--chat-border);
}

#lygs-chat-input {
    flex: 1;
    min-width: 0;

    min-height: 39px;
    max-height: 115px;

    padding: 10px 12px;

    resize: none;
    overflow-y: auto;

    background: #f7f7f7;
    border: 1px solid #eeeeee;
    border-radius: 10px;

    outline: none;

    color: #222222;
    font-family: "Roboto", sans-serif;
    font-size: 12px;
    line-height: 1.5;

    transition: border-color 0.2s ease;
}

#lygs-chat-input:focus {
    border-color: var(--chat-red);
}

#lygs-chat-input::placeholder {
    color: #999999;
}

.lygs-chat-send {
    width: 39px;
    height: 39px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 10px;

    background: var(--chat-red);
    color: white;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.lygs-chat-send:hover:not(:disabled) {
    background: var(--chat-red-dark);
    transform: translateY(-1px);
}

.lygs-chat-send:disabled {
    background: #dddddd;
    cursor: not-allowed;
}

/* =========================================================
   FOOTER
========================================================= */

.lygs-chat-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    flex-shrink: 0;

    padding: 10px;

    border-top: 1px solid #f0f0f0;

    background: white;
    color: #999999;

    font-size: 9px;
    font-weight: 500;
}

.lygs-chat-footer i {
    color: var(--chat-red);
}

.lygs-footer-separator {
    color: #cccccc;
}

/* =========================================================
   FOCUS ACCESSIBILITY
========================================================= */

.lygs-chatbot button:focus-visible,
.lygs-chatbot textarea:focus-visible {
    outline: 2px solid var(--chat-red);
    outline-offset: 3px;
}



/* Ensure the chatbot remains above all website sections */

#lygs-chatbot {
    position: fixed !important;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 640px) {

    .lygs-chatbot {
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .lygs-chat-launcher {
        width: 56px;
        height: 56px;
        min-height: 56px;
        padding: 0;
        border-radius: 50%;
    }

    .lygs-launcher-text {
        display: none;
    }

    .lygs-chat-window {
        position: fixed;

        top: auto;
        left: 10px;
        right: 10px;

        bottom: calc(10px + env(safe-area-inset-bottom));

        width: auto;
        height: min(680px, calc(100dvh - 20px - env(safe-area-inset-bottom)));

        border-radius: 16px;
    }

    .lygs-chat-header {
        padding: 15px;
    }

    .lygs-chat-messages {
        padding: 18px 14px;
    }

    .lygs-message-bubble {
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .lygs-suggestions-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lygs-chatbot *,
    .lygs-chatbot *::before,
    .lygs-chatbot *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}














/* ==========================================
   LYGS CHATBOT — PHASE 3 CONVERSIONS
========================================== */

#lygs-chatbot [hidden] {
    display: none !important;
}

.lygs-chat-programs,
.lygs-chat-actions {
    padding: 10px 16px;
}

.lygs-chat-programs {
    display: grid;
    gap: 10px;
}

.lygs-program-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
}

.lygs-program-title {
    margin: 0 0 6px;
    color: #111827;
    font-size: 14px;
    font-weight: 800;
}

.lygs-program-description {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.lygs-program-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    background: #dc2626;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: background .2s ease;
}

.lygs-program-link:hover {
    background: #b91c1c;
    color: #fff;
}

.lygs-chat-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lygs-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #111827;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s ease;
}

.lygs-action-button:hover {
    background: #111827;
    border-color: #111827;
    color: #fff;
}

/* Lead capture panel */

.lygs-chat-lead-panel {
    background: #fff;
    padding: 18px;
    border-top: 1px solid #e5e7eb;
    overflow-y: auto;
    max-height: 65%;
}

.lygs-lead-heading h3 {
    color: #111827;
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 5px;
}

.lygs-lead-heading p {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 16px;
}

#lygs-chat-lead-form {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

#lygs-chat-lead-form > label:not(.lygs-lead-consent) {
    font-size: 11px;
    font-weight: 700;
    color: #374151;
}

#lygs-chat-lead-form input:not([type="checkbox"]),
#lygs-chat-lead-form select,
#lygs-chat-lead-form textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
    color: #111827;
    font-size: 13px;
    outline: none;
}

#lygs-chat-lead-form input:focus,
#lygs-chat-lead-form select:focus,
#lygs-chat-lead-form textarea:focus {
    border-color: #dc2626;
}

.lygs-lead-consent {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 11px;
    line-height: 1.6;
    color: #4b5563;
    margin-top: 5px;
}

.lygs-lead-consent input {
    margin-top: 3px;
    accent-color: #dc2626;
}

.lygs-lead-footer {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.lygs-lead-footer button {
    flex: 1;
    border-radius: 8px;
    padding: 11px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.lygs-lead-cancel {
    background: #f3f4f6;
    color: #111827;
}

.lygs-lead-submit {
    background: #dc2626;
    color: #fff;
}

.lygs-lead-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
}

#lygs-lead-feedback {
    font-size: 12px;
    line-height: 1.5;
    color: #374151;
}

@media (max-width: 480px) {
    .lygs-chat-lead-panel {
        padding: 14px;
    }

    .lygs-chat-actions {
        gap: 6px;
    }

    .lygs-action-button {
        font-size: 11px;
    }
}






