/* Live demo: avatar, chat, call button and calendar (homepage, Thomas and Marcus pages) */

/* ── LIVE DEMO ── */
#demo { background: #111318; }

.demo-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    gap: 45px;
    align-items: center;
}

.demo-text { flex: 1; }
.demo-text h3 { font-size: 28px; color: #eee; margin-bottom: 14px; font-weight: 200; }
.demo-text p { color: #888; font-size: 14px; line-height: 1.8; margin-bottom: 18px; }
.demo-text ul { list-style: none; margin-bottom: 20px; }
.demo-text ul li { padding: 5px 0; color: #999; font-size: 13px; }
.demo-text ul li::before { content: "\2713  "; color: #7edbd0; font-weight: bold; }

/* ── INLINE DEMO AVATAR ── */
.demo-avatar-area {
    flex: 0 0 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    perspective: 1000px;
    min-height: 460px;
}

.demo-flip-container {
    width: 240px; height: 240px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.85s ease-in-out, width 0.85s ease-in-out, height 0.85s ease-in-out, margin-top 0.85s ease-in-out;
    margin-top: 120px;
}
.demo-flip-container.flipped {
    width: 336px; height: 416px;
    transform: rotateX(180deg);
    margin-top: 0;
}

.demo-bubble, .demo-chat-window {
    position: absolute;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.demo-bubble {
    width: 240px; height: 240px;
    background: linear-gradient(135deg, #7edbd0, #6bcbc2);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(126,219,208,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    transition: transform 0.3s ease, opacity 0.4s ease;
}
.demo-bubble:hover { transform: scale(1.05); }
.demo-bubble.idle-bounce { animation: gentleBounce 2s ease-in-out infinite; }
.demo-bubble.faded-out { opacity: 0; }
.demo-bubble.fading-in { opacity: 1; }

.demo-bubble video {
    width: 228px; height: 228px;
    border-radius: 50%;
    object-fit: cover;
}

@keyframes gentleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.demo-green-dot {
    position: absolute;
    top: 8px; right: 8px;
    width: 22px; height: 22px;
    background: #7edbd0;
    border-radius: 50%;
    border: 3px solid white;
    animation: pulseNotif 2s infinite;
}

@keyframes pulseNotif {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(126,219,208,0.7); }
    50% { transform: scale(1.2); box-shadow: 0 0 0 10px rgba(126,219,208,0); }
}

.online-indicator {
    display: inline-block;
    width: 8px; height: 8px;
    background: #2a8a7e;
    border-radius: 50%;
    margin-right: 5px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(42,138,126,0.7); opacity: 1; }
    50% { box-shadow: 0 0 0 4px rgba(42,138,126,0); opacity: 0.7; }
}

.demo-chat-window {
    width: 336px; height: 416px;
    background: #161a22;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(126,219,208,0.25);
    transform: rotateX(180deg);
    top: 0; left: 0;
}

.demo-chat-header {
    background: linear-gradient(135deg, #6bcbc2, #7edbd0);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.demo-chat-header-info { display: flex; align-items: center; gap: 10px; }
.demo-chat-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    object-fit: cover;
}
.demo-chat-close {
    background: transparent;
    border: none;
    color: #0c0e13;
    font-size: 22px;
    cursor: pointer;
    font-weight: bold;
}

.demo-chat-messages {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    background: #0e1016;
}

.demo-chat-msg {
    white-space: pre-wrap;
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 10px;
    max-width: 85%;
    font-size: 13px;
    line-height: 1.5;
    color: #ccc;
}
.demo-chat-msg.bot { background: rgba(126,219,208,0.08); }
.demo-chat-msg.user { background: rgba(126,219,208,0.2); margin-left: auto; }

.demo-chat-input-area {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid rgba(126,219,208,0.1);
}
.demo-chat-input-area input {
    flex: 1;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(126,219,208,0.15);
    border-radius: 20px;
    padding: 10px 16px;
    color: #ccc;
    font-size: 13px;
    outline: none;
    -webkit-user-select: text;
    user-select: text;
}
.demo-chat-input-area input::placeholder { color: #555; }
.demo-chat-input-area input:focus { border-color: #7edbd0; }
.demo-chat-input-area button {
    background: linear-gradient(135deg, #7edbd0, #6bcbc2);
    border: none;
    width: 38px; height: 38px;
    border-radius: 50%;
    cursor: pointer;
    color: #0c0e13;
    font-size: 15px;
    font-weight: bold;
    transition: all 0.3s;
}
.demo-chat-input-area button:hover { background: linear-gradient(135deg, #a0e8df, #7edbd0); }

@keyframes typingDot {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

/* Chat / call buttons under Clara */
.demo-actions { display: flex; gap: 12px; margin-top: 22px; }
.demo-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 24px;
    white-space: nowrap;
    border: 1px solid rgba(126,219,208,0.4);
    background: transparent;
    color: #7edbd0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.demo-action svg { width: 18px; height: 18px; fill: currentColor; }
.demo-action:hover { background: rgba(126,219,208,0.08); border-color: #7edbd0; }
.demo-action.primary { background: linear-gradient(135deg, #7edbd0, #6bcbc2); color: #0c0e13; border-color: transparent; }
.demo-action.primary:hover { background: linear-gradient(135deg, #a0e8df, #7edbd0); }
.demo-action.in-call { background: #d93025; color: #fff; border-color: transparent; }
.demo-action.in-call:hover { background: #b3261e; }
.demo-action:disabled { opacity: 0.6; cursor: wait; }
.demo-call-note { display: none; margin-top: 10px; font-size: 13px; color: #7edbd0; text-align: center; max-width: 320px; }
.demo-call-note.show { display: block; }
.demo-phone-badge {
    position: absolute;
    bottom: 10px; left: 10px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #0c0e13;
    border: 3px solid #7edbd0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.demo-phone-badge svg { width: 20px; height: 20px; fill: #7edbd0; }

.demo-hint {
    margin-top: 18px;
    color: #7edbd0;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    animation: leadHintPulse 2s ease-in-out infinite;
}
@keyframes leadHintPulse { 0%, 100% { opacity: 0.85; } 50% { opacity: 0.5; } }

/* ── DEMO CALENDAR (looks like Google Calendar) ── */
.cal {
    max-width: 900px;
    margin: 40px auto 0;
    background: #fff;
    color: #3c4043;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.35);
    overflow: hidden;
    font-size: 13px;
}
.cal-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #dadce0;
}
.cal-title { display: flex; align-items: center; gap: 12px; font-size: 18px; color: #3c4043; }
.cal-icon {
    width: 30px; height: 32px;
    border: 2px solid #1a73e8;
    border-top-width: 7px;
    border-radius: 4px;
    color: #1a73e8;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cal-live { display: flex; align-items: center; gap: 7px; color: #188038; font-weight: 600; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.cal-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #34a853; animation: pulse 2s ease-in-out infinite; }
.cal-body { display: flex; }
.cal-scroll { flex: 1; overflow-x: auto; }
.cal-grid { display: grid; grid-template-columns: 74px repeat(5, minmax(96px, 1fr)); min-width: 560px; }
.cal-head { padding: 10px 6px; text-align: center; border-bottom: 1px solid #dadce0; border-left: 1px solid #dadce0; }
.cal-head-day { font-size: 11px; color: #70757a; text-transform: uppercase; letter-spacing: 0.8px; }
.cal-head-date { font-size: 22px; color: #3c4043; }
.cal-time { padding: 6px 8px 0 0; text-align: right; font-size: 10px; color: #70757a; border-bottom: 1px solid #f1f3f4; }
.cal-cell { height: 62px; padding: 3px; border-left: 1px solid #dadce0; border-bottom: 1px solid #f1f3f4; }
.cal-event {
    height: 100%;
    border-radius: 5px;
    padding: 4px 7px;
    color: #fff;
    font-size: 11px;
    line-height: 1.35;
    overflow: hidden;
    background: #039be5;
}
.cal-event b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event.mine { background: #0b8043; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0b8043; animation: leadPop 0.5s ease-out; }
@keyframes leadPop { 0% { transform: scale(0.8); opacity: 0; } 50% { transform: scale(1.05); } 100% { transform: scale(1); opacity: 1; } }
.cal-details { width: 250px; flex-shrink: 0; border-left: 1px solid #dadce0; padding: 16px 18px; background: #f8f9fa; }
.cal-details h4 { font-size: 13px; font-weight: 600; color: #3c4043; margin-bottom: 4px; }
.cal-details-sub { font-size: 11px; color: #70757a; margin-bottom: 12px; }
.cal-field { padding: 7px 0; border-bottom: 1px solid #e8eaed; opacity: 0.45; transition: opacity 0.5s; }
.cal-field.captured { opacity: 1; }
.cal-field-label { font-size: 10px; color: #70757a; text-transform: uppercase; letter-spacing: 0.8px; }
.cal-field-value { font-size: 13px; color: #3c4043; word-break: break-word; }
.cal-field.captured .cal-field-value { color: #0b8043; font-weight: 500; animation: leadPop 0.4s ease-out; }
.cal-alert { display: none; margin-top: 12px; padding: 9px 11px; border-radius: 6px; background: #fce8e6; color: #c5221f; font-size: 12px; font-weight: 600; }
.cal-alert.show { display: block; }
.cal-note { padding: 9px 20px; font-size: 11px; color: #70757a; border-top: 1px solid #dadce0; text-align: center; }

/* Light mode */
body.light-mode #demo { background: #f0f1f3; }
body.light-mode .demo-text h3 { color: #333; }
body.light-mode .demo-text p { color: #666; }
body.light-mode .demo-text ul li { color: #555; }
body.light-mode .demo-hint { color: #4aa89e; }
body.light-mode .demo-action { color: #4aa89e; border-color: #4aa89e; }
body.light-mode .demo-action.primary { background: linear-gradient(135deg, #4aa89e, #2d7a94); color: #fff; }
body.light-mode .demo-phone-badge { background: #fff; border-color: #4aa89e; }
body.light-mode .demo-phone-badge svg { fill: #4aa89e; }
body.light-mode .cal { box-shadow: 0 10px 40px rgba(0,0,0,0.12); }
body.light-mode .demo-chat-window { background: #fff; border-color: #ddd; }
body.light-mode .demo-chat-header { background: linear-gradient(135deg, #4aa89e, #7edbd0); }
body.light-mode .demo-chat-messages { background: #f7f7f7; }
body.light-mode .demo-chat-msg.user { background: #4aa89e; color: #fff; }
body.light-mode .demo-chat-msg.bot { background: #e5e5e5; color: #333; }
body.light-mode .demo-chat-input-area { border-top-color: #e0e0e0; }
body.light-mode .demo-chat-input-area input { background: #fff; border-color: #ddd; color: #333; }
body.light-mode .demo-chat-input-area button { background: linear-gradient(135deg, #4aa89e, #2d7a94); }

@media (max-width: 768px) {
    .demo-container { flex-direction: column; }
    .demo-avatar-area { flex: none; width: 100%; display: flex; flex-direction: column; align-items: center; min-height: auto; }
    .demo-flip-container { width: 210px; height: 210px; }
    .demo-flip-container.flipped { width: 100%; max-width: 336px; height: 400px; }
    .demo-bubble { width: 210px; height: 210px; }
    .demo-bubble video { width: 198px; height: 198px; }
    .demo-chat-window { width: 100%; max-width: 336px; height: 400px; }

    .cal-body { flex-direction: column; }
    .cal-details { width: auto; border-left: none; border-top: 1px solid #dadce0; }
    .cal-title { font-size: 15px; }
}

/* "You're contacting…" box: tells visitors which pretend business they are testing */
.demo-scenario {
    margin-bottom: 22px;
    padding: 16px 18px;
    border-radius: 10px;
    background: rgba(126,219,208,0.06);
    border: 1px solid rgba(126,219,208,0.25);
}
.demo-scenario-label { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: #7edbd0; font-weight: 600; }
.demo-scenario-biz { font-size: 19px; color: #eee; margin: 2px 0; }
.demo-scenario-kind { font-size: 12px; color: #888; margin-bottom: 12px; }
.demo-text ul.demo-scenario-tries { margin: 4px 0 0; }
.demo-text ul.demo-scenario-tries li { padding: 3px 0; color: #bbb; font-style: italic; }
.demo-text ul.demo-scenario-tries li::before { content: ""; }
body.light-mode .demo-scenario { background: rgba(58,143,170,0.06); border-color: rgba(58,143,170,0.25); }
body.light-mode .demo-scenario-label { color: #4aa89e; }
body.light-mode .demo-scenario-biz { color: #222; }
body.light-mode .demo-text ul.demo-scenario-tries li { color: #555; }

/* Demo phone number under the Chat/Call buttons (homepage): two centered lines, one line each */
.demo-phone-line { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; width: max-content; max-width: 100vw; }
.demo-phone-number { font-size: 14px; color: #999; white-space: nowrap; }
.demo-phone-number a { color: #e8e8e8; font-weight: 600; letter-spacing: 0.5px; text-decoration: none; margin-left: 4px; }
.demo-phone-number a:hover { color: #7edbd0; }
.demo-phone-note { font-size: 11px; color: #777; white-space: nowrap; }
body.light-mode .demo-phone-number { color: #666; }
body.light-mode .demo-phone-number a { color: #222; }
body.light-mode .demo-phone-number a:hover { color: #4aa89e; }
body.light-mode .demo-phone-note { color: #888; }
.demo-phone-own { color: #e8e8e8; font-weight: 600; margin-left: 4px; }
.demo-phone-note a { color: #aaa; text-decoration: none; border-bottom: 1px dotted #777; }
.demo-phone-note a strong { color: #e8e8e8; font-weight: 600; }
.demo-phone-note a:hover, .demo-phone-note a:hover strong { color: #7edbd0; border-color: #7edbd0; }
body.light-mode .demo-phone-own { color: #222; }
body.light-mode .demo-phone-note a { color: #555; border-color: #aaa; }
body.light-mode .demo-phone-note a strong { color: #222; }
body.light-mode .demo-phone-note a:hover, body.light-mode .demo-phone-note a:hover strong { color: #4aa89e; border-color: #4aa89e; }
@media (max-width: 480px) { .demo-phone-note { white-space: normal; text-align: center; max-width: 300px; } }
