/* Thread Scheduler Styles */
/* Styling handled in main styles.css */
/*.scheduler-container {
    grid-area: scheduler;
}*/

.cpu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.cpu-header h3 {
    margin: 0;
    color: var(--color-header);
}

.scheduler-controls {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.algorithm-selector, .time-slice-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.algorithm-selector select, .time-slice-control input {
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.algorithm-selector select:focus, .time-slice-control input:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.cores-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.cpu-core {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.cpu-core:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transform: translateY(-3px);
}

.core-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.core-id {
    font-weight: 600;
    color: var(--accent-primary);
}

.core-utilization {
    background-color: var(--accent-secondary);
    color: var(--btn-primary-text);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
}

.core-thread-container {
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 0.8rem;
    position: relative;
    border: 1px solid var(--border-color);
}

.no-thread {
    color: #999;
    font-style: italic;
}

.running-thread {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.pulse-animation {
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from {
        transform: scale(1);
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
    to {
        transform: scale(1.05);
        box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    }
}

.core-progress {
    height: 6px;
    background-color: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #4caf50;
    transition: width 0.5s ease;
}

.thread-queue-container {
    margin-top: 1.5rem;
}

.thread-queue-container h4 {
    margin-bottom: 0.8rem;
    color: var(--color-header);
}

.thread-queue {
    background-color: #f5f5f5;
    border-radius: 4px;
    padding: 1rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    overflow-x: auto;
    white-space: nowrap;
}

.empty-queue {
    color: #999;
    font-style: italic;
    margin: 0 auto;
}

.queued-thread {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--color-runnable);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Thread contention visualization */
.contention-container {
    margin-top: 2rem;
}

.contention-container h4 {
    margin-bottom: 0.8rem;
    color: var(--color-header);
}

.resource-locks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.resource-lock {
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.resource-name {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--color-header);
}

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

.lock-status.locked {
    color: var(--color-blocked);
}

.lock-status.unlocked {
    color: var(--color-runnable);
}

.owner-thread {
    background-color: var(--color-running);
    color: white;
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
}

.waiting-threads {
    margin-top: 0.8rem;
}

.waiting-threads-title {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.waiting-thread-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.waiting-thread {
    background-color: var(--color-blocked);
    color: white;
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
}
