/* AXTG Interactive Demo - Modern Chat Interface */

:root {
    --primary: #0088cc;
    --primary-dark: #006699;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1f2937;
    --light: #ffffff;
    --border: #e5e7eb;
    --bg: #f9fafb;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0088cc;
    min-height: 100vh;
    color: #333;
}

/* Header - Full Width Navbar */
.demo-header {
    background: white;
    width: 100%;
    padding: 0;
    margin: 0;
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    border-radius: 0 !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    overflow: visible;
}

.header-content {
    max-width: 1800px;
    margin: 0 auto;
    padding: 8px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: nowrap;
    width: 100%;
    position: relative;
}

.demo-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 24px;
    min-height: calc(100vh - 56px);
    background: transparent;
}

.logo {
    display: flex;
    align-items: center;
    height: 40px;
    flex-shrink: 0;
}

.logo-img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.header-content h1 {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-signup {
    padding: 8px 20px;
    background: #0088cc !important;
    color: white !important;
    border: none !important;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    white-space: nowrap;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    z-index: 10;
}

.btn-signup:hover {
    background: #006699 !important;
    transform: translate(-50%, calc(-50% - 1px));
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    color: white !important;
}

.btn-signup:active {
    transform: translate(-50%, -50%);
}

.btn-reset {
    padding: 6px 16px;
    background: var(--dark);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    white-space: nowrap;
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
}

.btn-reset:hover {
    background: #374151;
    transform: translateY(calc(-50% - 1px));
    box-shadow: var(--shadow-md);
}

/* Main Content Layout */
.demo-content {
    display: grid;
    grid-template-columns: 300px 1fr 350px;
    gap: 20px;
    height: calc(100vh - 104px);
    max-height: calc(100vh - 104px);
    min-height: 0;
    overflow: hidden;
}

/* Side Panels */
.side-panel {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    overflow-y: auto;
}

.side-panel h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.side-panel h3 {
    font-size: 14px;
    margin-top: 20px;
    margin-bottom: 12px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.activity-item {
    padding: 12px;
    background: var(--bg);
    border-radius: 10px;
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-left: 3px solid var(--primary);
    border: 1px solid var(--border);
    border-left-width: 3px;
    animation: activityItemSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), activityItemPulse 2s ease-in-out;
    transform-origin: center;
    position: relative;
    overflow: hidden;
}

.activity-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--primary);
    animation: activityItemGlow 1.5s ease-in-out;
}

@keyframes activityItemSlideIn {
    0% {
        opacity: 0;
        transform: translateX(100px) scale(0.8);
    }
    60% {
        transform: translateX(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes activityItemPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 136, 204, 0);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(0, 136, 204, 0.3);
    }
}

@keyframes activityItemGlow {
    0%, 100% {
        box-shadow: 0 0 5px var(--primary);
    }
    50% {
        box-shadow: 0 0 15px var(--primary), 0 0 25px var(--primary);
    }
}

.activity-item.funnel {
    border-left-color: var(--primary);
}

.activity-item.funnel::before {
    background: var(--primary);
    animation: activityItemGlow 1.5s ease-in-out;
}

.activity-item.analytics {
    border-left-color: var(--info);
}

.activity-item.analytics::before {
    background: var(--info);
    animation: activityItemGlow 1.5s ease-in-out;
}

.activity-item.purchase {
    border-left-color: var(--success);
}

.activity-item.purchase::before {
    background: var(--success);
    animation: activityItemGlow 1.5s ease-in-out;
}

.activity-item.ai {
    border-left-color: var(--warning);
}

.activity-item.ai::before {
    background: var(--warning);
    animation: activityItemGlow 1.5s ease-in-out;
}

.activity-item-new {
    background: linear-gradient(90deg, rgba(0, 136, 204, 0.1) 0%, var(--bg) 20%);
    animation: activityItemSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), activityItemPulse 2s ease-in-out, activityItemHighlight 0.6s ease-in-out;
}

@keyframes activityItemHighlight {
    0% {
        background-color: rgba(0, 136, 204, 0.2);
    }
    100% {
        background-color: var(--bg);
    }
}

@keyframes activityFeedShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-3px);
    }
    75% {
        transform: translateX(3px);
    }
}

.activity-item i {
    color: var(--primary);
    font-size: 20px;
    margin-top: 2px;
}

.activity-item strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

