/* Demo page styles */
.demo-section {
    padding: 120px 0 60px;
}

.demo-section h1 {
    text-align: center;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* Connection Card */
.connection-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-dot.connected {
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
}

.status-dot.disconnected {
    background: #ef4444;
}

.connection-config {
    display: flex;
    gap: 10px;
    align-items: center;
}

.connection-config input {
    padding: 10px 15px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    width: 250px;
}

/* Commands */
.commands-section h2 {
    margin-bottom: 10px;
}

.commands-section>p {
    color: var(--text-muted);
    margin-bottom: 25px;
}

.commands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.command-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 25px;
    border: 1px solid var(--border);
    transition: border-color 0.3s;
}

.command-card:hover {
    border-color: var(--primary);
}

.command-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.command-icon {
    font-size: 1.5rem;
}

.command-header h3 {
    flex: 1;
    margin: 0;
    font-size: 1.1rem;
}

.badge {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.free {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.badge.pro {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
}

.command-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.command-code {
    background: var(--background);
    padding: 10px 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--primary-light);
    margin-bottom: 15px;
}

/* Response Panel */
.response-section h2 {
    margin-bottom: 15px;
}

.response-panel {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.response-header {
    background: var(--background-light);
    padding: 12px 20px;
    display: flex;
    gap: 15px;
    font-family: monospace;
    font-size: 0.9rem;
}

.response-header span:first-child {
    color: var(--secondary);
    font-weight: 600;
}

#response-body {
    padding: 20px;
    margin: 0;
    font-size: 0.85rem;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    color: var(--text-muted);
}

/* How It Works */
.how-it-works {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.how-it-works h2 {
    text-align: center;
    margin-bottom: 30px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.step {
    text-align: center;
}

.step-number {
    display: inline-flex;
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 15px;
}

.step h4 {
    margin-bottom: 8px;
}

.step p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* CTA */
.demo-cta {
    text-align: center;
    margin-top: 60px;
    padding: 50px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: var(--radius);
}

.demo-cta h3 {
    margin-bottom: 10px;
}

.demo-cta p {
    color: var(--text-muted);
    margin-bottom: 25px;
}

/* WebSocket Streaming */
.streaming-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.streaming-section h2 .badge {
    margin-left: 10px;
    vertical-align: middle;
}

.streaming-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 25px;
    border: 1px solid var(--border);
}

.streaming-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.streaming-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.channel-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: var(--background);
    border-radius: 8px;
    cursor: pointer;
    font-family: monospace;
    color: var(--primary-light);
}

.channel-checkbox input {
    accent-color: var(--primary);
}

.channel-desc {
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: auto;
}

/* Events Log */
.events-log {
    background: var(--background);
    border-radius: 8px;
    overflow: hidden;
}

.events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--background-light);
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-small {
    padding: 4px 10px;
    font-size: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
}

.btn-small:hover {
    background: var(--border);
}

.events-container {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
}

.event-placeholder {
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
    font-style: italic;
}

.event-item {
    display: flex;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 4px;
    margin-bottom: 5px;
    font-family: monospace;
    font-size: 0.85rem;
    background: var(--surface);
    animation: slideIn 0.3s ease;
    cursor: pointer;
    flex-wrap: wrap;
}

.event-item:hover {
    background: var(--background-light);
}

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

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.event-time {
    color: var(--text-muted);
    min-width: 70px;
    flex-shrink: 0;
}

.event-channel {
    color: var(--secondary);
    min-width: 85px;
    flex-shrink: 0;
}

.event-type {
    color: var(--primary-light);
    min-width: 75px;
    flex-shrink: 0;
}

.event-copy {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0 4px;
    font-size: 0.9rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    margin-left: auto;
}

.event-copy:hover {
    opacity: 1;
}

.event-data {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.event-item.expanded .event-data {
    white-space: pre-wrap;
    word-break: break-word;
}

.event-item.expanded {
    flex-direction: column;
}

.event-item.expanded .event-meta {
    display: flex;
    gap: 10px;
}

.event-item.error {
    border-left: 3px solid #ef4444;
}

.event-item.warning {
    border-left: 3px solid #f59e0b;
}

.event-item.success {
    border-left: 3px solid #10b981;
}