/* Agent Society Simulator Styles
 * SIM-001: This service has zero dependencies on sim-core or product crates
 * SIM-002: UI reads artifacts only - no simulation engine logic
 *
 * Standalone service - self-contained CSS variables (dark theme)
 */

/* Design system tokens - standalone (not dependent on apps/web) */
:root {
    --background: 240 10% 3.9%;
    --foreground: 0 0% 98%;
    --card: 240 10% 3.9%;
    --card-foreground: 0 0% 98%;
    --muted: 240 3.7% 15.9%;
    --muted-foreground: 240 5% 64.9%;
    --accent: 240 3.7% 15.9%;
    --border: 240 3.7% 15.9%;
    --primary: 0 0% 98%;
    --primary-foreground: 240 5.9% 10%;
    --success: 142 76% 36%;
    --info: 199 89% 48%;
}

/* Base styles for standalone mode */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
}

/* Layout */
.simulator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: hsl(var(--card));
    border-bottom: 1px solid hsl(var(--border));
}

.simulator-main {
    display: flex;
    flex: 1;
    height: calc(100vh - 57px);
    overflow: hidden;
}

.simulator-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: hsl(var(--card));
    border-right: 1px solid hsl(var(--border));
    overflow-y: auto;
    padding: 1rem;
}

/* Control Sections */
.control-section {
    margin-bottom: 1.5rem;
}

.control-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.75rem;
}

/* Connection Indicator */
.connection-indicator {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.connection-indicator .status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.connection-indicator.connecting {
    background: hsl(45 93% 47% / 0.15);
    color: hsl(45 93% 47%);
}

.connection-indicator.connecting .status-dot {
    background: hsl(45 93% 47%);
}

.connection-indicator.connected {
    background: hsl(var(--success) / 0.15);
    color: hsl(var(--success));
}

.connection-indicator.connected .status-dot {
    background: hsl(var(--success));
    animation: none;
}

.connection-indicator.disconnected {
    background: hsl(0 84% 60% / 0.15);
    color: hsl(0 84% 60%);
}

.connection-indicator.disconnected .status-dot {
    background: hsl(0 84% 60%);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Layer Toggles */
.layer-toggles {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.layer-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.layer-toggle input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    accent-color: hsl(var(--primary));
}

.layer-label {
    font-size: 0.875rem;
    color: hsl(var(--foreground));
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    background: hsl(var(--muted) / 0.5);
    border-radius: 0.5rem;
}

.stat-label {
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsl(var(--muted-foreground));
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: hsl(var(--foreground));
}

/* Canvas Container */
.canvas-container {
    flex: 1;
    position: relative;
    background: hsl(var(--background));
    overflow: hidden;
}

#simulation-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Canvas Overlay */
.canvas-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: hsl(var(--background) / 0.9);
}

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

.overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

/* Buttons */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    background: hsl(var(--muted));
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.btn-secondary:hover {
    background: hsl(var(--accent));
    border-color: hsl(var(--accent));
}

/* Agent Rendering (canvas layer colors) */
.agent-alive { fill: hsl(var(--success)); }
.agent-dead { fill: hsl(var(--muted-foreground)); }
.agent-verified { stroke: hsl(var(--info)); stroke-width: 2; }
.agent-unverified { stroke: none; }

/* DOCAS color mapping (5 neuromodulators) */
:root {
    --docas-d: 120, 70%, 50%;  /* Dopamine: Green (reward) */
    --docas-o: 200, 70%, 50%;  /* Oxytocin: Blue (bonding) */
    --docas-c: 40, 80%, 50%;   /* Cortisol: Orange (stress) */
    --docas-a: 0, 70%, 50%;    /* Adrenaline: Red (action) */
    --docas-s: 280, 60%, 50%;  /* Serotonin: Purple (calm) */
}

/* Job Form Styles */
.job-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group label {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

.form-group input,
.form-group select {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    background: hsl(var(--muted));
    border: 1px solid hsl(var(--border));
    border-radius: 0.375rem;
    color: hsl(var(--foreground));
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: hsl(var(--info));
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: hsl(var(--primary-foreground));
    background: hsl(var(--primary));
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: opacity 0.15s;
}

.btn-primary:hover {
    opacity: 0.9;
}

/* Job Status */
.job-status {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: hsl(var(--muted));
    border-radius: 0.375rem;
}

.job-status.hidden {
    display: none;
}

.job-status-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.job-status-icon {
    font-size: 1rem;
}

.job-id {
    display: block;
    font-size: 0.625rem;
    font-family: 'JetBrains Mono', monospace;
    color: hsl(var(--muted-foreground));
    margin-top: 0.25rem;
    word-break: break-all;
}

/* Runs List */
.runs-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 150px;
    overflow-y: auto;
}

.run-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem;
    background: hsl(var(--muted));
    border: 1px solid hsl(var(--border));
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.15s;
    width: 100%;
    text-align: left;
}

.run-item:hover {
    background: hsl(var(--accent));
}

.run-name {
    font-size: 0.75rem;
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
}

.run-meta {
    font-size: 0.625rem;
    color: hsl(var(--muted-foreground));
}

/* Responsive */
@media (max-width: 768px) {
    .simulator-main {
        flex-direction: column;
    }

    .simulator-sidebar {
        width: 100%;
        height: auto;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid hsl(var(--border));
    }
}

