/* Public ChatGenius Demo */
.cg-demo-section {
    position: relative;
    z-index: 1;
    padding: 4.25rem 0;
    overflow: hidden;
}

.cg-demo-section::before {
    content: '';
    position: absolute;
    inset: 6% auto auto 50%;
    width: min(760px, 80vw);
    height: min(760px, 80vw);
    background:
        radial-gradient(circle at 30% 30%, rgba(59, 130, 246, 0.22), transparent 36%),
        radial-gradient(circle at 70% 55%, rgba(80, 70, 229, 0.2), transparent 42%);
    transform: translateX(-50%);
    filter: blur(18px);
    pointer-events: none;
    opacity: 0.85;
}

.cg-demo-shell {
    position: relative;
    display: block;
    margin-top: 2rem;
}

.cg-demo-picker,
.cg-demo-phone,
.cg-demo-intel {
    background: rgba(7, 7, 10, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.cg-demo-picker {
    align-self: start;
    border-radius: 24px;
    padding: 0.9rem;
    margin-bottom: 1rem;
}

.cg-demo-picker-label {
    margin: 0 0 0.7rem;
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.cg-demo-profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.cg-demo-profile {
    width: 100%;
    text-align: left;
    padding: 0.9rem 1rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.cg-demo-profile:hover,
.cg-demo-profile.active {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.48);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(255, 255, 255, 0.045));
}

.cg-demo-profile span {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 700;
}

.cg-demo-profile small {
    display: block;
    color: rgba(255, 255, 255, 0.56);
    line-height: 1.45;
    font-size: 0.86rem;
}

.cg-demo-stage {
    display: grid;
    grid-template-columns: minmax(480px, 1.18fr) minmax(340px, 0.78fr);
    gap: 1rem;
    align-items: stretch;
}

.cg-demo-phone {
    min-height: 560px;
    border-radius: 28px;
    padding: 0.75rem;
}

.cg-demo-screen {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    overflow: hidden;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 42%),
        #050507;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cg-demo-chat-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cg-demo-avatar {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, #3B82F6, #5046E5);
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.35);
}

.cg-demo-business {
    color: #fff;
    font-weight: 700;
    line-height: 1.2;
}

.cg-demo-channel {
    margin-top: 0.15rem;
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.82rem;
}

.cg-demo-live {
    margin-left: auto;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cg-demo-messages {
    flex: 1;
    max-height: 330px;
    min-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.cg-demo-message {
    display: flex;
    margin-bottom: 0.8rem;
}

.cg-demo-message.user {
    justify-content: flex-end;
}

.cg-demo-bubble {
    max-width: 82%;
    padding: 0.72rem 0.85rem;
    border-radius: 18px;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.45;
    font-size: 0.94rem;
}

.cg-demo-message.assistant .cg-demo-bubble {
    border-bottom-left-radius: 6px;
    background: rgba(255, 255, 255, 0.09);
}

.cg-demo-message.user .cg-demo-bubble {
    border-bottom-right-radius: 6px;
    background: linear-gradient(135deg, #3B82F6, #5046E5);
    box-shadow: 0 10px 28px rgba(59, 130, 246, 0.22);
}

.cg-demo-typing {
    display: inline-flex;
    gap: 0.28rem;
    align-items: center;
    padding: 0.85rem 1rem;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    background: rgba(255, 255, 255, 0.09);
}

.cg-demo-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.65);
    animation: cgDemoTyping 0.9s infinite ease-in-out;
}

.cg-demo-typing span:nth-child(2) { animation-delay: 0.12s; }
.cg-demo-typing span:nth-child(3) { animation-delay: 0.24s; }

@keyframes cgDemoTyping {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.42; }
    40% { transform: translateY(-4px); opacity: 1; }
}

.cg-demo-examples {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0 1rem 0.65rem;
}

.cg-demo-example {
    flex: 0 0 auto;
    padding: 0.48rem 0.7rem;
    color: rgba(255, 255, 255, 0.74);
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    font-size: 0.78rem;
    cursor: pointer;
}

.cg-demo-form {
    display: flex;
    gap: 0.6rem;
    padding: 0.8rem 1rem 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cg-demo-form input[type="text"] {
    min-width: 0;
    flex: 1;
    padding: 0.85rem 0.95rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    outline: none;
}

.cg-demo-form input[aria-hidden="true"] {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    flex: 0 0 auto !important;
}

.cg-demo-form input[type="text"]:focus {
    border-color: rgba(59, 130, 246, 0.65);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.cg-demo-form input.over-limit {
    border-color: rgba(239, 68, 68, 0.8);
}

.cg-demo-send {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    color: #000;
    background: #fff;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.cg-demo-send:hover {
    transform: translateY(-1px);
}

.cg-demo-send:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.cg-demo-intel {
    border-radius: 24px;
    padding: 1rem;
}

.cg-demo-intel h3 {
    margin: 0 0 0.35rem;
    color: #fff;
    font-size: 1.1rem;
}

.cg-demo-intel-subtitle {
    margin: 0 0 0.9rem;
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.9rem;
    line-height: 1.5;
}

.cg-demo-signal-list {
    display: grid;
    gap: 0.6rem;
}

.cg-demo-signal {
    padding: 0.72rem 0.8rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.075);
}

.cg-demo-signal span {
    display: block;
    margin-bottom: 0.3rem;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.cg-demo-signal strong {
    display: block;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.94rem;
    line-height: 1.35;
}

.cg-demo-note,
.cg-demo-limit {
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.78rem;
    line-height: 1.45;
}

.cg-demo-note {
    margin: 0.8rem 0 0;
}

.cg-demo-limit {
    margin: 0.65rem 0 0;
}

.cg-demo-cta {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(80, 70, 229, 0.18));
    border: 1px solid rgba(59, 130, 246, 0.24);
}

.cg-demo-cta h4 {
    margin: 0 0 0.4rem;
    color: #fff;
}

.cg-demo-cta p {
    margin: 0 0 0.85rem;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.88rem;
    line-height: 1.5;
}

.cg-demo-cta a {
    display: inline-flex;
    padding: 0.7rem 1rem;
    color: #000;
    background: #fff;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 1100px) {
    .cg-demo-stage {
        grid-template-columns: 1fr;
    }

    .cg-demo-profile-grid {
        grid-template-columns: 1fr;
    }

    .cg-demo-phone {
        min-height: 540px;
    }
}

@media (max-width: 768px) {
    .cg-demo-section {
        padding: 3.5rem 0;
    }

    .cg-demo-shell {
        margin-top: 2rem;
    }

    .cg-demo-picker,
    .cg-demo-phone,
    .cg-demo-intel {
        border-radius: 22px;
    }

    .cg-demo-phone {
        min-height: 520px;
        padding: 0.55rem;
    }

    .cg-demo-messages {
        min-height: 300px;
        max-height: 340px;
    }

    .cg-demo-bubble {
        max-width: 88%;
        font-size: 0.9rem;
    }
}
