:root {
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
    
    /* Light Mode Colors */
    --background-light: #f2f2f7;
    --text-light: rgba(0, 0, 0, 0.8);
    --primary-light: #007aff;
    --card-background-light: #ffffff;
    --border-light: rgba(0, 0, 0, 0.1);

    /* Dark Mode Colors */
    --background-dark: #1c1c1e;
    --text-dark: rgba(255, 255, 255, 0.85);
    --primary-dark: #0a84ff;
    --card-background-dark: rgba(255, 255, 255, 0.08);
    --border-dark: rgba(255, 255, 255, 0.15);

    --radius: 12px;
}

body {
    font-family: var(--font-sans);
}

.dark body {
    color: var(--text-dark);
}

body {
    color: var(--text-light);
}

.aurora-background {
    background-color: transparent;
    transition: background-color 0.3s ease, background-image 0.3s ease;
}

.dark .aurora-background {
    background-color: #1A1A1D;
    background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(74, 0, 224, 0.3), transparent),
        radial-gradient(ellipse 80% 50% at 50% 120%, rgba(142, 45, 226, 0.3), transparent);
}

/* --- Demo Stage & Animation --- */
#demo-stage {
    perspective: 1000px;
    /* overflow: hidden; Removed to prevent clipping of popups */
}

/* Toolbar Mobile & Backdrop Support */
#demo-toolbar {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    z-index: 9999 !important; /* Ensure it's on top of everything */
}

/* Ensure demo text never wraps on mobile to match highlight layer */
.demo-line {
    white-space: nowrap;
}

/* Cursor Blink Animation */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.animate-blink {
    animation: blink 1s step-end infinite;
}

/* Toolbar Button Active State */
.demo-action-btn.active {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--primary-light);
}

.dark .demo-action-btn.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--primary-dark);
}

/* Click Ripple Effect */
.demo-action-btn:active {
    transform: scale(0.95);
}

/* AI Bubble Typing Cursor */
.typing-cursor::after {
    content: '|';
    animation: blink 1s step-end infinite;
    margin-left: 2px;
    color: var(--primary-light);
}

.dark .typing-cursor::after {
    color: var(--primary-dark);
}

/* Highlight Layer for Text Selection Simulation */
.demo-highlight-layer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background-color: var(--primary-light);
    color: white;
    overflow: hidden;
    white-space: nowrap;
    border-radius: 0; /* No rounded corners for selection */
    pointer-events: none;
    z-index: 10;
}

.dark .demo-highlight-layer {
    background-color: var(--primary-dark);
    color: white;
}

/* Transitions */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}