/* Resource Allocation Graph Styles */
.simulation-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    margin-bottom: 40px;
}

.controls-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    justify-content: space-between;
}

.controls-group {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    min-width: 250px;
}

.controls-group h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #00e0ff;
    font-size: 16px;
}

.element-controls, .edge-controls, .action-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    background: #00e0ff;
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.btn:hover {
    background: #00b8d4;
}

select {
    padding: 8px;
    border-radius: 5px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    flex-grow: 1;
}

.graph-container {
    display: flex;
    margin: 20px 0;
    gap: 20px;
}

.graph {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    min-height: 400px;
    flex-grow: 2;
    position: relative;
    overflow: hidden;
}

.status-panel {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    width: 250px;
    flex-shrink: 0;
}

.status-heading {
    font-weight: 600;
    color: #00e0ff;
    margin-bottom: 10px;
    font-size: 16px;
}

.status-content {
    font-size: 14px;
    line-height: 1.5;
}

.explanation {
    margin-top: 30px;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 8px;
}

.explanation h2 {
    color: #00e0ff;
    margin-top: 0;
}

.explanation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.explanation-item h3 {
    color: #ffffff;
    margin-top: 0;
}

.explanation ul {
    padding-left: 20px;
}

.explanation li {
    margin-bottom: 8px;
}

/* Graph Elements */
.node {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: move;
    user-select: none;
}

.process {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #a566ff;
    border: 2px solid #7c3aed;
}

.resource {
    width: 50px;
    height: 50px;
    background: #3cc5ff;
    border: 2px solid #2196f3;
}

.edge {
    position: absolute;
    height: 2px;
    background-color: #ffffff;
    transform-origin: 0 0;
    pointer-events: none;
    z-index: 1;
}

.arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid #ffffff;
    transform: rotate(90deg);
    transform-origin: 50% 0;
    pointer-events: none;
    z-index: 1;
}

.deadlock-cycle {
    background-color: #ff4a4a;
    border-color: #d32f2f;
}

.highlight {
    box-shadow: 0 0 10px #ffeb3b, 0 0 20px #ffeb3b;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 10px #ffeb3b, 0 0 20px #ffeb3b;
    }
    50% {
        box-shadow: 0 0 15px #ffeb3b, 0 0 30px #ffeb3b;
    }
    100% {
        box-shadow: 0 0 10px #ffeb3b, 0 0 20px #ffeb3b;
    }
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .graph-container {
        flex-direction: column;
    }
    
    .status-panel {
        width: auto;
    }
    
    .explanation-grid {
        grid-template-columns: 1fr;
    }
}