/* Agent Gameworks - Dark Mode Theme */

/* CSS Variables - Dark Mode */
:root {
    --primary-color: #6366f1;
    --primary-hover: #818cf8;
    --success-color: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning-color: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger-color: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    
    /* Dark theme colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-elevated: #334155;
    --bg-input: #0f172a;
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: #334155;
    --border-light: #475569;
    
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: var(--bg-primary);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Subtle grid pattern background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Landing Page */
.landing {
    text-align: center;
    padding: 60px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.landing h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.concept-explanation {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    text-align: left;
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
}

.concept-explanation h2 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.concept-explanation ul {
    list-style: none;
    padding: 0;
}

.concept-explanation li {
    padding: 10px 0;
    padding-left: 25px;
    position: relative;
}

.concept-explanation li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* AEL Framework List */
.ael-list {
    margin: 15px 0 15px 20px !important;
    padding: 0 !important;
}

.ael-list li {
    padding: 8px 0 !important;
    font-size: 0.95rem;
}

.ael-list li::before {
    content: "•" !important;
    color: var(--primary-color);
}

.ael-list li strong {
    color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #4f46e5);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #6366f1);
    box-shadow: var(--shadow-glow);
}

.btn-approve {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    font-size: 1.2rem;
    padding: 15px 40px;
}

.btn-approve:hover {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.btn-deny {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
    font-size: 1.2rem;
    padding: 15px 40px;
}

.btn-deny:hover {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.btn-modify {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
    color: white;
    font-size: 1.2rem;
    padding: 15px 40px;
}

.btn-modify:hover {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--border-light);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* Game Board */
.game-board {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: start;
}

.game-header {
    grid-column: 1 / -1;
    text-align: center;
    padding: 25px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.game-header h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.golden-rule {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* Turn Indicator */
.turn-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.agent-badge {
    background: linear-gradient(135deg, var(--primary-color), #4f46e5);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.turn-number {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Scenario Card */
.scenario-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
}

.scenario-card h2 {
    margin-bottom: 15px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.scenario-text {
    font-size: 1.35rem;
    line-height: 1.8;
    color: var(--text-primary);
}

/* AEL Evaluation Section */
.ael-evaluation {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.ael-evaluation h3 {
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.ael-help {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.pillar-sliders {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.pillar-slider {
    background: var(--bg-elevated);
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.pillar-slider label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.pillar-name {
    font-size: 0.95rem;
}

.tooltip-trigger {
    cursor: help;
    font-size: 0.9rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.tooltip-trigger:hover {
    opacity: 1;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pillar-input {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-primary);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.pillar-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, var(--primary-color), #818cf8);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.pillar-input::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.6);
}

.pillar-input::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, var(--primary-color), #818cf8);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.slider-value {
    min-width: 30px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.pillar-summary {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    border: 1px solid var(--border-color);
}

.summary-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.summary-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.3rem;
}

.recommendation {
    margin-left: auto;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.recommendation.approve {
    background: var(--success-bg);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.recommendation.modify {
    background: var(--warning-bg);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.recommendation.deny {
    background: var(--danger-bg);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Decision Buttons */
.decision-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* Modification Panel */
.modification-panel {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    border: 2px solid var(--warning-color);
    background: linear-gradient(135deg, var(--bg-card), rgba(245, 158, 11, 0.05));
}

.modification-panel h4 {
    margin-bottom: 20px;
    color: var(--warning-color);
    font-size: 1.1rem;
}

.modification-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.mod-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    border: 1px solid transparent;
}

.mod-option:hover {
    background: var(--bg-primary);
    border-color: var(--border-light);
}

.mod-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.mod-option span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modification-reasoning {
    margin-top: 15px;
}

.modification-reasoning label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

.modification-reasoning textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.modification-reasoning textarea:focus {
    outline: none;
    border-color: var(--warning-color);
}

/* Reasoning Section */
.reasoning-section {
    margin-bottom: 30px;
}

.reasoning-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

.reasoning-section textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
    background: var(--bg-input);
    color: var(--text-primary);
}

.reasoning-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.reasoning-section textarea:disabled {
    background-color: var(--bg-elevated);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Stakeholder Impact Visualization */
.impact-visualization {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.impact-visualization h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.impact-bars {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.impact-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.impact-label {
    min-width: 120px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.impact-bar-container {
    flex: 1;
    height: 24px;
    background: var(--bg-elevated);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.impact-bar {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease, background-color 0.3s ease;
    min-width: 4px;
}

.impact-bar.positive {
    background: linear-gradient(90deg, #059669, #10b981);
}

.impact-bar.negative {
    background: linear-gradient(90deg, #dc2626, #ef4444);
}

.impact-bar.neutral {
    background: linear-gradient(90deg, #4b5563, #6b7280);
}

.impact-score {
    min-width: 40px;
    text-align: right;
    font-weight: 700;
    font-size: 1rem;
}

.impact-score.positive {
    color: var(--success-color);
}

.impact-score.negative {
    color: var(--danger-color);
}

.impact-score.neutral {
    color: var(--text-muted);
}

.impact-note {
    margin-top: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

/* Auto-Play Controls */
.autoplay-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar > div {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.sidebar h3 {
    margin-bottom: 15px;
    font-size: 1rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    font-weight: 600;
}

/* Agent Registration Form */
.agent-registration form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agent-registration input,
.agent-registration select {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.agent-registration input::placeholder {
    color: var(--text-muted);
}

.agent-registration input:focus,
.agent-registration select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.agent-registration select {
    cursor: pointer;
}

/* Demo Agents */
.demo-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.demo-buttons .btn {
    width: 100%;
}

/* Agents List */
.agents-list ul {
    list-style: none;
    padding: 0;
}

.agents-list li {
    padding: 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s;
}

.agents-list li:hover {
    border-color: var(--border-light);
}

.agent-name {
    font-weight: 600;
    color: var(--text-primary);
}

.agent-type {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 3px 10px;
    border-radius: 12px;
}

.remove-agent {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    padding: 0 5px;
    transition: color 0.2s;
}

.remove-agent:hover {
    color: var(--danger-color);
}

/* Decision History */
.decision-history ul {
    list-style: none;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
}

.decision-history li {
    padding: 14px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    margin-bottom: 10px;
    border-left: 3px solid;
}

.decision-history li.approved {
    border-left-color: var(--success-color);
}

.decision-history li.modified {
    border-left-color: var(--warning-color);
}

.decision-history li.denied {
    border-left-color: var(--danger-color);
}

.history-agent {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.history-decision {
    font-size: 0.8rem;
    font-weight: 700;
    margin: 4px 0;
}

.history-decision.approved {
    color: var(--success-color);
}

.history-decision.modified {
    color: var(--warning-color);
}

.history-decision.denied {
    color: var(--danger-color);
}

.history-reasoning {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

.history-timestamp {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.empty-message {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Tooltip */
.tooltip {
    position: fixed;
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    max-width: 250px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: var(--shadow-lg);
    line-height: 1.4;
    border: 1px solid var(--border-color);
}

.tooltip::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(--bg-elevated);
}

/* Educational Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-card);
    padding: 35px;
    border-radius: var(--radius-xl);
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    background: none;
    border: none;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.modal-content h3 {
    margin: 25px 0 15px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.ael-pillar-detail {
    margin: 20px 0;
    padding: 18px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary-color);
}

.ael-pillar-detail h4 {
    margin-bottom: 8px;
    color: var(--primary-color);
    font-weight: 600;
}

.ael-pillar-detail p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-board {
        grid-template-columns: 1fr;
    }
    
    .landing h1 {
        font-size: 2rem;
    }
    
    .landing {
        padding: 40px 20px;
    }
    
    .decision-buttons {
        flex-direction: column;
    }
    
    .decision-buttons .btn {
        width: 100%;
    }
    
    .autoplay-controls {
        flex-direction: column;
    }
    
    .demo-buttons {
        grid-template-columns: 1fr;
    }
    
    .modification-options {
        grid-template-columns: 1fr;
    }
    
    .pillar-slider label {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .impact-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .impact-bar-container {
        width: 100%;
    }
    
    .modal-content {
        margin: 20px;
        max-height: 90vh;
    }
    
    .scenario-text {
        font-size: 1.15rem;
    }
    
    .game-header h1 {
        font-size: 1.4rem;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}
