/**
 * Multi-Agent Simulation Styles
 * Interactive diplomacy simulation interface
 */

/* Simulation Container */
.dm-simulation-container {
    max-width: 1200px;
    margin: 20px auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Header */
.dm-simulation-header {
    background: linear-gradient(135deg, #2271b1 0%, #1a5490 100%);
    color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dm-simulation-header h3 {
    margin: 0;
    font-size: 1.4em;
}

.dm-simulation-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dm-turn-counter {
    background: rgba(255,255,255,0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
}

.dm-toggle-evaluation,
.dm-end-simulation {
    background: rgba(255,255,255,0.9);
    color: #2271b1;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.dm-toggle-evaluation:hover,
.dm-end-simulation:hover {
    background: #fff;
    transform: translateY(-1px);
}

/* Body */
.dm-simulation-body {
    display: flex;
    height: 600px;
}

.dm-conversation-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e5e5e5;
}

.dm-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

/* Messages */
.dm-message {
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s;
}

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

.dm-message-avatar {
    min-width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9em;
}

.dm-user-message .dm-message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.dm-stakeholder-message .dm-message-avatar {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
}

.dm-message-content {
    flex: 1;
    background: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.dm-message-meta {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
}

.dm-emotional-state {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
    font-style: italic;
}

.dm-message-text {
    line-height: 1.6;
    color: #333;
}

.dm-emotional-cue {
    color: #e65100;
    font-style: italic;
}

/* System Messages */
.dm-system-message {
    justify-content: center;
}

.dm-system-message .dm-message-content {
    background: #e3f2fd;
    border-left: 4px solid #2271b1;
    max-width: 80%;
}

/* Coaching Messages */
.dm-coaching-message .dm-message-content {
    background: #fff9e6;
    border-left: 4px solid #f39c12;
}

.dm-coaching-header {
    font-weight: 600;
    color: #f39c12;
    margin-bottom: 8px;
}

.dm-coaching-critical {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.dm-principle-ref {
    margin-top: 8px;
    font-size: 0.85em;
    color: #666;
    font-style: italic;
}

/* Cultural Notes */
.dm-cultural-note .dm-message-content {
    background: #f3e5f5;
    border-left: 4px solid #9c27b0;
}

.dm-note-header {
    font-weight: 600;
    color: #9c27b0;
    margin-bottom: 8px;
}

/* Consequences */
.dm-consequences-message .dm-message-content {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
}

.dm-consequences-header {
    font-weight: 600;
    color: #2e7d32;
    margin-bottom: 12px;
}

.dm-consequence-item {
    margin-bottom: 10px;
}

.dm-insight {
    margin-top: 12px;
    padding: 8px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 4px;
    font-style: italic;
}

/* Typing Indicator */
.dm-typing-indicator {
    padding: 20px;
    display: flex;
    gap: 5px;
    justify-content: center;
}

.dm-typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.dm-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.dm-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* Evaluation Panel */
.dm-evaluation-panel {
    width: 300px;
    background: #fafafa;
    padding: 20px;
    overflow-y: auto;
}

.dm-evaluation-panel h4 {
    margin-top: 0;
    color: #333;
}

.dm-eval-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e5e5;
}

.dm-eval-item:last-child {
    border-bottom: none;
}

.dm-quality-excellent {
    color: #0a6b2e;
    font-weight: 600;
}

.dm-quality-good {
    color: #2271b1;
    font-weight: 600;
}

.dm-quality-mixed {
    color: #e65100;
    font-weight: 600;
}

.dm-quality-poor {
    color: #d32f2f;
    font-weight: 600;
}

/* Footer */
.dm-simulation-footer {
    background: #f8f9fa;
    padding: 15px 20px;
    border-top: 1px solid #e5e5e5;
}

.dm-relationship-scores {
    margin-bottom: 10px;
    font-size: 0.9em;
}

.dm-relationships {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.dm-relationship-item {
    font-weight: 600;
}

.dm-message-input-area {
    display: flex;
    gap: 10px;
}

.dm-message-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    font-family: inherit;
    font-size: 0.95em;
    resize: none;
}

.dm-message-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.dm-send-message {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.dm-send-message:hover {
    background: #1a5490;
    transform: translateY(-1px);
}

/* Stakeholder Profiles */
.dm-stakeholder-profiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.dm-profile-card {
    background: #fff;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e5e5e5;
}

.dm-profile-detail {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
}

/* Final Evaluation */
.dm-final-evaluation {
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.dm-final-evaluation h2 {
    text-align: center;
    color: #2271b1;
    margin-bottom: 30px;
}

.dm-final-score {
    text-align: center;
    margin-bottom: 30px;
}

.dm-score-big {
    font-size: 4em;
    font-weight: 700;
    color: #2271b1;
}

.dm-rating {
    font-size: 1.5em;
    color: #666;
    margin-top: 10px;
}

.dm-final-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.dm-stat {
    text-align: center;
    font-size: 1.1em;
}

.dm-final-relationships,
.dm-final-strengths,
.dm-final-improvements,
.dm-final-feedback {
    margin-bottom: 30px;
}

.dm-final-relationships h4,
.dm-final-strengths h4,
.dm-final-improvements h4,
.dm-final-feedback h4 {
    color: #333;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.dm-rel-final {
    padding: 8px;
    background: #f8f9fa;
    margin-bottom: 5px;
    border-radius: 4px;
}

.dm-final-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.dm-final-actions button {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s;
}

.dm-final-actions button:hover {
    background: #1a5490;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Loading Overlay */
.dm-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.dm-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.dm-loading-message {
    color: #fff;
    margin-top: 20px;
    font-size: 1.1em;
}

/* Error Message */
.dm-error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px 20px;
    border-left: 4px solid #d32f2f;
    margin-bottom: 15px;
    border-radius: 4px;
}

/* Start Simulation Button */
.dm-start-simulation {
    background: linear-gradient(135deg, #2271b1 0%, #1a5490 100%);
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1em;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.dm-start-simulation:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(34, 113, 177, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .dm-simulation-body {
        flex-direction: column;
        height: auto;
    }
    
    .dm-conversation-area {
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
    }
    
    .dm-messages-container {
        height: 400px;
    }
    
    .dm-evaluation-panel {
        width: 100%;
        max-height: 300px;
    }
    
    .dm-stakeholder-profiles {
        grid-template-columns: 1fr;
    }
    
    .dm-simulation-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .dm-simulation-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}
