/**
 * Demo Explanations CSS
 * 
 * This file contains styles for the concurrency demo explanation panels.
 */

.demo-explanation-panel {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-top: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.explanation-header {
    background: var(--bg-secondary);
    padding: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.explanation-header h3 {
    margin: 0;
    color: var(--accent-primary);
    font-weight: 600;
}

.explanation-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.phase-nav {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s ease;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.phase-nav:hover:not(:disabled) {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.phase-nav:disabled {
    background: var(--btn-secondary-bg);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.phase-indicator {
    font-weight: 500;
    color: var(--text-secondary);
}

.explanation-content {
    padding: 1.8rem;
    color: var(--text-primary);
}

.explanation-content h4 {
    margin: 0 0 1.2rem 0;
    color: var(--accent-primary);
    font-weight: 600;
}

/* Demo specific highlighting */
.demo-explanation.race-condition .demo-explanation-panel {
    border-left: 5px solid var(--color-blocked);
}

.demo-explanation.deadlock .demo-explanation-panel {
    border-left: 5px solid var(--color-waiting);
}

.demo-explanation.livelock .demo-explanation-panel {
    border-left: 5px solid var(--color-timed-waiting);
}

.explanation-content p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

/* Code snippet styling moved to syntax-highlighting.css */
.code-snippet {
    /* Basic styles maintained here for backwards compatibility */
    background: var(--code-bg);
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1.8rem;
    border-left: 4px solid var(--accent-primary);
}
.code-snippet .keyword {
    color: var(--code-keyword);
    font-weight: bold;
}

.code-snippet .function {
    color: var(--code-function);
}

.code-snippet .string {
    color: var(--code-string);
}

.code-snippet .number {
    color: var(--code-number);
}

.code-snippet .comment {
    color: var(--code-comment);
    font-style: italic;
}

.code-snippet .variable {
    color: var(--code-variable);
}

.code-snippet .operator {
    color: var(--code-operator);
}

.code-snippet .class {
    color: var(--code-class);
    font-weight: bold;
}
    color: var(--code-keyword);
    font-weight: bold;
}

.code-snippet .function {
    color: var(--code-function);
}

.code-snippet .string {
    color: var(--code-string);
}

.code-snippet .number {
    color: var(--code-number);
}

.code-snippet .comment {
    color: var(--code-comment);
    font-style: italic;
}

.code-snippet .variable {
    color: var(--code-variable);
}

.code-snippet .operator {
    color: var(--code-operator);
}

.code-snippet .class {
    color: var(--code-class);
    font-weight: bold;
}
    color: #333;
    margin: 0;
}

.explanation-steps {
    background: #f9f9f9;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.explanation-steps h5 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.explanation-steps ol {
    padding-left: 1.5rem;
}

.explanation-steps li {
    margin-bottom: 0.5rem;
}

.phase-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.highlight-demo-btn {
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.highlight-demo-btn:hover {
    background: #43a047;
}

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

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(25, 118, 210, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(25, 118, 210, 0); }
    100% { box-shadow: 0 0 0 0 rgba(25, 118, 210, 0); }
}

.demo-explanation-panel {
    animation: fadeIn 0.3s ease forwards;
}

.highlight-element {
    position: relative;
    z-index: 10;
    box-shadow: 0 0 10px 2px rgba(25, 118, 210, 0.7);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .explanation-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .explanation-controls {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .phase-nav {
        padding: 0.4rem 0.7rem;
        font-size: 0.9rem;
    }
    
    .code-snippet {
        font-size: 0.9rem;
        max-width: 100%;
        overflow-x: auto;
    }
    
    .explanation-content h4 {
        font-size: 1.1rem;
    }
    
    .explanation-content {
        padding: 1rem;
    }
    
    .explanation-steps ol {
        padding-left: 1.2rem;
    }
    
    .demo-explanation-panel {
        margin: 1rem 0;
        border-radius: 6px;
    }
}