.activity-item p {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.activity-item:hover {
    background: rgba(0, 136, 204, 0.1);
}

/* Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.tag {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    animation: tagAdd 0.3s;
}

.tag-empty {
    font-size: 12px;
    color: #999;
    font-style: italic;
}

@keyframes tagAdd {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Analytics Mini */
.analytics-mini {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 2px 0;
}

.stat-row:hover {
    background: rgba(0, 136, 204, 0.1);
}

.stat-row strong {
    color: var(--primary);
    font-weight: 600;
}

/* Chat Container */
.chat-container {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    max-height: calc(100vh - 120px);
}

.chat-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    color: var(--dark);
}

.bot-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.bot-info {
    flex: 1;
}

.bot-info strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
}

.status {
    font-size: 12px;
    color: var(--success);
    font-weight: 500;
}

.status.online {
    color: var(--success);
}

.demo-badge {
    padding: 6px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--dark);
    font-weight: 500;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: #e3f2fd;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='15' height='15'%3E%3Cpath fill='%23eaeaea' d='M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm5.894 8.221l-1.97 9.28c-.145.658-.537.818-1.084.508l-3-2.21-1.446 1.394c-.14.18-.357.295-.6.295-.002 0-.003 0-.005 0l.213-3.054 5.56-5.022c.24-.213-.054-.334-.373-.12l-6.87 4.326-2.96-.924c-.64-.203-.658-.64.135-.954l11.566-4.458c.538-.196 1.006.128.832.941z'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 100px 100px;
    background-position: 0 0;
    background-attachment: local;
    position: relative;
    min-height: 0;
    opacity: 1;
}

.chat-messages > * {
    position: relative;
    z-index: 1;
}

.message {
    display: flex;
    gap: 12px;
    animation: messageSlide 0.3s;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-avatar {
    background: var(--success);
}

.message-content {
    flex: 1;
    max-width: 70%;
    min-width: 0; /* Allow content to shrink */
}

/* Bot messages - only take up space needed */
.message:not(.user-message) .message-content {
    flex: 0 0 auto;
    max-width: 70%;
    width: fit-content;
    display: flex;
    flex-direction: column;
}

.user-message .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.message-bubble {
    background: white;
    padding: 14px 18px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    line-height: 1.6;
    border: 1px solid var(--border);
    overflow: visible;
    word-wrap: break-word;
    width: fit-content;
    max-width: 100%;
}

.user-message .message-bubble {
    background: var(--primary);
    color: white;
    border: none;
}

.message-bubble p {
    margin-bottom: 8px;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

/* Message Images */
.message-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    min-height: 100px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    object-fit: contain;
    background: #f0f0f0;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}

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

.message-bubble.is-ai {
    border-left: 4px solid var(--warning);
}

/* Message Buttons (inline with message bubble) */
.message-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

.user-message .message-buttons {
    border-top-color: rgba(255,255,255,0.2);
}

.message-button {
    padding: 8px 16px;
    background: white;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    border-radius: 18px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    animation: buttonAppear 0.3s;
    flex-shrink: 0;
}

.user-message .message-button {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    color: white;
}

.message-button:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.user-message .message-button:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.7);
}

@keyframes buttonAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Chat Input */
.chat-input-container {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

#chat-input {
    flex: 1;
    padding: 12px 18px;
    border: 1.5px solid var(--border);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    background: white;
}

#chat-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.1);
}

#send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

