/* aibadger/demo-ui.css */
:root {
    --demo-bg-color: #050505;
    --term-bg: rgba(30, 30, 30, 0.95);
    --browser-bg: #ffffff;
    --demo-header-bg: rgba(255, 255, 255, 0.1);
    --demo-text-color: #e0e0e0;
    --demo-accent-color: #2ECC71;
    --chat-accent: #007aff;
    --window-height: 500px;
}

.demo-desktop {
    width: 100%;
    min-height: calc(100vh - 140px);
    background: var(--demo-bg-color) url('../img/carbon-fibre-v2.png');
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 40px 0;
    overflow: hidden;
}

.demo-desktop::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 70% 30%, rgba(46, 204, 113, 0.08) 0%, rgba(46, 204, 113, 0) 80%);
    animation: pulseGlow 10s infinite ease-in-out;
    will-change: transform, opacity;
    z-index: 0;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.window-container {
    width: 90%;
    max-width: 1200px;
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.window {
    flex: 1;
    height: var(--window-height);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s ease;
    transform: scale(0.85);
    overflow: hidden;
}

.window.active {
    transform: scale(1);
    box-shadow: 0 40px 80px rgba(0,0,0,0.8);
    z-index: 10;
}

.window-header {
    height: 38px;
    background: var(--demo-header-bg);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 15px;
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.traffic-lights {
    display: flex;
    gap: 8px;
}

.traffic-lights span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

.window-title {
    position: absolute;
    width: 100%;
    left: 0;
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    pointer-events: none;
}

.window-body {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    font-family: 'Roboto Mono', monospace;
}

/* Terminal Styles */
.terminal {
    background: var(--term-bg);
    color: var(--demo-text-color);
}

.terminal .window-body {
    overflow: hidden;
    padding: 16px;
}

.terminal .content {
    white-space: pre-wrap;
    line-height: 1.36;
    margin-bottom: 8px;
    font-size: 14px;
}

.terminal .success { color: #4cd964; }
.terminal .warning { color: #ff9500; }
.terminal .error { color: #ff3b30; }

#terminal-input, #browser-input {
    white-space: pre-wrap;
    display: inline-block;
}

.cursor-line {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--demo-accent-color);
    border-radius: 4px;
    margin-top: 8px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.window:not(.active) .cursor {
    animation: none;
    opacity: 1;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: var(--demo-accent-color);
    margin-left: 5px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

/* Browser Styles */
.browser {
    background: var(--browser-bg);
    color: #333;
}

.browser .window-header {
    background: #e0e0e0;
    color: #555;
}

.browser .window-title {
    color: #555;
}

.browser-address-bar {
    padding: 8px 15px;
    background: #f1f1f1;
    border-bottom: 1px solid #ddd;
}

.address-input {
    background: white;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    color: #888;
    border: 1px solid #ddd;
}

.browser .window-body {
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f9f9f9;
}

.browser .content {
    padding: 12px 15px;
}

.chat-header {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.chat-message {
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
}

.user-message {
    background: #e3f2fd;
    align-self: flex-start;
    border: 1px solid #bbdefb;
}

.ai-message {
    background: #fff;
    border: 1px solid #eee;
}

.copy-btn {
    background: #fff;
    color: #333;
    border: 1px solid #ccc;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    margin-top: 5px;
}

.copy-btn:hover {
    background: #f8f8f8;
    border-color: #bbb;
}

.copy-btn.clicked {
    background: var(--chat-accent);
    color: white;
    border-color: var(--chat-accent);
    transform: scale(0.95);
}

.chat-input-area {
    margin-top: 20px;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    display: flex;
    align-items: center;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

#browser-input:empty:before {
    content: attr(data-placeholder);
    color: #ccc;
    font-style: italic;
}

.chat-input-area.flash {
    animation: pasteFlash 0.5s ease-out;
}

@keyframes pasteFlash {
    0% { background-color: rgba(76, 217, 100, 0.3); }
    100% { background-color: white; }
}

.pasted-block {
    display: inline-block;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 8px;
    color: #555;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
}

/* Controls & CTA Container */
.demo-footer-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 100;
    width: 100%;
}

.demo-controls {
    background: rgba(0,0,0,0.7);
    padding: 8px 18px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.05);
}

.demo-controls button {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
    font-size: 0.85rem;
}

.demo-controls button:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--demo-accent-color);
}

.step-indicator {
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    margin-left: 8px;
}

.clicked-label {
    color: #888;
    font-weight: 500;
    margin-left: 10px;
    font-size: 13px;
    animation: fadeInOut 1.5s forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-4px); }
    20% { opacity: 1; transform: translateX(0); }
    80% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(4px); }
}

.feature-hint {
    position: absolute;
    background: var(--chat-accent);
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    width: 240px;
    line-height: 1.4;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
    pointer-events: none;
    z-index: 2000;
    text-align: center;
}

.feature-hint.visible {
    opacity: 1;
    transform: translateY(0);
}

.feature-hint::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--chat-accent);
}

.demo-cta {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.demo-cta .highlight {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.demo-cta p {
    margin: 0;
}

@media (max-width: 900px) {
    .window-container {
        width: 94%;
        height: auto;
        flex-direction: column;
        gap: 18px;
    }

    .window {
        width: 100%;
        height: min(42vh, var(--window-height));
        transform: scale(0.96);
    }

    .demo-footer-controls {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        margin-top: 40px;
        padding-bottom: 40px;
    }
}
