/**
 * Genesis Demo Styles
 * ===================
 * Shared styles for interactive human-agent collaboration demos
 */

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --accent: #f59e0b;
    --bg-light: #f8fafc;
    --bg-dark: #1e293b;
    --text-dark: #1e293b;
    --text-light: #f8fafc;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.genesis-demo {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* Header */
.demo-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.demo-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.demo-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.demo-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.demo-btn:hover {
    background: rgba(255,255,255,0.3);
}

.demo-progress {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Main Layout */
.demo-main {
    display: grid;
    grid-template-columns: 1fr 300px;
    height: 600px;
}

/* Chat Area */
.demo-chat {
    padding: 20px;
    overflow-y: auto;
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Messages */
.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: slideIn 0.3s ease;
}

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

.agent-message {
    align-self: flex-start;
}

.human-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.colleague-message {
    align-self: flex-start;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.human-message .message-content {
    background: var(--primary);
    color: white;
}

.colleague-message .message-content {
    background: #fef3c7;
    border: 1px solid #fcd34d;
}

.sender-name {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 0.7;
}

.message-text {
    font-size: 0.9375rem;
    line-height: 1.5;
}

.message-buttons {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.msg-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8125rem;
    cursor: pointer;
}

/* System Message */
.system-message {
    align-self: center;
    max-width: 100%;
}

.system-text {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Phase Marker */
.phase-marker {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 16px 0;
}

.phase-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.phase-content {
    text-align: center;
}

.phase-name {
    display: block;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.9375rem;
}

.phase-desc {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
}

/* Consent Card */
.consent-card {
    background: white;
    border: 2px solid var(--secondary);
    border-radius: var(--radius);
    padding: 16px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.consent-header {
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 8px;
}

.consent-body {
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.consent-body p {
    margin-top: 4px;
    color: #64748b;
}

.consent-status {
    font-size: 0.8125rem;
    font-weight: 500;
}

.consent-status.pending {
    color: var(--accent);
}

.consent-status.granted {
    color: var(--secondary);
}

/* Agent Action */
.agent-action {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: var(--radius);
    padding: 12px 16px;
    max-width: 500px;
    animation: slideIn 0.3s ease;
}

.action-icon {
    font-size: 1.25rem;
}

.action-content {
    flex: 1;
}

.action-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #166534;
}

.action-details {
    font-size: 0.75rem;
    color: #15803d;
}

.action-status {
    color: var(--secondary);
    font-weight: bold;
}

/* Quality Emergence */
.quality-emergence {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 20px;
    max-width: 500px;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.6); }
}

.quality-header {
    font-weight: 700;
    font-size: 1rem;
    color: #92400e;
    margin-bottom: 16px;
}

.contributions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.contribution {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.7);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8125rem;
}

.contrib-avatar {
    font-size: 1.25rem;
}

.contrib-name {
    font-weight: 500;
    min-width: 100px;
}

.contrib-type {
    font-size: 0.75rem;
}

.contrib-value {
    flex: 1;
    color: #64748b;
    font-size: 0.75rem;
}

.quality-result {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quality-label {
    font-weight: 500;
    font-size: 0.875rem;
}

.quality-bar {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.5);
    border-radius: 4px;
    overflow: hidden;
}

.quality-fill {
    height: 100%;
    border-radius: 4px;
    animation: fillBar 1s ease forwards;
}

.quality-fill.superior {
    background: linear-gradient(90deg, var(--secondary), var(--accent));
    width: 95%;
}

@keyframes fillBar {
    from { width: 0; }
}

.quality-text {
    font-weight: 700;
    color: var(--secondary);
    font-size: 0.875rem;
}

/* Sidebar */
.demo-sidebar {
    background: white;
    border-left: 1px solid var(--border);
    padding: 16px;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section h4 {
    font-size: 0.8125rem;
    color: #64748b;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Network Members */
.network-member {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 8px;
}

.network-member.fade-in {
    animation: slideIn 0.3s ease;
}

.member-avatar {
    font-size: 1.5rem;
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 500;
    font-size: 0.875rem;
}

.member-role {
    font-size: 0.75rem;
    color: #64748b;
}

.member-status {
    font-size: 0.875rem;
}

/* Tools */
.tool-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f0fdf4;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.8125rem;
}

.tool-item.fade-in {
    animation: slideIn 0.3s ease;
}

.tool-icon {
    font-size: 1rem;
}

/* Outputs */
.output-item {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.output-item.fade-in {
    animation: slideIn 0.3s ease;
}

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

.output-icon {
    font-size: 1.25rem;
}

.output-name {
    font-weight: 500;
    font-size: 0.875rem;
}

.output-quality {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.quality-label {
    font-size: 0.75rem;
    color: #64748b;
}

.quality-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.quality-badge.superior {
    background: linear-gradient(135deg, var(--secondary), #059669);
    color: white;
}

.quality-badge.good {
    background: #dbeafe;
    color: var(--primary);
}

.output-attribution {
    font-size: 0.6875rem;
    color: #94a3b8;
}

/* Footer */
.demo-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--border);
    min-height: 48px;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.typing-text {
    font-size: 0.8125rem;
    color: #64748b;
}

/* Responsive */
@media (max-width: 768px) {
    .demo-main {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .demo-chat {
        min-height: 400px;
    }
    
    .demo-sidebar {
        border-left: none;
        border-top: 1px solid var(--border);
    }
}