#send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Results Dashboard */
.results-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.result-card {
    padding: 16px;
    background: var(--bg);
    border-radius: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.result-card:hover {
    transform: translateX(2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.result-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.result-icon.funnel {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.result-icon.cta {
    background: linear-gradient(135deg, var(--info), #0ea5e9);
}

.result-icon.purchase {
    background: linear-gradient(135deg, var(--success), #16a34a);
}

.result-icon.ai {
    background: linear-gradient(135deg, var(--warning), #eab308);
}

.result-content {
    flex: 1;
}

.result-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.result-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

/* Funnel Progress */
.funnel-progress {
    margin-top: 12px;
}

.funnel-step {
    padding: 12px;
    background: var(--bg);
    border-radius: 10px;
    margin-bottom: 8px;
    border-left: 3px solid var(--primary);
    animation: slideIn 0.3s;
    border: 1px solid var(--border);
    border-left-width: 3px;
}

.funnel-step.active {
    background: #e7f3ff;
    border-left-color: var(--success);
}

.funnel-step-name {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 4px;
}

.funnel-step-detail {
    font-size: 11px;
    color: #666;
}

.no-funnel {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
}

/* Conversion Funnel Visual */
.conversion-funnel {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.funnel-visual {
    margin-top: 12px;
}

.funnel-stage {
    margin-bottom: 16px;
}

.stage-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
}

.stage-bar {
    height: 32px;
    background: var(--primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: white;
    font-weight: 600;
    font-size: 13px;
    transition: width 0.5s ease;
    box-shadow: var(--shadow);
}

/* Start Overlay */
.start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.start-overlay.hidden {
    display: none;
}

.start-overlay-content {
    text-align: center;
    max-width: 500px;
    padding: 40px;
    animation: slideUp 0.4s;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.start-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    height: 120px;
}

.start-logo-img {
    height: 100%;
    width: auto;
    max-width: 400px;
    object-fit: contain;
}

.start-overlay-content h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.start-overlay-content p {
    font-size: 18px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 40px;
}

/* Demo Selection Options */
.demo-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.demo-option-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    width: 100%;
}

.demo-option-btn:hover:not(:disabled) {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.15);
    transform: translateY(-2px);
}

.demo-option-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.demo-option-btn.crypto {
    border-color: var(--primary);
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
}

.demo-option-btn.crypto:hover {
    border-color: var(--primary-dark);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.2);
}

.demo-option-btn i {
    font-size: 32px;
    color: var(--primary);
    min-width: 40px;
}

.demo-option-btn div {
    flex: 1;
}

.demo-option-btn strong {
    display: block;
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 4px;
}

.demo-option-btn span {
    display: block;
    font-size: 14px;
    color: #666;
}

/* Analytics Preview in Popup */
.analytics-preview {
    margin-top: 20px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.analytics-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.analytics-row:last-child {
    border-bottom: none;
}

.analytics-row span {
    color: #666;
    font-size: 14px;
}

.analytics-row strong {
    color: var(--dark);
    font-size: 14px;
    font-weight: 600;
}

.start-button {
    padding: 18px 48px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
}

.start-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
}

.start-button:active {
    transform: translateY(0);
}

.start-button i {
    font-size: 20px;
}

/* Popup Modal */
.popup-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}

.popup-modal.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.popup-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: popupSlide 0.3s;
    overflow: hidden !important;
    overflow-y: hidden !important;
    overflow-x: hidden !important;
    max-height: none !important;
    height: auto !important;
}

.popup-content.analytics-modal {
    max-width: 100vw !important;
    width: 100vw !important;
    max-height: 100vh !important;
    height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.popup-content.wide-modal {
    max-width: 900px !important;
    width: 90% !important;
}

.popup-content #popup-text.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    column-gap: 40px;
}

.popup-content #popup-text.two-column > * {
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.popup-content.analytics-modal #popup-text {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: left !important;
}

.popup-content.analytics-modal .popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.popup-content.analytics-modal .popup-close:hover {
    background: rgba(0, 0, 0, 0.7);
    color: white;
}

.popup-content.analytics-modal .popup-continue {
    position: sticky;
    bottom: 0;
    margin-top: 20px;
    margin-left: 20px;
    margin-right: 20px;
    margin-bottom: 20px;
}

@keyframes popupSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.popup-close:hover {
    background: var(--light);
    color: var(--dark);
}

.popup-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    margin: 0 auto 20px;
    background: var(--primary);
}

.popup-icon.funnel {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.popup-icon.analytics {
    background: linear-gradient(135deg, var(--info), #0ea5e9);
}

.popup-icon.purchase {
    background: linear-gradient(135deg, var(--success), #16a34a);
}

.popup-icon.ai {
    background: linear-gradient(135deg, var(--warning), #eab308);
}

.popup-content h3 {
    font-size: 20px;
    margin-bottom: 12px;
    text-align: center;
    color: var(--dark);
}

.popup-content p,
.popup-content #popup-text {
    line-height: 1.6;
    color: #666;
    text-align: center;
    margin-bottom: 24px;
}

.popup-content #popup-text {
    text-align: left;
}

.popup-continue {
    width: 100%;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.popup-continue:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.popup-continue:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 1400px) {
    .demo-content {
        grid-template-columns: 280px 1fr 320px;
    }
}

@media (max-width: 1200px) {
    .demo-content {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .side-panel {
        height: auto;
        max-height: 400px;
    }
    
    .chat-container {
        min-height: 600px;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    /* Header */
    .demo-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        transition: transform 0.3s ease-in-out;
    }
    
    .demo-header.hidden {
        transform: translateY(-100%);
    }
    
    .header-content {
        padding: 10px 12px;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        min-height: 50px;
        gap: 8px;
    }
    
    .logo {
        height: 28px;
        flex-shrink: 0;
        order: 0;
    }
    
    .btn-signup {
        position: static !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        order: 0;
        flex: 0 0 auto;
        font-size: 11px !important;
        padding: 6px 10px !important;
        margin: 0 !important;
        white-space: nowrap;
    }
    
    .btn-reset {
        position: static !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        order: 0;
        flex: 0 0 auto;
        font-size: 11px !important;
        padding: 6px 10px !important;
        margin: 0 !important;
        white-space: nowrap;
    }
    
    /* Main Container */
    .demo-container {
        padding: 0;
        height: 100vh;
        overflow: hidden;
    }
    
    /* Content Grid - Snap Scroll Container on Mobile */
    .demo-content {
        display: flex;
        flex-direction: column;
        gap: 0;
        height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        scroll-snap-type: y mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        position: relative;
        padding-top: 56px; /* Account for navbar */
    }
    
    /* Side Panels - Full Screen Snap Sections */
    .side-panel {
        flex: 0 0 100vh;
        width: 100%;
        padding: 60px 16px 80px;
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        position: relative;
        box-shadow: none;
        border: none;
    }
    
    .left-panel {
        order: 1;
    }
    
    .chat-container {
        order: 2;
    }
    
    .right-panel {
        order: 3;
    }
    
    .side-panel h2 {
        font-size: 15px;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }
    
    .side-panel h3 {
        font-size: 12px;
        margin-top: 12px;
        margin-bottom: 8px;
    }
    
    /* Chat Container - Full Screen Snap Section */
    .chat-container {
        flex: 0 0 100vh;
        width: 100%;
        height: 100vh;
        min-height: 100vh;
        max-height: 100vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        position: relative;
        border-radius: 0;
        box-shadow: none;
        border: none;
        order: 2;
        box-sizing: border-box;
    }
    
    .chat-header {
        padding: 10px 12px;
        flex-wrap: nowrap;
        flex-shrink: 0;
        flex-grow: 0;
        height: auto;
        min-height: auto;
        max-height: none;
        border-bottom: 1px solid var(--border);
        background: white;
        display: flex;
        align-items: center;
    }
    
    .bot-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .bot-info {
        flex: 1;
        min-width: 0;
    }
    
    .bot-info strong {
        font-size: 13px;
    }
    
    .status {
        font-size: 10px;
    }
    
    .demo-badge {
        padding: 3px 6px;
        font-size: 9px;
        display: none;
    }
    
    /* Chat Messages */
    .chat-messages {
        padding: 12px;
        gap: 12px;
        background-size: 80px 80px;
        flex: 1 1 auto;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
        max-height: none;
    }
    
    .message {
        gap: 8px;
    }
    
    .message-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .message-content {
        max-width: 85%;
        min-width: 0;
    }
    
    .message-bubble {
        padding: 10px 12px;
        border-radius: 10px;
        font-size: 14px;
    }
    
    .message-bubble p {
        margin-bottom: 4px;
        font-size: 14px;
        line-height: 1.5;
    }
    
    .message-time {
        font-size: 9px;
    }
    
    /* Chat Input */
    .chat-input-container {
        padding: 10px 12px;
        gap: 8px;
        flex-shrink: 0;
        flex-grow: 0;
        border-top: 1px solid var(--border);
        background: white;
        height: auto;
        min-height: auto;
        max-height: none;
        display: flex;
        align-items: center;
    }
    
    #chat-input {
        padding: 10px 14px;
        font-size: 16px;
        border-radius: 20px;
        -webkit-appearance: none;
    }
    
    #send-btn {
        width: 44px;
        height: 44px;
        font-size: 16px;
        min-width: 44px;
        flex-shrink: 0;
    }
    
    /* Activity Items */
    .activity-item {
        padding: 10px;
        gap: 10px;
    }
    
    .activity-item i {
        font-size: 16px;
    }
    
    .activity-item strong {
        font-size: 12px;
    }
    
    .activity-item p {
        font-size: 11px;
    }
    
    /* Tags */
    .tag {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    /* Stats */
    .stat-row {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    /* Result Cards */
    .result-card {
        padding: 12px;
        gap: 10px;
    }
    
    .result-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .result-label {
        font-size: 11px;
    }
    
    .result-value {
        font-size: 18px;
    }
    
    /* ALL Modals - Full Screen on Mobile */
    .popup-modal {
        align-items: flex-start !important;
        justify-content: flex-start !important;
        padding: 0 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 10000 !important;
    }
    
    .popup-modal.show {
        display: flex !important;
    }
    
    /* Prevent body scroll when modal is open */
    body.modal-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    .popup-content {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        padding: 20px !important;
        margin: 0 !important;
        border-radius: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
    }
    
    .popup-content.analytics-modal {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        margin: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    
    .popup-content.wide-modal {
        width: 100vw !important;
        max-width: 100vw !important;
    }
    
    .popup-content #popup-text.two-column {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .popup-content h3 {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .popup-content p,
    .popup-content #popup-text {
        font-size: 14px;
        line-height: 1.6;
        flex: 1;
        overflow-y: auto;
    }
    
    .popup-continue {
        padding: 14px 20px;
        font-size: 16px;
        margin-top: auto;
        flex-shrink: 0;
    }
    
    .popup-close {
        position: fixed;
        top: 10px;
        right: 10px;
        z-index: 1001;
        background: rgba(0, 0, 0, 0.5);
        color: white;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
    
    /* Start Overlay */
    .start-overlay-content {
        padding: 20px;
        width: 100%;
        max-width: 100%;
    }
    
    .start-logo {
        height: 60px;
        margin-bottom: 16px;
    }
    
    .start-overlay-content p {
        font-size: 14px;
        margin-bottom: 24px;
    }
    
    .demo-option-btn {
        padding: 14px 16px;
        gap: 12px;
    }
    
    .demo-option-btn i {
        font-size: 20px;
        min-width: 28px;
    }
    
    .demo-option-btn strong {
        font-size: 15px;
    }
    
    .demo-option-btn span {
        font-size: 12px;
    }
    
    /* Message Buttons */
    .message-button {
        padding: 8px 14px;
        font-size: 12px;
        border-radius: 16px;
        min-height: 36px;
    }
    
    /* Funnel Progress */
    .funnel-step {
        padding: 10px;
        font-size: 12px;
    }
    
    .stage-bar {
        height: 28px;
        font-size: 12px;
        padding: 0 10px;
    }
    
    /* Scroll Hint for First Modal */
    .scroll-hint {
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 10001;
        opacity: 0;
        transition: opacity 0.3s;
        pointer-events: none;
    }
    
    .scroll-hint.show {
        opacity: 1;
        animation: scrollHintBounce 2s infinite;
    }
    
    .scroll-hint-content {
        background: rgba(0, 136, 204, 0.95);
        color: white !important;
        padding: 12px 20px;
        border-radius: 25px;
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
        font-weight: 600;
        box-shadow: 0 4px 12px rgba(0,0,0,0.4);
        border: 2px solid rgba(255,255,255,0.3);
    }
    
    .scroll-hint-content p {
        color: white !important;
        margin: 0;
        font-weight: 600;
    }
    
    .scroll-hint-content i {
        font-size: 16px;
        color: white !important;
    }
    
    @keyframes scrollHintBounce {
        0%, 100% {
            transform: translateX(-50%) translateY(0);
        }
        50% {
            transform: translateX(-50%) translateY(-8px);
        }
    }
    
    /* Scroll Hint Overlays */
    .scroll-hint-overlay {
        position: fixed;
        left: 0;
        right: 0;
        z-index: 9999;
        background: rgba(0, 0, 0, 0.85);
        color: white;
        padding: 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        animation: overlaySlideIn 0.3s ease-out;
    }
    
    .scroll-hint-overlay.top {
        top: 0;
        border-bottom: 3px solid rgba(0, 136, 204, 0.5);
    }
    
    .scroll-hint-overlay.bottom {
        bottom: 0;
        border-top: 3px solid rgba(0, 136, 204, 0.5);
    }
    
    .scroll-hint-overlay.hidden {
        display: none;
    }
    
    .scroll-hint-content-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        text-align: center;
    }
    
    .scroll-hint-icon {
        font-size: 32px;
        color: #0088cc;
        animation: scrollHintBounce 2s infinite;
    }
    
    .scroll-hint-text {
        font-size: 16px;
        font-weight: 600;
        color: white;
        margin: 0;
    }
    
    .scroll-hint-ok-btn {
        background: #0088cc;
        color: white;
        border: none;
        padding: 10px 30px;
        border-radius: 25px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
    
    .scroll-hint-ok-btn:hover {
        background: #006699;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    }
    
    .scroll-hint-ok-btn:active {
        transform: translateY(0);
    }
    
    @keyframes overlaySlideIn {
        from {
            opacity: 0;
            transform: translateY(-100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    @keyframes overlaySlideInBottom {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
